Skip to content

Commit

Permalink
fix python scripts after #2417
Browse files Browse the repository at this point in the history
  • Loading branch information
armingeiser committed Oct 18, 2018
1 parent 64e9010 commit ef3d24e
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,40 @@ def UpdateMeshAccordingInputVariable(self, variable):
def Finalize(self):
self._mesh_moving_analysis.Finalize()

# --------------------------------------------------------------------------
@staticmethod
def __AddDefaultProblemData(mesh_solver_settings):
problem_data = Parameters("""{
"echo_level" : 0,
"start_time" : 0.0,
"end_time" : 1.0,
"parallel_type" : "OpenMP"
}""")

mesh_solver_settings.AddValue("problem_data", problem_data)

# --------------------------------------------------------------------------
@staticmethod
def __FixWholeSurface(optimization_model_part, mesh_solver_settings):
optimization_model_part.CreateSubModelPart("auto_surface_nodes")

auto_process_settings = Parameters(
"""
{
"python_module" : "fix_vector_variable_process",
"kratos_module" : "KratosMultiphysics",
"help" : "This process fixes the selected components of a given vector variable without modifying the value of the variable.",
"process_name" : "FixVectorVariableProcess",
"Parameters" : {
"model_part_name" : \""""+str(optimization_model_part.Name)+""".auto_surface_nodes\",
"variable_name" : "MESH_DISPLACEMENT",
"constrained" : [true,true,true]
}
}
""")

print("Add automatic process to fix the whole surface to mesh motion solver:")
print(auto_process_settings)
mesh_solver_settings["boundary_conditions_process_list"].Append(auto_process_settings)

# ==============================================================================
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ def __init__(self, model_settings, model):

model_part_name = self.model_settings["model_part_name"].GetString()

self.optimization_model_part = ModelPart(model_part_name)
self.model.AddModelPart(self.optimization_model_part)
# TODO use this line after model_v3 is merged:
# self.optimization_model_part = model.CreateModelPart(model_part_name)
self.optimization_model_part = model.CreateModelPart(model_part_name)

self.optimization_model_part.ProcessInfo.SetValue(DOMAIN_SIZE, self.model_settings["domain_size"].GetInt())

Expand Down

0 comments on commit ef3d24e

Please sign in to comment.