Preprocessing

4C reads the mesh, boundary conditions, materials and simulation parameters from a central input file.

Working with 4C input files

4C input files are text files in the YAML format. Since YAML is a superset of JSON, you may also use JSON syntax although we tend to prefer YAML for human-readability. By convention, 4C input files have the extension .4C.yaml or .4C.json.

We build a schema called 4C_schema.json which is located in the root build directory. This schema describes the structure of a valid 4C input file. If you want to write and edit 4C input files, we recommend to set up schema validation in your editor (see Installation for details). Doing so provides documentation and autocompletion for all parameters.

Creating meshes for 4C

4C can read meshes in two different ways:

  1. Either you create the mesh in 4C’s native format directly. Refer to the Tools section to find tools that can help you to create 4C input files.

  2. or you create a mesh file in a general binary format for finite element information, called EXODUS II, develeloped by Sandia National Laboratories. This can be read into 4C via its input file.

Generating EXODUS II files

Even though the generation of EXODUS II files might be out of scope of a 4C manual, users are informed on how to generate these files conveniently, so options are given in the following:

CUBIT

CUBIT http://cubit.sandia.gov/ is a powerful pre- postprocessing tool. (The commercial version of the software was called Trelis, but has been renamed into CUBIT now as well, so we may stick to the name CUBIT).

Cubit allows you to create the geometry, mesh, and necessary node sets and export them to the EXODUS file format.

Note that

  • it is not necessary to define boundary conditions in Cubit. This can be done directly in the 4C input file.

  • you should only define node sets, but not sidesets (surface sets). Side sets are not yet supported in 4C.

Other Software

Geometry as well as element and node sets can be created in any finite element preprocessor. However, the preprocessor should be capable of exporting a file format, which can be converted by the python toolset meshio (see <https://pypi.org/project/meshio/>) into an EXODUS file.

Warning

The EXODUS file that is exported by meshio can currently not read in by 4C directly!

Also, the exported input file can probably be imported in Cubit, then further edited and eventually exported as an EXODUS (.e) file.

So the steps are

  1. Create finite element model and sets in your favorite preprocessor

  2. Export to EXODUS II format if possible.

  3. If you can only export to some other format than EXODUS II: - Option 1 Read in the model to Cubit for further editing and write out an EXODUS II file. - Option 2 Currently you should write a python script to convert your format to the 4C input file format.

Other ways to create meshes for 4C

ABAQUS

Outdated content

The abaqus converter produces only the old proprietary input file format. If an update is desired, an issue should be opened.

There is an in-house Python module abaqus_meshio for the conversion from an ABAQUS input file (.inp) to dat file. This python module is available in the scripts gitlab. Since the .inp file can also be generated using Cubit, this submodule can be used in conjunction with Cubit as well, see above. The usage of this submodule starts firstly by importing it providing the path where it is located.

import sys

abaqus_meshio_path = "path_to_abaqus_meshio"
sys.path.append(abaqus_meshio_path)

Subsequently, the inp shall be read using the command

model = abaqus_meshio.read("path_to_inp.dat")

Unlike meshio.read, the command abaqus_meshio.read will return a model, which is instance of BModel, where:

  • model.rootAssembly.instances[instance_name].mesh is a BMesh. ``BMesh is a subclass of meshio.Mesh with additional attributes sections (for material assignment) and surfaces (for distributed load).

  • model has attributes materials (from MATERIAL), parts (from PART/END PART) and steps (from STEP)

  • model.parts[part_name].mesh is again a BMesh, model.rootAssembly.instances[instance_name].mesh is a transformation of this mesh.

BModel is designed to mimic the way Abaqus systematically stores its data. To access the original meshio.Mesh one has to use model.parts[part_name].mesh.

Proving that the information from inp is properly stored, the transformation to dat file is done by a simple command

fourc_io = abaqus_meshio.Inp2Baci(model, [params_step_1])
fourc_io.write("prefix")

If the inp has many steps defined by STEP/END STEP keywords, the list of parameters for each step has to be provided, e.g. [params_step_1, params_step_2, ...]. Default parameters for a structural analysis can be obtained using

params_step_1 = abaqus_meshio.GenerateDefaultParams()