deformed_mesh_flag = WriteDeformedMeshFlag.WriteDeformed
write_conditions = WriteConditionsFlag.WriteElementsOnly

# reading the pfem model part
gid_io = GidIO(name_pfem, gid_mode, multifile, deformed_mesh_flag,
               write_conditions)
model_part_io_pfem = ModelPartIO(name_pfem)
model_part_io_pfem.ReadModelPart(pfem_model_part)
# reading the fixed model part
model_part_io_fixed = ModelPartIO(name_fixed)
model_part_io_fixed.ReadModelPart(fixed_model_part)
# the buffer size should be set up here after the mesh is read for the first time
pfem_model_part.SetBufferSize(2)

# importing the solver files
pfem_solver_ale.AddDofs(pfem_model_part)
for node in pfem_model_part.Nodes:
    node.AddDof(DISTANCE)
    node.AddDof(TEMPERATURE)
pfem_solver_ale.AddDofs(fixed_model_part)
for node in fixed_model_part.Nodes:
    node.AddDof(DISTANCE)
    node.AddDof(TEMPERATURE)
# print "LINE 80"
# setting the limits of the bounding box
box_corner1 = Vector(3)
box_corner1[0] = -3.0
box_corner1[1] = -3.0
box_corner1[2] = -3.0
box_corner2 = Vector(3)
box_corner2[0] = 20.0
Beispiel #2
0
box_corner2[1] = problem_settings.max_y
box_corner2[2] = problem_settings.max_z

# time setting
output_Dt = problem_settings.output_Dt
max_dt = problem_settings.max_dt
min_dt = problem_settings.min_dt
safety_factor = problem_settings.safety_factor
# nsteps = int(problem_settings.nsteps)
final_time = problem_settings.max_time
# the buffer size should be set up here after the mesh is read for the first time
model_part.SetBufferSize(2)

if (SolverType == "pfem_solver_ale"):
    # adding dofs
    pfem_solver_ale.AddDofs(model_part)
    # creating a fluid solver object
    solver = pfem_solver_ale.PFEMSolver(model_part, name, box_corner1,
                                        box_corner2, domain_size)
    solver.laplacian_form = int(problem_settings.laplacian_form)
    solver.echo_level = 0
    solver.prediction_order = 1
    solver.predictor_corrector = True
    solver.smooth = True
    solver.alpha_shape = 1.2
    solver.max_press_its = 3
    # initializing the solver
    initial_dt = 0.001 * min_dt
    solver.Initialize(initial_dt, output_Dt)
elif (SolverType == "monolithic_solver_lagrangian"):
    # adding dofs