MCPcopy Create free account
hub / github.com/KratosMultiphysics/Kratos / ReadModelPart

Function ReadModelPart

kratos/python_scripts/testing/utilities.py:22–39  ·  view source on GitHub ↗

This method is designed to read a ModelPart. The ModelPart is filled with respective nodes, conditions, elements from mdpa file using either MPI or Serial reading depending on run type. Args: mdpa_file_name (str): Name of the mdpa file (without ".mdpa" extension) model_

(mdpa_file_name, model_part, settings=None)

Source from the content-addressed store, hash-verified

20
21
22def ReadModelPart(mdpa_file_name, model_part, settings=None):
23 """This method is designed to read a ModelPart.
24
25 The ModelPart is filled with respective nodes, conditions, elements
26 from mdpa file using either MPI or Serial reading depending on run type.
27
28 Args:
29 mdpa_file_name (str): Name of the mdpa file (without ".mdpa" extension)
30 model_part (Kratos.ModelPart): ModelPart to be filled
31 """
32 if model_part.NumberOfNodes() > 0:
33 raise Exception("ModelPart must not contain Nodes!")
34
35 communicator = Kratos.Testing.GetDefaultDataCommunicator()
36 if communicator.IsDistributed():
37 ReadDistributedModelPart(mdpa_file_name, model_part, settings)
38 else:
39 ReadSerialModelPart(mdpa_file_name, model_part)
40
41
42def ReadSerialModelPart(mdpa_file_name, model_part):

Callers 15

SetupModelPartsFunction · 0.90
setUpClassMethod · 0.90
setUpClassMethod · 0.90
setUpModelPartsMethod · 0.90
_SurrogateModelPartFunction · 0.90
MakeModelMethod · 0.90
setUpClassMethod · 0.90
MakeModelMethod · 0.90

Calls 4

ReadDistributedModelPartFunction · 0.85
ReadSerialModelPartFunction · 0.85
NumberOfNodesMethod · 0.45
IsDistributedMethod · 0.45

Tested by 15

SetupModelPartsFunction · 0.72
setUpClassMethod · 0.72
setUpClassMethod · 0.72
setUpModelPartsMethod · 0.72
_SurrogateModelPartFunction · 0.72
MakeModelMethod · 0.72
setUpClassMethod · 0.72
MakeModelMethod · 0.72