ifc2ca major update - todo: update readme file

This commit is contained in:
Ioannis P. Christovasilis
2024-01-18 12:53:31 +01:00
parent 9a117ce502
commit bb05e51a92
20 changed files with 2680 additions and 2237 deletions
@@ -0,0 +1,80 @@
# STEP: DEFINE SUPPORTS AND CONSTRAINTS
connection = AFFE_CHAR_MECA(
MODELE = model,
{%- if vertexConnections %}
LIAISON_DDL = (
{%- for conn in vertexConnections %}
{%- if conn.appliedCondition %}
{%- for i in range(len(conn.liaisons.coeffs)) %}
_F(
GROUP_NO = {{ conn.liaisons.groupNames }},
DDL = {{ conn.liaisons.dofs[i] }},
COEF_MULT = {{ conn.liaisons.coeffs[i] }},
COEF_IMPO = 0.0
),
{%- endfor %}
{%- endif %}
{%- for rel in conn.related_elements %}
{%- for i in range(len(rel.liaisons.coeffs)) %}
_F(
GROUP_NO = {{ rel.liaisons.groupNames }},
DDL = {{ rel.liaisons.dofs[i] }},
COEF_MULT = {{ rel.liaisons.coeffs[i] }},
COEF_IMPO = 0.0
),
{%- endfor %}
{%- endfor %}
{%- endfor %}
),
{%- endif %}
{%- if edgeConnections %}
LIAISON_GROUP = (
{%- for conn in edgeConnections %}
{%- if conn.appliedCondition %}
{%- for i in range(len(conn.liaisons.coeffs)) %}
_F(
GROUP_NO_1 = {{ tuple([conn.liaisons.groupNames[0]]) }},
GROUP_NO_2 = {{ tuple([conn.liaisons.groupNames[0]]) }},
DDL_1 = {{ conn.liaisons.dofs[i] }},
DDL_2 = {{ conn.liaisons.dofs[i] }},
COEF_MULT_1 = {{ conn.liaisons.coeffs[i] }},
COEF_MULT_2 = (0.0, 0.0, 0.0),
COEF_IMPO = 0.0
),
{%- endfor %}
{%- endif %}
{%- for rel in conn.related_elements %}
{%- for i in range(len(rel.liaisons.coeffs)) %}
_F(
GROUP_NO_1 = {{ tuple([rel.liaisons.groupNames[0]]) }},
GROUP_NO_2 = {{ tuple([rel.liaisons.groupNames[3]]) }},
DDL_1 = {{ tuple(rel.liaisons.dofs[i][:3]) }},
DDL_2 = {{ tuple(rel.liaisons.dofs[i][:3]) }},
COEF_MULT_1 = {{ tuple(rel.liaisons.coeffs[i][:3]) }},
COEF_MULT_2 = {{ tuple(rel.liaisons.coeffs[i][3:]) }},
COEF_IMPO = 0.0
),
{%- endfor %}
{%- endfor %}
{%- endfor %}
),
{%- endif %}
{%- if unifiedConnections %}
LIAISON_UNIF = (
{%- for conn in unifiedConnections %}
_F(
GROUP_NO = {{ conn.unifiedGroupNames }},
DDL = ('DX', 'DY', 'DZ', 'DRX', 'DRY', 'DRZ')
),
{%- endfor %}
),
{%- endif %}
{%- if rigidLinkGroupNames %}
LIAISON_SOLIDE = (
{%- for groupName in rigidLinkGroupNames %}
_F(GROUP_MA = {{ tuple([groupName]) }}),
{%- endfor %}
),
{%- endif %}
)
{{ "\n" }}
@@ -0,0 +1,115 @@
# STEP: DEFINE ELEMENTS
element = AFFE_CARA_ELEM(
MODELE = model,
POUTRE = (
{%- for _, profile in profiles.items() %}
{%- if profile.properties %}
_F(
GROUP_MA = {{ profile.groupNames }},
SECTION = 'GENERALE',
CARA = ('A', 'IY', 'IZ', 'JX'),
VALE = ({{ profile.properties.CrossSectionArea }}, {{ profile.properties.MomentOfInertiaY }}, {{ profile.properties.MomentOfInertiaZ }}, {{ profile.properties.TorsionalConstantX }})
),
{%- elif profile.type == "IfcRectangleProfileDef" and profile.ProfileType == "AREA" %}
_F(
GROUP_MA = {{ profile.groupNames }},
SECTION = 'RECTANGLE',
CARA = ('HY', 'HZ'),
VALE = ({{ profile.XDim }}, {{ profile.YDim }})
),
{%- elif profile.type == "IfcRectangleHollowProfileDef" and profile.ProfileType == "AREA" %}
_F(
GROUP_MA = {{ profile.groupNames }},
SECTION = 'RECTANGLE',
CARA = ('HY', 'HZ', 'EPY', 'EPZ'),
VALE = ({{ profile.XDim }}, {{ profile.YDim }}, {{ profile.WallThickness }}, {{ profile.WallThickness }})
),
{%- else %}
_F(
GROUP_MA = {{ profile.groupNames }},
SECTION = 'GENERALE',
CARA = ('A', 'IY', 'IZ', 'JX'),
VALE = ({{ profile.properties.CrossSectionArea }}, {{ profile.properties.MomentOfInertiaY }}, {{ profile.properties.MomentOfInertiaZ }}, {{ profile.properties.TorsionalConstantX }})
),
{%- endif %}
{%- endfor %}
{%- if rigidLinkGroupNames %}
_F(
GROUP_MA = {{ rigidLinkGroupNames }},
SECTION = 'RECTANGLE',
CARA = ('HY', 'HZ'),
VALE = (1.0, 1.0)
),
{%- endif %}
),
COQUE = (
{%- for el in shellElements %}
_F(
GROUP_MA = {{ tuple([getGroupName(el.ref_id)]) }},
EPAIS = {{ el.Thickness }},
VECTEUR = {{ tuple(el.orientation[0]) }}
),
{%- endfor %}
),
DISCRET = (
{%- for conn in vertexConnections %}
_F(
GROUP_MA = {{ tuple([getGroupName(conn.ref_id) + "_0D"]) }},
CARA = 'K_TR_D_N',
VALE = {{ conn.stiffnesses }},
REPERE = 'LOCAL'
),
{%- if includeZeroLength1DSprings %}
{%- for rel in conn.related_elements %}
_F(
GROUP_MA = {{ tuple([rel.springGroupName]) }},
CARA = 'K_TR_D_L',
VALE = {{ rel.stiffnesses }},
REPERE = 'LOCAL'
),
{%- endfor %}
{%- endif %}
{%- endfor %}
{%- for conn in edgeConnections %}
_F(
GROUP_MA = {{ tuple([getGroupName(conn.ref_id) + "_0D"]) }},
CARA = 'K_TR_D_N',
VALE = {{ conn.stiffnesses }},
REPERE = 'LOCAL'
),
{%- endfor %}
),
ORIENTATION = (
{%- for el in beamElements %}
_F(
GROUP_MA = {{ tuple([getGroupName(el.ref_id)]) }},
CARA = 'VECT_Y',
VALE = {{ tuple(el.orientation[1]) }}
),
{%- endfor %}
{%- for conn in vertexConnections %}
_F(
GROUP_MA = {{ tuple([getGroupName(conn.ref_id) + "_0D"]) }},
CARA = 'VECT_X_Y',
VALE = {{ tuple(conn.orientation[0] + conn.orientation[1]) }}
),
{%- if includeZeroLength1DSprings %}
{%- for rel in conn.related_elements %}
_F(
GROUP_MA = {{ tuple([rel.springGroupName]) }},
CARA = 'VECT_X_Y',
VALE = {{ tuple(rel.orientation[0] + rel.orientation[1]) }},
),
{%- endfor %}
{%- endif %}
{%- endfor %}
{%- for conn in edgeConnections %}
_F(
GROUP_MA = {{ tuple([getGroupName(conn.ref_id) + "_0D"]) }},
CARA = 'VECT_X_Y',
VALE = {{ tuple(conn.orientation[0] + conn.orientation[1]) }}
),
{%- endfor %}
),
)
{{ "\n" }}
@@ -0,0 +1,44 @@
# STEP: DEFINE TIME
{{ analysis_time }} = DEFI_LIST_REEL(
DEBUT = {{ start }},
INTERVALLE = _F(
JUSQU_A = {{ end }},
NOMBRE = {{ steps }}
)
)
# STEP: DEFINE LOADS
{{ load }} = AFFE_CHAR_MECA_F(
MODELE = model,
FORCE_NODALE = (
{%- for el in vertexLoadElements %}
_F(
GROUP_NO = {{ tuple([getGroupName(el.ref_id)]) }},
{%- for key, load in el.loads[load_key].items() %}
{{ key }} = DEFI_FONCTION(NOM_PARA='INST', ABSCISSE={{ time }}, ORDONNEE={{ tuple(load) }}),
{%- endfor %}
),
{%- endfor %}
),
FORCE_POUTRE = (
{%- for el in edgeLoadElements %}
_F(
GROUP_MA = {{ tuple([getGroupName(el.ref_id)]) }},
{%- for key, load in el.loads[load_key].items() %}
{{ key }} = DEFI_FONCTION(NOM_PARA='INST', ABSCISSE={{ time }}, ORDONNEE={{ tuple(load) }}),
{%- endfor %}
),
{%- endfor %}
),
FORCE_COQUE = (
{%- for el in faceLoadElements %}
_F(
GROUP_MA = {{ tuple([getGroupName(el.ref_id)]) }},
{%- for key, load in el.loads[load_key].items() %}
{{ key }} = DEFI_FONCTION(NOM_PARA='INST', ABSCISSE={{ time }}, ORDONNEE={{ tuple(load) }}),
{%- endfor %}
),
{%- endfor %}
),
)
{{ "\n" }}
@@ -0,0 +1,28 @@
# STEP: DEFINE MATERIALS
{%- for i, (_, material) in enumerate(materials.items()) %}
{{ "mat" + "_%s" % i }} = DEFI_MATERIAU(
ELAS = _F(
E = {{ material.properties.YoungModulus }},
NU = {{ material.properties.PoissonRatio }},
RHO = {{ material.properties.MassDensity }}
)
)
{% endfor %}
material = AFFE_MATERIAU(
MAILLAGE = mesh,
AFFE = (
{%- for i, (_, material) in enumerate(materials.items()) %}
_F(
GROUP_MA = {{ material.groupNames }},
MATER = {{ "mat" + "_%s" % i }},
),
{%- endfor %}
{%- if rigidLinkGroupNames %}
_F(
GROUP_MA = {{ rigidLinkGroupNames }},
MATER = {{ "mat_0" }},
),
{%- endif %}
)
)
{{ "\n" }}
@@ -0,0 +1,47 @@
# STEP: DEFINE MODEL
model = AFFE_MODELE(
MAILLAGE = mesh,
AFFE = (
_F(
TOUT = 'OUI',
PHENOMENE = 'MECANIQUE',
MODELISATION = '3D'
),
{%- if faceGroupNames %}
_F(
GROUP_MA = {{ faceGroupNames }},
PHENOMENE = 'MECANIQUE',
MODELISATION = 'DKT'
),
{%- endif %}
{%- if edgeGroupNames %}
_F(
GROUP_MA = {{ edgeGroupNames }},
PHENOMENE = 'MECANIQUE',
MODELISATION = 'POU_D_E'
),
{%- endif %}
{%- if point0DGroupNames %}
_F(
GROUP_MA = {{ point0DGroupNamesPlus }},
PHENOMENE = 'MECANIQUE',
MODELISATION = 'DIS_TR'
),
{%- endif %}
{%- if point1DGroupNames %}
_F(
GROUP_MA = {{ point1DGroupNames }},
PHENOMENE = 'MECANIQUE',
MODELISATION = 'DIS_TR'
),
{%- endif %}
{%- if rigidLinkGroupNames %}
_F(
GROUP_MA = {{ rigidLinkGroupNames }},
PHENOMENE = 'MECANIQUE',
MODELISATION = 'POU_D_E'
),
{%- endif %}
)
)
{{ "\n" }}
+13
View File
@@ -0,0 +1,13 @@
P actions make_etude
P memory_limit {{ allocated_memory }}
P time_limit {{ time_limit }}
P version stable
F comm {{ model_name }}_{{ run_label }}.comm D 1
F libr {{ model_name }}.med D 20
F mess {{ model_name }}_{{ run_label }}.mess R 6
{%- if "LC" in cases %}
F rmed {{ model_name + "_LC" }}.rmed R 80
{%- endif %}
{%- if "COMB" in cases %}
F rmed {{ model_name + "_COMB" }}.rmed R 81
{%- endif %}
@@ -0,0 +1,11 @@
# STEP: RESULT EXTRACTION
IMPR_RESU(
FORMAT="MED",
UNITE={{unit_number}},
RESU=_F(
RESULTAT={{res_Bld}},
NOM_CHAM=("DEPL", "EFGE_NOEU"),
NOM_CHAM_MED=("MODEL_DISP", "ELEMENT_FORCE"),
),
)
{{"\n"}}
@@ -0,0 +1,4 @@
# STEP: CONCLUDE STUDY
# code_aster.close()
FIN()
{{"\n"}}
@@ -0,0 +1,3 @@
# STEP: READ MED FILE
mesh = LIRE_MAILLAGE(FORMAT="MED", UNITE=20)
{{"\n"}}
@@ -0,0 +1,27 @@
# STEP: RUN ANALYSIS
{{ res_Bld }} = MECA_STATIQUE(
MODELE = model,
CHAM_MATER = material,
CARA_ELEM = element,
LIST_INST = {{ analysis_time }},
EXCIT = (
_F(
CHARGE = connection
),
_F(
CHARGE = {{ load }}
)
),
SOLVEUR=_F(
NPREC=12,
RESI_RELA=1e-1,
STOP_SINGULIER='NON',
)
)
{{ res_Bld }} = CALC_CHAMP(
reuse = {{ res_Bld }},
RESULTAT = {{ res_Bld }},
CONTRAINTE=('EFGE_NOEU', ),
)
{{ "\n" }}
@@ -0,0 +1,24 @@
# Ifc2CA - IFC Code_Aster utility
# Copyright (C) 2020, 2021, 2023, 2024 Ioannis P. Christovasilis <ipc@aethereng.com>
#
# This file is part of Ifc2CA.
#
# Ifc2CA is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ifc2CA is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Ifc2CA. If not, see <http://www.gnu.org/licenses/>.
# STEP: INITIALIZE STUDY
# import code_aster
# code_aster.init()
DEBUT()
{{"\n"}}