@@ -128,7 +128,7 @@ def _get_yaml_geometry_sets(
128
128
return geometry_sets_in_this_section
129
129
130
130
131
- class InputFile ( _Mesh ) :
131
+ class InputFile :
132
132
"""An item that represents a complete 4C input file."""
133
133
134
134
# Define the names of sections and boundary conditions in the input file.
@@ -206,7 +206,7 @@ def __init__(self, *, yaml_file: _Optional[_Path] = None, cubit=None):
206
206
into this input file.
207
207
"""
208
208
209
- super (). __init__ ()
209
+ self . mesh = _Mesh ()
210
210
211
211
# Everything that is not a full MeshPy object is stored here, e.g., parameters
212
212
# and imported nodes/elements/materials/...
@@ -345,7 +345,7 @@ def add(self, *args, **kwargs):
345
345
self .add_section (args [0 ], ** kwargs )
346
346
return
347
347
348
- super () .add (* args , ** kwargs )
348
+ self . mesh .add (* args , ** kwargs )
349
349
350
350
def add_section (self , section , * , option_overwrite = False ):
351
351
"""Add a section to the object.
@@ -462,7 +462,7 @@ def get_dict_to_dump(
462
462
463
463
# Perform some checks on the mesh.
464
464
if _mpy .check_overlapping_elements :
465
- self .check_overlapping_elements ()
465
+ self .mesh . check_overlapping_elements ()
466
466
467
467
# The base dictionary we use here is the one that already exists.
468
468
# This one might already contain mesh sections - stored in pure
@@ -619,36 +619,36 @@ def _dump_mesh_items(yaml_dict, section_name, data_list):
619
619
raise TypeError (f"Could not dump { item } " )
620
620
621
621
# Add sets from couplings and boundary conditions to a temp container.
622
- self .unlink_nodes ()
622
+ self .mesh . unlink_nodes ()
623
623
start_indices_geometry_set = _get_global_start_geometry_set (yaml_dict )
624
- mesh_sets = self .get_unique_geometry_sets (
624
+ mesh_sets = self .mesh . get_unique_geometry_sets (
625
625
geometry_set_start_indices = start_indices_geometry_set
626
626
)
627
627
628
628
# Assign global indices to all entries.
629
629
start_index_nodes = _get_global_start_node (yaml_dict )
630
- _set_i_global (self .nodes , start_index = start_index_nodes )
630
+ _set_i_global (self .mesh . nodes , start_index = start_index_nodes )
631
631
start_index_elements = _get_global_start_element (yaml_dict )
632
- _set_i_global_elements (self .elements , start_index = start_index_elements )
632
+ _set_i_global_elements (self .mesh . elements , start_index = start_index_elements )
633
633
start_index_materials = _get_global_start_material (yaml_dict )
634
- _set_i_global (self .materials , start_index = start_index_materials )
634
+ _set_i_global (self .mesh . materials , start_index = start_index_materials )
635
635
start_index_functions = _get_global_start_function (yaml_dict )
636
- _set_i_global (self .functions , start_index = start_index_functions )
636
+ _set_i_global (self .mesh . functions , start_index = start_index_functions )
637
637
638
638
# Add material data to the input file.
639
- _dump_mesh_items (yaml_dict , "MATERIALS" , self .materials )
639
+ _dump_mesh_items (yaml_dict , "MATERIALS" , self .mesh . materials )
640
640
641
641
# Add the functions.
642
- for function in self .functions :
642
+ for function in self .mesh . functions :
643
643
yaml_dict [f"FUNCT{ function .i_global } " ] = function .dump_to_list ()
644
644
645
645
# If there are couplings in the mesh, set the link between the nodes
646
646
# and elements, so the couplings can decide which DOFs they couple,
647
647
# depending on the type of the connected beam element.
648
648
def get_number_of_coupling_conditions (key ):
649
649
"""Return the number of coupling conditions in the mesh."""
650
- if (key , _mpy .geo .point ) in self .boundary_conditions .keys ():
651
- return len (self .boundary_conditions [key , _mpy .geo .point ])
650
+ if (key , _mpy .geo .point ) in self .mesh . boundary_conditions .keys ():
651
+ return len (self .mesh . boundary_conditions [key , _mpy .geo .point ])
652
652
else :
653
653
return 0
654
654
@@ -657,10 +657,10 @@ def get_number_of_coupling_conditions(key):
657
657
+ get_number_of_coupling_conditions (_mpy .bc .point_coupling_penalty )
658
658
> 0
659
659
):
660
- self .set_node_links ()
660
+ self .mesh . set_node_links ()
661
661
662
662
# Add the boundary conditions.
663
- for (bc_key , geom_key ), bc_list in self .boundary_conditions .items ():
663
+ for (bc_key , geom_key ), bc_list in self .mesh . boundary_conditions .items ():
664
664
if len (bc_list ) > 0 :
665
665
section_name = (
666
666
bc_key
@@ -670,7 +670,7 @@ def get_number_of_coupling_conditions(key):
670
670
_dump_mesh_items (yaml_dict , section_name , bc_list )
671
671
672
672
# Add additional element sections, e.g., for NURBS knot vectors.
673
- for element in self .elements :
673
+ for element in self .mesh . elements :
674
674
element .dump_element_specific_section (yaml_dict )
675
675
676
676
# Add the geometry sets.
@@ -679,8 +679,8 @@ def get_number_of_coupling_conditions(key):
679
679
_dump_mesh_items (yaml_dict , self .geometry_set_names [geom_key ], item )
680
680
681
681
# Add the nodes and elements.
682
- _dump_mesh_items (yaml_dict , "NODE COORDS" , self .nodes )
683
- _dump_mesh_items (yaml_dict , "STRUCTURE ELEMENTS" , self .elements )
682
+ _dump_mesh_items (yaml_dict , "NODE COORDS" , self .mesh . nodes )
683
+ _dump_mesh_items (yaml_dict , "STRUCTURE ELEMENTS" , self .mesh . elements )
684
684
685
685
return yaml_dict
686
686
0 commit comments