beamme.four_c.input_file_mappings
This file provides the mappings between BeamMe objects and 4C input files.
1# The MIT License (MIT) 2# 3# Copyright (c) 2018-2025 BeamMe Authors 4# 5# Permission is hereby granted, free of charge, to any person obtaining a copy 6# of this software and associated documentation files (the "Software"), to deal 7# in the Software without restriction, including without limitation the rights 8# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9# copies of the Software, and to permit persons to whom the Software is 10# furnished to do so, subject to the following conditions: 11# 12# The above copyright notice and this permission notice shall be included in 13# all copies or substantial portions of the Software. 14# 15# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21# THE SOFTWARE. 22"""This file provides the mappings between BeamMe objects and 4C input 23files.""" 24 25from typing import Any as _Any 26 27from beamme.core.conf import bme as _bme 28from beamme.core.element_volume import ( 29 VolumeHEX8 as _VolumeHEX8, 30) 31from beamme.core.element_volume import ( 32 VolumeHEX20 as _VolumeHEX20, 33) 34from beamme.core.element_volume import ( 35 VolumeHEX27 as _VolumeHEX27, 36) 37from beamme.core.element_volume import ( 38 VolumeTET4 as _VolumeTET4, 39) 40from beamme.core.element_volume import ( 41 VolumeTET10 as _VolumeTET10, 42) 43from beamme.core.element_volume import ( 44 VolumeWEDGE6 as _VolumeWEDGE6, 45) 46from beamme.four_c.element_volume import SolidRigidSphere as _SolidRigidSphere 47from beamme.four_c.four_c_types import BeamType as _BeamType 48 49INPUT_FILE_MAPPINGS: dict[str, _Any] = {} 50INPUT_FILE_MAPPINGS["beam_types"] = { 51 _BeamType.reissner: "BEAM3R", 52 _BeamType.kirchhoff: "BEAM3K", 53 _BeamType.euler_bernoulli: "BEAM3EB", 54} 55INPUT_FILE_MAPPINGS["boundary_conditions"] = { 56 (_bme.bc.dirichlet, _bme.geo.point): "DESIGN POINT DIRICH CONDITIONS", 57 (_bme.bc.dirichlet, _bme.geo.line): "DESIGN LINE DIRICH CONDITIONS", 58 (_bme.bc.dirichlet, _bme.geo.surface): "DESIGN SURF DIRICH CONDITIONS", 59 (_bme.bc.dirichlet, _bme.geo.volume): "DESIGN VOL DIRICH CONDITIONS", 60 (_bme.bc.locsys, _bme.geo.point): "DESIGN POINT LOCSYS CONDITIONS", 61 (_bme.bc.locsys, _bme.geo.line): "DESIGN LINE LOCSYS CONDITIONS", 62 (_bme.bc.locsys, _bme.geo.surface): "DESIGN SURF LOCSYS CONDITIONS", 63 (_bme.bc.locsys, _bme.geo.volume): "DESIGN VOL LOCSYS CONDITIONS", 64 (_bme.bc.neumann, _bme.geo.point): "DESIGN POINT NEUMANN CONDITIONS", 65 (_bme.bc.neumann, _bme.geo.line): "DESIGN LINE NEUMANN CONDITIONS", 66 (_bme.bc.neumann, _bme.geo.surface): "DESIGN SURF NEUMANN CONDITIONS", 67 (_bme.bc.neumann, _bme.geo.volume): "DESIGN VOL NEUMANN CONDITIONS", 68 ( 69 _bme.bc.moment_euler_bernoulli, 70 _bme.geo.point, 71 ): "DESIGN POINT MOMENT EB CONDITIONS", 72 ( 73 _bme.bc.beam_to_solid_volume_meshtying, 74 _bme.geo.line, 75 ): "BEAM INTERACTION/BEAM TO SOLID VOLUME MESHTYING LINE", 76 ( 77 _bme.bc.beam_to_solid_volume_meshtying, 78 _bme.geo.volume, 79 ): "BEAM INTERACTION/BEAM TO SOLID VOLUME MESHTYING VOLUME", 80 ( 81 _bme.bc.beam_to_solid_surface_meshtying, 82 _bme.geo.line, 83 ): "BEAM INTERACTION/BEAM TO SOLID SURFACE MESHTYING LINE", 84 ( 85 _bme.bc.beam_to_solid_surface_meshtying, 86 _bme.geo.surface, 87 ): "BEAM INTERACTION/BEAM TO SOLID SURFACE MESHTYING SURFACE", 88 ( 89 _bme.bc.beam_to_solid_surface_contact, 90 _bme.geo.line, 91 ): "BEAM INTERACTION/BEAM TO SOLID SURFACE CONTACT LINE", 92 ( 93 _bme.bc.beam_to_solid_surface_contact, 94 _bme.geo.surface, 95 ): "BEAM INTERACTION/BEAM TO SOLID SURFACE CONTACT SURFACE", 96 (_bme.bc.point_coupling, _bme.geo.point): "DESIGN POINT COUPLING CONDITIONS", 97 ( 98 _bme.bc.beam_to_beam_contact, 99 _bme.geo.line, 100 ): "BEAM INTERACTION/BEAM TO BEAM CONTACT CONDITIONS", 101 ( 102 _bme.bc.point_coupling_penalty, 103 _bme.geo.point, 104 ): "DESIGN POINT PENALTY COUPLING CONDITIONS", 105 ( 106 "DESIGN SURF MORTAR CONTACT CONDITIONS 3D", 107 _bme.geo.surface, 108 ): "DESIGN SURF MORTAR CONTACT CONDITIONS 3D", 109} 110INPUT_FILE_MAPPINGS["element_type_to_four_c_string"] = { 111 _VolumeHEX8: "HEX8", 112 _VolumeHEX20: "HEX20", 113 _VolumeHEX27: "HEX27", 114 _VolumeTET4: "TET4", 115 _VolumeTET10: "TET10", 116 _VolumeWEDGE6: "WEDGE6", 117 _SolidRigidSphere: "POINT1", 118} 119INPUT_FILE_MAPPINGS["element_four_c_string_to_type"] = { 120 value: key 121 for key, value in INPUT_FILE_MAPPINGS["element_type_to_four_c_string"].items() 122} 123INPUT_FILE_MAPPINGS["geometry_sets_geometry_to_condition_name"] = { 124 _bme.geo.point: "DNODE-NODE TOPOLOGY", 125 _bme.geo.line: "DLINE-NODE TOPOLOGY", 126 _bme.geo.surface: "DSURF-NODE TOPOLOGY", 127 _bme.geo.volume: "DVOL-NODE TOPOLOGY", 128} 129INPUT_FILE_MAPPINGS["geometry_sets_geometry_to_entry_name"] = { 130 _bme.geo.point: "DNODE", 131 _bme.geo.line: "DLINE", 132 _bme.geo.surface: "DSURFACE", 133 _bme.geo.volume: "DVOL", 134} 135INPUT_FILE_MAPPINGS["n_nodes_to_cell_type"] = {2: "LINE2", 3: "LINE3"} 136INPUT_FILE_MAPPINGS["n_nodes_to_node_ordering"] = {2: [0, 1], 3: [0, 2, 1]}
INPUT_FILE_MAPPINGS: dict[str, typing.Any] =
{'beam_types': {<BeamType.reissner: 1>: 'BEAM3R', <BeamType.kirchhoff: 2>: 'BEAM3K', <BeamType.euler_bernoulli: 3>: 'BEAM3EB'}, 'boundary_conditions': {(<BoundaryCondition.dirichlet: 1>, <Geometry.point: 1>): 'DESIGN POINT DIRICH CONDITIONS', (<BoundaryCondition.dirichlet: 1>, <Geometry.line: 2>): 'DESIGN LINE DIRICH CONDITIONS', (<BoundaryCondition.dirichlet: 1>, <Geometry.surface: 3>): 'DESIGN SURF DIRICH CONDITIONS', (<BoundaryCondition.dirichlet: 1>, <Geometry.volume: 4>): 'DESIGN VOL DIRICH CONDITIONS', (<BoundaryCondition.locsys: 3>, <Geometry.point: 1>): 'DESIGN POINT LOCSYS CONDITIONS', (<BoundaryCondition.locsys: 3>, <Geometry.line: 2>): 'DESIGN LINE LOCSYS CONDITIONS', (<BoundaryCondition.locsys: 3>, <Geometry.surface: 3>): 'DESIGN SURF LOCSYS CONDITIONS', (<BoundaryCondition.locsys: 3>, <Geometry.volume: 4>): 'DESIGN VOL LOCSYS CONDITIONS', (<BoundaryCondition.neumann: 2>, <Geometry.point: 1>): 'DESIGN POINT NEUMANN CONDITIONS', (<BoundaryCondition.neumann: 2>, <Geometry.line: 2>): 'DESIGN LINE NEUMANN CONDITIONS', (<BoundaryCondition.neumann: 2>, <Geometry.surface: 3>): 'DESIGN SURF NEUMANN CONDITIONS', (<BoundaryCondition.neumann: 2>, <Geometry.volume: 4>): 'DESIGN VOL NEUMANN CONDITIONS', (<BoundaryCondition.moment_euler_bernoulli: 4>, <Geometry.point: 1>): 'DESIGN POINT MOMENT EB CONDITIONS', (<BoundaryCondition.beam_to_solid_volume_meshtying: 6>, <Geometry.line: 2>): 'BEAM INTERACTION/BEAM TO SOLID VOLUME MESHTYING LINE', (<BoundaryCondition.beam_to_solid_volume_meshtying: 6>, <Geometry.volume: 4>): 'BEAM INTERACTION/BEAM TO SOLID VOLUME MESHTYING VOLUME', (<BoundaryCondition.beam_to_solid_surface_meshtying: 7>, <Geometry.line: 2>): 'BEAM INTERACTION/BEAM TO SOLID SURFACE MESHTYING LINE', (<BoundaryCondition.beam_to_solid_surface_meshtying: 7>, <Geometry.surface: 3>): 'BEAM INTERACTION/BEAM TO SOLID SURFACE MESHTYING SURFACE', (<BoundaryCondition.beam_to_solid_surface_contact: 8>, <Geometry.line: 2>): 'BEAM INTERACTION/BEAM TO SOLID SURFACE CONTACT LINE', (<BoundaryCondition.beam_to_solid_surface_contact: 8>, <Geometry.surface: 3>): 'BEAM INTERACTION/BEAM TO SOLID SURFACE CONTACT SURFACE', (<BoundaryCondition.point_coupling: 9>, <Geometry.point: 1>): 'DESIGN POINT COUPLING CONDITIONS', (<BoundaryCondition.beam_to_beam_contact: 5>, <Geometry.line: 2>): 'BEAM INTERACTION/BEAM TO BEAM CONTACT CONDITIONS', (<BoundaryCondition.point_coupling_penalty: 10>, <Geometry.point: 1>): 'DESIGN POINT PENALTY COUPLING CONDITIONS', ('DESIGN SURF MORTAR CONTACT CONDITIONS 3D', <Geometry.surface: 3>): 'DESIGN SURF MORTAR CONTACT CONDITIONS 3D'}, 'element_type_to_four_c_string': {<class 'beamme.core.element_volume.VolumeHEX8'>: 'HEX8', <class 'beamme.core.element_volume.VolumeHEX20'>: 'HEX20', <class 'beamme.core.element_volume.VolumeHEX27'>: 'HEX27', <class 'beamme.core.element_volume.VolumeTET4'>: 'TET4', <class 'beamme.core.element_volume.VolumeTET10'>: 'TET10', <class 'beamme.core.element_volume.VolumeWEDGE6'>: 'WEDGE6', <class 'beamme.four_c.element_volume.SolidRigidSphere'>: 'POINT1'}, 'element_four_c_string_to_type': {'HEX8': <class 'beamme.core.element_volume.VolumeHEX8'>, 'HEX20': <class 'beamme.core.element_volume.VolumeHEX20'>, 'HEX27': <class 'beamme.core.element_volume.VolumeHEX27'>, 'TET4': <class 'beamme.core.element_volume.VolumeTET4'>, 'TET10': <class 'beamme.core.element_volume.VolumeTET10'>, 'WEDGE6': <class 'beamme.core.element_volume.VolumeWEDGE6'>, 'POINT1': <class 'beamme.four_c.element_volume.SolidRigidSphere'>}, 'geometry_sets_geometry_to_condition_name': {<Geometry.point: 1>: 'DNODE-NODE TOPOLOGY', <Geometry.line: 2>: 'DLINE-NODE TOPOLOGY', <Geometry.surface: 3>: 'DSURF-NODE TOPOLOGY', <Geometry.volume: 4>: 'DVOL-NODE TOPOLOGY'}, 'geometry_sets_geometry_to_entry_name': {<Geometry.point: 1>: 'DNODE', <Geometry.line: 2>: 'DLINE', <Geometry.surface: 3>: 'DSURFACE', <Geometry.volume: 4>: 'DVOL'}, 'n_nodes_to_cell_type': {2: 'LINE2', 3: 'LINE3'}, 'n_nodes_to_node_ordering': {2: [0, 1], 3: [0, 2, 1]}}