> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MetaStructure Class Reference

Part of [Data](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__data)

Defines a meta structure which contains all data that is used to create a finite element mesh.

## Public Member Functions

| Type | Name |
| - | - |
| | [add](#a0fa9b1c99a5343ff8e4e4aa55b28527f) (Part part) Adds the given part to the structure. |
| | [add](#a51be436c1ab0df9ab71185ddd07b40ca) (Section section) adds the given section |
| | [add](#ad19050a6c894c0f473fabb141e3140a9) (Material material) adds the given material law definition |
| | [add](#aa4e8f3470748cc3520481ec238844baa) (ElementSet elementset) adds the given element set |
| | [add](#ae7742808b547e171aa3d04ff3aed95b5) (NodeSet nodeset) adds the given node set |
| | [add](#abe288e8eeb377303a503f87d5edca686) (Data meta) adds all node/element data from the given meta structure to this one. |
| | [add](#a6ea94be0aad697ad6148cc817a381ebd) ([MetaStructure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_meta_structure.md) meta) adds all contents of the given [MetaStructure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_meta_structure.md) |
| | [addAndMerge](#aa1f17b21db9e172ffe3e185980e5f1d1) (Mesh meta) Adds the mesh information from the given meta structure to this one such that both will be merged. |
| | [addElementData](#a14e566d1311ac5a0b7a07a7f8ca683b2) (string ident, ElementData [data](#a6029fd927112ed832c9d5a73debfc78d)) adds the given element data |
| | [addPointData](#a25329a79194551b18aea7e5c08c5e17d) (string ident, PointData [data](#a6029fd927112ed832c9d5a73debfc78d)) adds the given node data |
| | [addScalarData](#abcf3380c52c3c4952f99ec692b3940a6) (string ident, ScalarData [data](#a6029fd927112ed832c9d5a73debfc78d)) adds the given scalar data |
| Data | [data](#a6029fd927112ed832c9d5a73debfc78d) () |
| bool | [emptyData](#afb44f41c68a96be59ad5dc0fd2d01185) () |
| bool | [emptyMesh](#a052f40c68d733e32f5c2270ec731be52) () |
| std::list\< string > | [isCompatible](#a09c0c49149538f5d9c9011ed65539d0d) ([MetaStructure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_meta_structure.md) other) Returns an empty list if both meshes are compatble. |
|  bool | [isFEM](#a26415e74c21cb9f6e7d74ea050923df9) () returns true if the mesh is of type MESH\_FEM3D |
|  bool | [isGrid1D](#a8a1adc554753b2fcf60593928435391a) () returns true if the grid is of type MESH\_RAY |
|  bool | [isGrid2D](#aedbcda3d82c3cada168bccb01a39e6fe) () returns true if the grid is of type MESH\_PIXEL |
|  bool | [isGrid3D](#aa2b6d69b13be5f9624657f4a76e3b594) () returns true if the grid is of type MESH\_VOXEL |
|  bool | [isMap2D](#aaa3458f2fd1aa62bab93edc5cbe08366) () returns true if the grid is of type MESH\_PIXEL and the parameter idents are set |
|  bool | [isMap3D](#aed9edc13868afa231a0d2289134afc75) () returns true if the grid is of type MESH\_VOXEL and the parameter idents are set |
| bool | [isSubsetOf](#a6e26b6a66ca01a61d79ec04b5b823586) ([MetaStructure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_meta_structure.md) other) |
| Mesh | [mesh](#ae0215a61006d85b5f48f844ea5e3d525) () |
| Mesh | [meshRef](#a0fa467c4d87ada12f40346a0f0ee11b4) () |
| | [MetaStructure](#a3daf199e029de1f9e3b8c76349aff98c) () creates an empty meta structure |
| | [MetaStructure](#aee89dc8849b92f23212e3ba34b72c87c) ([MetaStructure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_meta_structure.md) other, bool copy\_mesh=true, bool copy\_data=true) copy constructor |
| [MetaStructure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_meta_structure.md) | [operator=](#abd0a4f066c62067fc1fee92d9ca03f06) ([MetaStructure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_meta_structure.md) other) overrides the assignment operator This object will contain the same data as other (copying data). The operator checks if other and this object are actually the same object - if so, it does nothing |
| bool | [operator==](#addbbfeba3b0fc1f2e654709a60c400b8) ([MetaStructure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_meta_structure.md) other) returns true if both objects have the same contents primarily used to test the serialization |
| | [setGridIdents](#a0025b025dbbaab629429bf1964c07192) (string x="", string y="", string z="") sets the idents of a map abscissa This function must be called AFTER setTYpeVoxel or setTypePixel |
| | [setMeshTypeFEM](#ace5acac76bc306c0c11cd7782c2f532c) () sets the mesh type to MESH\_FEM3D |
| | [setMeshTypePixel](#a747b502eaa9fb41b0449a6e53c3f9384) (number nx, number ny) sets the mesh type to MESH\_PIXEL |
| | [setMeshTypeRay](#accb91ec1873165e99a5be652c305b234) (number nx) sets the mesh type to MESH\_RAY |
| | [setMeshTypeVoxel](#a91fdad2fce28831e4de1e28117c7762a) (number nx, number ny, number nz) sets the mesh type to MESH\_VOXEL |

## Detailed Description

Defines a meta structure which contains all data that is used to create a finite element mesh.

The following ideas lead to the concept:

* abstract general format (does not change with each new SoS version)
* only definition data without logic checks; If the mesh is "valid" will be tested outside of this meta structure
* compact memory footprint: Try to use as little space as possible since the structure may be in memory during the whole application lifetime

When using serialization, one should only store meta structures which contain meshes, but no data objects. Reason: Since data objects are inetrnally stored by n-tuples of numbers, the time to load/save is very long. Use block formats to improve serialization speed.

## Constructor & Destructor Documentation

### MetaStructure()

```cpp theme={null}
MetaStructure(
    MetaStructure other,
    bool copy_mesh = true,
    bool copy_data = true
)
```

copy constructor

**Parameters**

| Name | Description |
| - | - |
| other | the meta structure to be copied from |
| copy\_mesh | if this is false, no mesh information are copied |
| copy\_data | if this is false, no data objects are copied |

## Member Function Documentation

### add() \[1/7]

```cpp theme={null}
add(Part part)
```

Adds the given part to the structure.

It changes the index of the part according to the current number of contained parts. The index starts at 0. If the part already exists in the data base (i.e. it has the same string ident), then the method tries to add the part contents to the existing part.

**Parameters**

| Name | Description |
| - | - |
| part | the full initialized part to be added |

**Exceptions**

| Name | Description |
| - | - |
| An | exception is thrown if the part to be added overlaps the already contained parts (has same node/element indices). |

### add() \[2/7]

```cpp theme={null}
add(Section section)
```

adds the given section

**Parameters**

| Name | Description |
| - | - |
| section | the section to be added |

### add() \[3/7]

```cpp theme={null}
add(Material material)
```

adds the given material law definition

**Parameters**

| Name | Description |
| - | - |
| material | the material to be added |

### add() \[4/7]

```cpp theme={null}
add(ElementSet elementset)
```

adds the given element set

**Parameters**

| Name | Description |
| - | - |
| elementset | the element set to be added |

### add() \[5/7]

```cpp theme={null}
add(NodeSet nodeset)
```

adds the given node set

**Parameters**

| Name | Description |
| - | - |
| nodeset | the node set to be added |

### add() \[6/7]

```cpp theme={null}
add(Data meta)
```

adds all node/element data from the given meta structure to this one.

**Parameters**

| Name | Description |
| - | - |
| meta | the data structure containing the source data No error checking on compatibility with the mesh! |

### add() \[7/7]

```cpp theme={null}
add(MetaStructure meta)
```

adds all contents of the given [MetaStructure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_meta_structure.md)

**Parameters**

| Name | Description |
| - | - |
| meta | the data structure containing the source data |

### addAndMerge()

```cpp theme={null}
addAndMerge(Mesh meta)
```

Adds the mesh information from the given meta structure to this one such that both will be merged.

**Parameters**

| Name | Description |
| - | - |
| meta | the data structure containing the source data |

**Exceptions**

| Name | Description |
| - | - |
| an | exception is thrown if any duplicate nodes/elements exist. No error checking on compatibility, etc. |

### addElementData()

```cpp theme={null}
addElementData(
    string ident,
    ElementData data
)
```

adds the given element data

**Parameters**

| Name | Description |
| - | - |
| ident | the ident of the node data |
| data | the data container to be added |

### addPointData()

```cpp theme={null}
addPointData(
    string ident,
    PointData data
)
```

adds the given node data

**Parameters**

| Name | Description |
| - | - |
| ident | the ident of the node data |
| data | the data container to be added |

### addScalarData()

```cpp theme={null}
addScalarData(
    string ident,
    ScalarData data
)
```

adds the given scalar data

**Parameters**

| Name | Description |
| - | - |
| ident | the ident of the scalar data |
| data | the data container to be added |

### data()

```cpp theme={null}
Data data()
```

**Returns**

m\_data

### emptyData()

```cpp theme={null}
bool emptyData()
```

**Returns**

true if there are no data items in this object

### emptyMesh()

```cpp theme={null}
bool emptyMesh()
```

**Returns**

true if there is no structural data in this object

### isCompatible()

```cpp theme={null}
std::list< string > isCompatible(MetaStructure other)
```

Returns an empty list if both meshes are compatble.

Compatibility means that mesh data of the one mesh can be applied directly to the other mesh.

**Parameters**

| Name | Description |
| - | - |
| other | The other mesh |

**Returns**

A string list listing differences. This list is empty if:

* both meshes are empty.
* both meshes are identical
* both meshes differ only in the point coordinates or set definitions Its size is otherwise not zero.

### isSubsetOf()

```cpp theme={null}
bool isSubsetOf(MetaStructure other)
```

**Returns**

Returns true if this mesh is a subset of the other

That means, that some nodes or elements might have been deleted. Still the method will return true. Only parts, nodes, elements and sections are tested on subset. The other mesh components are tested on equality!

**Parameters**

| Name | Description |
| - | - |
| other | the other mesh |

### mesh()

```cpp theme={null}
Mesh mesh()
```

**Returns**

m\_mesh

### meshRef()

```cpp theme={null}
Mesh meshRef()
```

**Returns**

m\_mesh

### operator=()

```cpp theme={null}
MetaStructure operator=(MetaStructure other)
```

overrides the assignment operator This object will contain the same data as other (copying data). The operator checks if other and this object are actually the same object - if so, it does nothing

**Parameters**

| Name | Description |
| - | - |
| other | the source object |

**Returns**

a reference to \*this

### operator==()

```cpp theme={null}
bool operator==(MetaStructure other)
```

returns true if both objects have the same contents primarily used to test the serialization

**Parameters**

| Name | Description |
| - | - |
| other | the object to be compared |

**Returns**

true if both are equal

### setGridIdents()

```cpp theme={null}
setGridIdents(
    string x = "",
    string y = "",
    string z = ""
)
```

sets the idents of a map abscissa This function must be called AFTER setTYpeVoxel or setTypePixel

**Parameters**

| Name | Description |
| - | - |
| x | the x parameter ident |
| y | the y parameter ident |
| z | the z parameter ident |

### setMeshTypePixel()

```cpp theme={null}
setMeshTypePixel(
    number nx,
    number ny
)
```

sets the mesh type to MESH\_PIXEL

**Parameters**

| Name | Description |
| - | - |
| nx | the number of grid points along the x axis |
| ny | the number of grid points along the y axis |

### setMeshTypeRay()

```cpp theme={null}
setMeshTypeRay(number nx)
```

sets the mesh type to MESH\_RAY

**Parameters**

| Name | Description |
| - | - |
| nx | the number of grid points along the x axis |

### setMeshTypeVoxel()

```cpp theme={null}
setMeshTypeVoxel(
    number nx,
    number ny,
    number nz
)
```

sets the mesh type to MESH\_VOXEL

**Parameters**

| Name | Description |
| - | - |
| nx | the number of grid points along the x axis |
| ny | the number of grid points along the y axis |
| nz | the number of grid points along the z axis |
