Due to historical reasons, the preprocessor of SAMCEF (called BACON) can be used to generate a mesh and geometrical entities. The module toolbox.samcef
defines functions that convert a .fdb
file (fdb
stands for “formatted database”) to commands that Metafor understands. If a .dat
file (i.e. a BACON script file) is provided, Metafor automatically runs BACON first as a background process in order to create the missing .fdb
file. In this case, a SAMCEF license is required.
The example simulation consists of a sheared cube (lower and upper faces and fixed and moved one with respect to another). The figure below shows the geometry:
The BACON input file named cubeCG.dat
(located in apps/ale
) contains the commands used to create the geometry, the mesh and node groups (selections).
Geometry
The geometry is created with the following BACON commands (see BACON manual for details):
.3POI
for the 8 points..3DRO
for the 12 edges..CON
for the 6 wires..FACE
for the 6 sides..PLAN
to create a surface (required for the 2D domain, see below)..VPEAU
for the skin..DOM
for the domain (one 3D domain - the cube - and one 2D domain - the lower side which will be meshed and extruded).Mesh Generation
.GEN
.MODIFIE LIGNE
”.transfini
”) and extruded with the command “EXTRUSION
”.Choice of Element Type
.HYP VOLUME
is used (in 2D and 3D).Definition of node/element groups (selections)
.SEL
is used.REN
is used to change the numbering of nodes and mesh elements, it should be done before the .SEL
.
Manual Creation of the .fdb
file
BACON can be started manually with the command:
samcef ba aleCubeCg n 1
From the .dat
file, a .fdb
is created with BACON with the commands:
INPUT .SAUVE DB FORMAT .STO
Summary: What can be imported from BACON?
Line
- Arc
(points generated automatically with a negative numbed in Metafor are shifted (numPoint = numMaxPoints-numPoint
)Plan
- Ruled
- Coons
(Only planes defined using three numbers are imported (other planes generate cpoints outside db) ).MultiProjSkin
objects are created, it is best to create them in the Python data set.MeshedPoints
)nodeOnLine
, …)Reading the BACON file from Metafor
In Metafor, the file .dat
is converted thanks to a conversion module named toolbox.samcef
(see apps.ale.cubeCG
):
import toolbox.samcef bi = toolbox.samcef.BaconImporter(domain, os.path.splitext(__file__)[0]+'.dat' ) bi.execute()
where domain
is the domain that should be filled with the converted mesh and geometry. The second argument corresponds to the full path to the file cubeCG.dat
(it is computed from the full path of the python input file).
If all goes well, a file cubeCG.fdb
is then created in the folder workspace/apps_ale_cubeCG
Element Generation in Metafor
The BACON attributes are converted to Groups
in Metafor. For example, if attribute #99 has been used when generating mesh in BACON, all the elements are stored in groupset(99)
in Metafor.
app = FieldApplicator(1) app.push(groupset(99)) interactionset.add(app)
Boundary conditions in Metafor
Selections in BACON are translated into Groups
with the same number. Boundary conditions such as prescribed displacements or contact can be thus defined easily in Metafor. For example, a selection such as .SEL GROUPE 4 NOEUDS
can lead to the following command in the input file:
loadingset.define(groupset(4), Field1D(TX,RE))