@@ -102,7 +102,7 @@ def _get_yaml_geometry_sets(
102
102
return geometry_sets_in_this_section
103
103
104
104
105
- class InputFile ( _Mesh ) :
105
+ class InputFile :
106
106
"""An item that represents a complete 4C input file."""
107
107
108
108
# Define the names of sections and boundary conditions in the input file.
@@ -180,7 +180,7 @@ def __init__(self, *, yaml_file: _Optional[_Path] = None, cubit=None):
180
180
into this input file.
181
181
"""
182
182
183
- super (). __init__ ()
183
+ self . mesh = _Mesh ()
184
184
185
185
# Everything that is not a full MeshPy object is stored here, e.g., parameters
186
186
# and imported nodes/elements/materials/...
@@ -311,7 +311,7 @@ def add(self, *args, **kwargs):
311
311
self .add_section (args [0 ], ** kwargs )
312
312
return
313
313
314
- super () .add (* args , ** kwargs )
314
+ self . mesh .add (* args , ** kwargs )
315
315
316
316
def add_section (self , section , * , option_overwrite = False ):
317
317
"""Add a section to the object.
@@ -428,7 +428,7 @@ def get_dict_to_dump(
428
428
429
429
# Perform some checks on the mesh.
430
430
if _mpy .check_overlapping_elements :
431
- self .check_overlapping_elements ()
431
+ self .mesh . check_overlapping_elements ()
432
432
433
433
# The base dictionary we use here is the one that already exists.
434
434
# This one might already contain mesh sections - stored in pure
@@ -578,36 +578,36 @@ def _dump_mesh_items(yaml_dict, section_name, data_list):
578
578
item_dict_list .extend (item .dump_to_list ())
579
579
580
580
# Add sets from couplings and boundary conditions to a temp container.
581
- self .unlink_nodes ()
581
+ self .mesh . unlink_nodes ()
582
582
start_indices_geometry_set = _get_global_start_geometry_set (yaml_dict )
583
- mesh_sets = self .get_unique_geometry_sets (
583
+ mesh_sets = self .mesh . get_unique_geometry_sets (
584
584
geometry_set_start_indices = start_indices_geometry_set
585
585
)
586
586
587
587
# Assign global indices to all entries.
588
588
start_index_nodes = _get_global_start_node (yaml_dict )
589
- _set_i_global (self .nodes , start_index = start_index_nodes )
589
+ _set_i_global (self .mesh . nodes , start_index = start_index_nodes )
590
590
start_index_elements = _get_global_start_element (yaml_dict )
591
- _set_i_global_elements (self .elements , start_index = start_index_elements )
591
+ _set_i_global_elements (self .mesh . elements , start_index = start_index_elements )
592
592
start_index_materials = _get_global_start_material (yaml_dict )
593
- _set_i_global (self .materials , start_index = start_index_materials )
593
+ _set_i_global (self .mesh . materials , start_index = start_index_materials )
594
594
start_index_functions = _get_global_start_function (yaml_dict )
595
- _set_i_global (self .functions , start_index = start_index_functions )
595
+ _set_i_global (self .mesh . functions , start_index = start_index_functions )
596
596
597
597
# Add material data to the input file.
598
- _dump_mesh_items (yaml_dict , "MATERIALS" , self .materials )
598
+ _dump_mesh_items (yaml_dict , "MATERIALS" , self .mesh . materials )
599
599
600
600
# Add the functions.
601
- for function in self .functions :
601
+ for function in self .mesh . functions :
602
602
yaml_dict [f"FUNCT{ function .i_global } " ] = function .dump_to_list ()
603
603
604
604
# If there are couplings in the mesh, set the link between the nodes
605
605
# and elements, so the couplings can decide which DOFs they couple,
606
606
# depending on the type of the connected beam element.
607
607
def get_number_of_coupling_conditions (key ):
608
608
"""Return the number of coupling conditions in the mesh."""
609
- if (key , _mpy .geo .point ) in self .boundary_conditions .keys ():
610
- return len (self .boundary_conditions [key , _mpy .geo .point ])
609
+ if (key , _mpy .geo .point ) in self .mesh . boundary_conditions .keys ():
610
+ return len (self .mesh . boundary_conditions [key , _mpy .geo .point ])
611
611
else :
612
612
return 0
613
613
@@ -616,10 +616,10 @@ def get_number_of_coupling_conditions(key):
616
616
+ get_number_of_coupling_conditions (_mpy .bc .point_coupling_penalty )
617
617
> 0
618
618
):
619
- self .set_node_links ()
619
+ self .mesh . set_node_links ()
620
620
621
621
# Add the boundary conditions.
622
- for (bc_key , geom_key ), bc_list in self .boundary_conditions .items ():
622
+ for (bc_key , geom_key ), bc_list in self .mesh . boundary_conditions .items ():
623
623
if len (bc_list ) > 0 :
624
624
section_name = (
625
625
bc_key
@@ -629,7 +629,7 @@ def get_number_of_coupling_conditions(key):
629
629
_dump_mesh_items (yaml_dict , section_name , bc_list )
630
630
631
631
# Add additional element sections, e.g., for NURBS knot vectors.
632
- for element in self .elements :
632
+ for element in self .mesh . elements :
633
633
element .dump_element_specific_section (yaml_dict )
634
634
635
635
# Add the geometry sets.
@@ -638,8 +638,8 @@ def get_number_of_coupling_conditions(key):
638
638
_dump_mesh_items (yaml_dict , self .geometry_set_names [geom_key ], item )
639
639
640
640
# Add the nodes and elements.
641
- _dump_mesh_items (yaml_dict , "NODE COORDS" , self .nodes )
642
- _dump_mesh_items (yaml_dict , "STRUCTURE ELEMENTS" , self .elements )
641
+ _dump_mesh_items (yaml_dict , "NODE COORDS" , self .mesh . nodes )
642
+ _dump_mesh_items (yaml_dict , "STRUCTURE ELEMENTS" , self .mesh . elements )
643
643
644
644
return yaml_dict
645
645
0 commit comments