# including kratos path from KratosMultiphysics import * from KratosMultiphysics.StructuralApplication import * from KratosMultiphysics.ExternalSolversApplication import * # setting the domain size for the problem to be solved domain_size = Kratos_Structural_Application_var.domain_size # defining a model part model_part = ModelPart("StructurePart") model_part.AddNodalSolutionStepVariable(FORCE) if (Kratos_Structural_Application_var.Rotational_Dofs == "True"): model_part.AddNodalSolutionStepVariable(ROTATION) import structural_solver_dynamic as SolverType SolverType.AddVariables(model_part) # reading a model name = Kratos_Structural_Application_var.problem_name gid_mode = GiDPostMode.GiD_PostBinary multifile = MultiFileFlag.MultipleFiles deformed_mesh_flag = WriteDeformedMeshFlag.WriteUndeformed write_conditions = WriteConditionsFlag.WriteElementsOnly gid_io = GidIO(name, gid_mode, multifile, deformed_mesh_flag, write_conditions) model_part_io = ModelPartIO(name) model_part_io.ReadModelPart(model_part) mesh_name = 0.0 gid_io.InitializeMesh(mesh_name) gid_io.WriteMesh((model_part).GetMesh())
kernel = Kernel() # defining kernel # from now on the order is not anymore crucial # # # defining a model part model_part = ModelPart("StructurePart") # adding of Variables to Model Part should be here when the "very fix container will be ready" if (fsi_structure_var.SolverType == "StaticSolver"): import structural_solver_static structural_solver_static.AddVariables(model_part) elif (fsi_structure_var.SolverType == "DynamicSolver"): import structural_solver_dynamic structural_solver_dynamic.AddVariables(model_part) # reading a model name = fsi_structure_var.problem_name gid_mode = GiDPostMode.GiD_PostBinary multifile = MultiFileFlag.MultipleFiles deformed_mesh_flag = WriteDeformedMeshFlag.WriteUndeformed write_conditions = WriteConditionsFlag.WriteElementsOnly gid_io = GidIO(name, gid_mode, multifile, deformed_mesh_flag, write_conditions) model_part_io = ModelPartIO(name) model_part_io.ReadModelPart(model_part) mesh_name = 0.0 gid_io.InitializeMesh(mesh_name) gid_io.WriteMesh((model_part).GetMesh())