# reading the fluid part gid_mode = GiDPostMode.GiD_PostBinary multifile = MultiFileFlag.MultipleFiles deformed_mesh_flag = WriteDeformedMeshFlag.WriteDeformed write_conditions = WriteConditionsFlag.WriteConditions gid_io = GidIO(input_file_name, gid_mode, multifile, deformed_mesh_flag, write_conditions) model_part_io_origin = ModelPartIO(input_file_name) model_part_io_origin.ReadModelPart(fluid_model_part) # setting up the buffer size: SHOULD BE DONE AFTER READING!!! fluid_model_part.SetBufferSize(3) # adding dofs if (SolverType == "Incompressible_Modified_FracStep"): ulf_frac.AddDofs(fluid_model_part, 0) elif (SolverType == "FracStep"): ulf_frac.AddDofs(fluid_model_part) elif (SolverType == "Quasi_Inc_Constant_Pressure"): ulf_fsi.AddDofs(fluid_model_part) elif (SolverType == "Quasi_Inc_Linear_Pressure"): ulf_fsi_inc.AddDofs(fluid_model_part, 0) if (SolverType == "Quasi_Inc_Constant_Pressure" or SolverType == "Quasi_Inc_Linear_Pressure"): for node in fluid_model_part.Nodes: node.Free(PRESSURE) # check to ensure that no node has zero density or pressure for node in fluid_model_part.Nodes: if (node.GetSolutionStepValue(DENSITY) == 0.0):
gid_mode = GiDPostMode.GiD_PostBinary multifile = MultiFileFlag.MultipleFiles deformed_mesh_flag = WriteDeformedMeshFlag.WriteDeformed write_conditions = WriteConditionsFlag.WriteConditions gid_io = GidIO(input_file_name, gid_mode, multifile, deformed_mesh_flag, write_conditions) model_part_io_origin = ModelPartIO(input_file_name) model_part_io_origin.ReadModelPart(fluid_model_part) #setting up the buffer size: SHOULD BE DONE AFTER READING!!! fluid_model_part.SetBufferSize(3) compute_reactions = fluid_ulf_var.compute_reactions ##adding dofs if (SolverType == "Incompressible_Modified_FracStep"): ulf_frac.AddDofs(fluid_model_part, compute_reactions) elif (SolverType == "FracStep"): ulf_frac.AddDofs(fluid_model_part, compute_reactions) elif (SolverType == "Quasi_Inc_Constant_Pressure"): ulf_fsi.AddDofs(fluid_model_part, compute_reactions) elif (SolverType == "Quasi_Inc_Linear_Pressure"): ulf_fsi_inc.AddDofs(fluid_model_part, compute_reactions) #setting the limits of the bounding box box_corner1 = Vector(3) box_corner1[0] = fluid_ulf_var.bounding_box_corner1_x box_corner1[1] = fluid_ulf_var.bounding_box_corner1_y box_corner1[2] = fluid_ulf_var.bounding_box_corner1_z box_corner2 = Vector(3) box_corner2[0] = fluid_ulf_var.bounding_box_corner2_x box_corner2[1] = fluid_ulf_var.bounding_box_corner2_y