3.8 MeshData Section¶
The MeshData section is where data is specified that can be mapped to the mesh. The data can then be applied to a parameter of the model, e.g. a material parameter, or a pressure load.
To define a mesh data section add one of the following tags.
NodeData Define data on a node set
SurfaceData Define data on a surface
ElementData Define data on an element set
The following attributes can be added.
name All mesh data sections require a name, which can be specified with the name attribute. This name will be used by model parameters to reference the particular mesh data.
Data maps can be defined in two ways: 1) explicitly, where the value of each node (face, element) can be specified, or 2) implicitly, via data generators that define the values of each node (face, element) procedurally.
When mesh data maps are defined explicitly, the following attributes should be specified in addition to the name attribute.
data_type defines the type of data
The following table lists the supported data types.
| data type | Description |
|---|---|
| scalar | A single floating point value |
| vec2 | A 2D vector defined as \(x\), \(y\) |
| vec3 | A 3D vector defined as \(x\), \(y\), \(z\) |
| mat3 | A 3x3 tensor, row-major sorted |
| mat3s | A symmetric 3x3 tensor, defined as \(xx\), \(yy\), \(zz,xy,yz,xz\) |
If the data type is not defined, the scalar data type is assumed.
Data Generators¶
Data generators can be used to populate the values of a data map procedurally. To use a data generator, specify the type attribute. If the type attribute is defined, the child tags must be the parameters of the generator. For example,
<MeshData>
<NodeData name="E_map" type="math">
<math>X*X + Y*Y + Z*Z</math>
<NodeData>
</MeshData>
Data generators that can be used for a specific mesh data are described in the sections below.
ElementData¶
This section defines data that can be mapped to the elements of an element set. The element set is specified via the _elem_set _attribute.
Defining maps A map is defined by using the name attribute to give the map a name. This name can then be used in mapped parameters (see Appendix A).
<MeshData>
<ElementData name="my_map" elem_set="part1">
<elem lid="1">1.23</elem>
<elem lid="2">1.25</elem>
</ElementData>
</MeshData>
The following data generators are available for element data sections.
surface-to-surface_map The “surface-to-surface map” generator defines a data field on the domain bounded by two surfaces. The data values are interpolated using a user-defined function between the surfaces.
<MeshData>
<ElementData name="Emap" generator="surface-to-surface map" elem_set="Part1">
<function type="math">x*x+1</function>
<bottom_surface surface="surface1"/>
<top_surface surface="surface2"/>
<ElementData>
</MeshData>
special generators A few special data generators do not generate maps, but instead modify model data in a more direct way. The following table lists the currently supported special generators.
| Property | Description | Data type/format |
|---|---|---|
| fiber | Specify a local fiber direction | vec3/const |
| mat_axis | Specify local element material axes | vec3/const |
| shell thickness | Specify the shell element thickness | float/shape |
For example, to assign shell thicknesses to an element set, use the following syntax.
<MeshData>
<ElementData type="shell thickness" elem_set="part1">
<elem lid="1">1.0, 1.0, 1.0, 1.0</elem>
<elem lid="2">1.0, 1.0, 1.0, 1.0</elem>
</ElementData>
</MeshData>
SurfaceData¶
This section allows users to define data that can be mapped to the surfaces of certain boundary conditions and loads. This section only defines user-defined data maps, i.e. the name, data_type and data_format attributes must be used. The surface is defined via the surface attribute.
<SurfaceData name="values" surface="surface1">
<face lid="1">1.23</face>
<face lid="2">3.45</face>
</SurfaceData>
The surface definition is defined in the Mesh section. Note that the ids refer to the local ids of the surface facets. By default, the scalar data type and const data format are assumed so only one value per facet is expected. Other data types and formats can be specified with the data_type and data_format attributes.
<SurfaceData name="data" data_type="vec3" surface="surface1">
<face lid="1">0.0, 1.0, 0.0</face>
<face lid="2">0.0, 2.0, 0.0</face>
</SurfaceData>
Optionally, the surface data may be described with a data generator. The data generator is specified via the type attribute. The following data generators are available for surface data.
parabolic_map The “parabolic map” defines a scalar data field with a parabolic profile on a surface. The data is determined by solving a heat-type problem with a constant source and homogeneous boundary conditions on the edge of the surface.
<MeshData>
<SurfaceData name="pressure" type="parabolic map" surface="surface1">
<value>1.0</value>
<SurfaceData>
</MeshData>
EdgeData¶
This section allows users to define user-defined data maps that will be mapped to an edge defined in the Mesh section.
<EdgeData name="data" edge="edge1">
<edge lid="1">1.0</edge>
<edge lid="2">2.0</edge>
</EdgeData>
Notice that the local IDs are required here.
NodeData¶
This section allows users to define data that will be mapped to node sets.
<NodeData name="data" node_set="set1">
<node lid="1">1.0</node>
<node lid="2">2.0</node>
</NodeData>
For node data the _data_format _attribute, if specified, will be ignored.