    

 ## On this page

  

 

 # MetaStructure Class Reference

 Last update: 16.07.2025 

Defines a meta structure which contains all data that is used to create a finite element mesh. [More...](class_meta_structure.xhtml#details)

## <a name="pub-methods"></a>Public Member Functions

 [add](class_meta_structure.xhtml#a0fa9b1c99a5343ff8e4e4aa55b28527f) (Part part) Adds the given part to the structure. [More...](#a0fa9b1c99a5343ff8e4e4aa55b28527f)  
  [add](class_meta_structure.xhtml#a51be436c1ab0df9ab71185ddd07b40ca) (Section section) adds the given section [More...](#a51be436c1ab0df9ab71185ddd07b40ca)  
  [add](class_meta_structure.xhtml#ad19050a6c894c0f473fabb141e3140a9) (Material material) adds the given material law definition [More...](#ad19050a6c894c0f473fabb141e3140a9)  
  [add](class_meta_structure.xhtml#aa4e8f3470748cc3520481ec238844baa) (ElementSet elementset) adds the given element set [More...](#aa4e8f3470748cc3520481ec238844baa)  
  [add](class_meta_structure.xhtml#ae7742808b547e171aa3d04ff3aed95b5) (NodeSet nodeset) adds the given node set [More...](#ae7742808b547e171aa3d04ff3aed95b5)  
  [add](class_meta_structure.xhtml#abe288e8eeb377303a503f87d5edca686) (Data meta) adds all node/element data from the given meta structure to this one. [More...](#abe288e8eeb377303a503f87d5edca686)  
  [add](class_meta_structure.xhtml#a6ea94be0aad697ad6148cc817a381ebd) ([MetaStructure](class_meta_structure.xhtml) meta) adds all contents of the given [MetaStructure](class_meta_structure.xhtml "Defines a meta structure which contains all data that is used to create a finite element mesh...") [More...](#a6ea94be0aad697ad6148cc817a381ebd)  
  [addAndMerge](class_meta_structure.xhtml#aa1f17b21db9e172ffe3e185980e5f1d1) (Mesh meta) Adds the mesh information from the given meta structure to this one such that both will be merged. [More...](#aa1f17b21db9e172ffe3e185980e5f1d1)  
  [addElementData](class_meta_structure.xhtml#a14e566d1311ac5a0b7a07a7f8ca683b2) (string ident, ElementData [data](class_meta_structure.xhtml#a6029fd927112ed832c9d5a73debfc78d)) adds the given element data [More...](#a14e566d1311ac5a0b7a07a7f8ca683b2)  
  [addPointData](class_meta_structure.xhtml#a25329a79194551b18aea7e5c08c5e17d) (string ident, PointData [data](class_meta_structure.xhtml#a6029fd927112ed832c9d5a73debfc78d)) adds the given node data [More...](#a25329a79194551b18aea7e5c08c5e17d)  
  [addScalarData](class_meta_structure.xhtml#abcf3380c52c3c4952f99ec692b3940a6) (string ident, ScalarData [data](class_meta_structure.xhtml#a6029fd927112ed832c9d5a73debfc78d)) adds the given scalar data [More...](#abcf3380c52c3c4952f99ec692b3940a6)  
 Data [data](class_meta_structure.xhtml#a6029fd927112ed832c9d5a73debfc78d) () bool [emptyData](class_meta_structure.xhtml#afb44f41c68a96be59ad5dc0fd2d01185) () bool [emptyMesh](class_meta_structure.xhtml#a052f40c68d733e32f5c2270ec731be52) () std::list&lt; string &gt; [isCompatible](class_meta_structure.xhtml#a09c0c49149538f5d9c9011ed65539d0d) ([MetaStructure](class_meta_structure.xhtml) other) Returns an empty list if both meshes are compatble. [More...](#a09c0c49149538f5d9c9011ed65539d0d)  
 <a id="a26415e74c21cb9f6e7d74ea050923df9"></a>bool [isFEM](class_meta_structure.xhtml#a26415e74c21cb9f6e7d74ea050923df9) () returns true if the mesh is of type MESH\_FEM3D   
 <a id="a8a1adc554753b2fcf60593928435391a"></a>bool [isGrid1D](class_meta_structure.xhtml#a8a1adc554753b2fcf60593928435391a) () returns true if the grid is of type MESH\_RAY   
 <a id="aedbcda3d82c3cada168bccb01a39e6fe"></a>bool [isGrid2D](class_meta_structure.xhtml#aedbcda3d82c3cada168bccb01a39e6fe) () returns true if the grid is of type MESH\_PIXEL   
 <a id="aa2b6d69b13be5f9624657f4a76e3b594"></a>bool [isGrid3D](class_meta_structure.xhtml#aa2b6d69b13be5f9624657f4a76e3b594) () returns true if the grid is of type MESH\_VOXEL   
 <a id="aaa3458f2fd1aa62bab93edc5cbe08366"></a>bool [isMap2D](class_meta_structure.xhtml#aaa3458f2fd1aa62bab93edc5cbe08366) () returns true if the grid is of type MESH\_PIXEL and the parameter idents are set   
 <a id="aed9edc13868afa231a0d2289134afc75"></a>bool [isMap3D](class_meta_structure.xhtml#aed9edc13868afa231a0d2289134afc75) () returns true if the grid is of type MESH\_VOXEL and the parameter idents are set   
 bool [isSubsetOf](class_meta_structure.xhtml#a6e26b6a66ca01a61d79ec04b5b823586) ([MetaStructure](class_meta_structure.xhtml) other) Mesh [mesh](class_meta_structure.xhtml#ae0215a61006d85b5f48f844ea5e3d525) () Mesh [meshRef](class_meta_structure.xhtml#a0fa467c4d87ada12f40346a0f0ee11b4) () <a id="a3daf199e029de1f9e3b8c76349aff98c"></a> [MetaStructure](class_meta_structure.xhtml#a3daf199e029de1f9e3b8c76349aff98c) () creates an empty meta structure   
  [MetaStructure](class_meta_structure.xhtml#aee89dc8849b92f23212e3ba34b72c87c) ([MetaStructure](class_meta_structure.xhtml) other, bool copy\_mesh=true, bool copy\_data=true) copy constructor [More...](#aee89dc8849b92f23212e3ba34b72c87c)  
 [MetaStructure](class_meta_structure.xhtml) [operator=](class_meta_structure.xhtml#abd0a4f066c62067fc1fee92d9ca03f06) ([MetaStructure](class_meta_structure.xhtml) 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 [More...](#abd0a4f066c62067fc1fee92d9ca03f06)  
 bool [operator==](class_meta_structure.xhtml#addbbfeba3b0fc1f2e654709a60c400b8) ([MetaStructure](class_meta_structure.xhtml) other) returns true if both objects have the same contents primarily used to test the serialization [More...](#addbbfeba3b0fc1f2e654709a60c400b8)  
  [setGridIdents](class_meta_structure.xhtml#a0025b025dbbaab629429bf1964c07192) (string x="", string y="", string z="") sets the idents of a map abscissa This function must be called AFTER setTYpeVoxel or setTypePixel [More...](#a0025b025dbbaab629429bf1964c07192)  
 <a id="ace5acac76bc306c0c11cd7782c2f532c"></a> [setMeshTypeFEM](class_meta_structure.xhtml#ace5acac76bc306c0c11cd7782c2f532c) () sets the mesh type to MESH\_FEM3D   
  [setMeshTypePixel](class_meta_structure.xhtml#a747b502eaa9fb41b0449a6e53c3f9384) (number nx, number ny) sets the mesh type to MESH\_PIXEL [More...](#a747b502eaa9fb41b0449a6e53c3f9384)  
  [setMeshTypeRay](class_meta_structure.xhtml#accb91ec1873165e99a5be652c305b234) (number nx) sets the mesh type to MESH\_RAY [More...](#accb91ec1873165e99a5be652c305b234)  
  [setMeshTypeVoxel](class_meta_structure.xhtml#a91fdad2fce28831e4de1e28117c7762a) (number nx, number ny, number nz) sets the mesh type to MESH\_VOXEL [More...](#a91fdad2fce28831e4de1e28117c7762a)  
 <a id="details" name="details"></a>## 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 &amp; Destructor Documentation

<a id="aee89dc8849b92f23212e3ba34b72c87c"></a>## [◆ ](#aee89dc8849b92f23212e3ba34b72c87c)MetaStructure()

 [MetaStructure](class_meta_structure.xhtml)  ( [MetaStructure](class_meta_structure.xhtml)  *other*,    bool  *copy\_mesh* = `true`,    bool  *copy\_data* = `true`   ) 

copy constructor

Parameters otherthe meta structure to be copied from copy\_meshif this is false, no mesh information are copied copy\_dataif this is false, no data objects are copied 



## Member Function Documentation

<a id="a0fa9b1c99a5343ff8e4e4aa55b28527f"></a>## [◆ ](#a0fa9b1c99a5343ff8e4e4aa55b28527f)add() \[1/7\]

 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 partthe full initialized part to be added Exceptions Anexception is thrown if the part to be added overlaps the already contained parts (has same node/element indices). 



<a id="a51be436c1ab0df9ab71185ddd07b40ca"></a>## [◆ ](#a51be436c1ab0df9ab71185ddd07b40ca)add() \[2/7\]

 add  ( Section  *section*) 

adds the given section

Parameters sectionthe section to be added 



<a id="ad19050a6c894c0f473fabb141e3140a9"></a>## [◆ ](#ad19050a6c894c0f473fabb141e3140a9)add() \[3/7\]

 add  ( Material  *material*) 

adds the given material law definition

Parameters materialthe material to be added 



<a id="aa4e8f3470748cc3520481ec238844baa"></a>## [◆ ](#aa4e8f3470748cc3520481ec238844baa)add() \[4/7\]

 add  ( ElementSet  *elementset*) 

adds the given element set

Parameters elementsetthe element set to be added 



<a id="ae7742808b547e171aa3d04ff3aed95b5"></a>## [◆ ](#ae7742808b547e171aa3d04ff3aed95b5)add() \[5/7\]

 add  ( NodeSet  *nodeset*) 

adds the given node set

Parameters nodesetthe node set to be added 



<a id="abe288e8eeb377303a503f87d5edca686"></a>## [◆ ](#abe288e8eeb377303a503f87d5edca686)add() \[6/7\]

 add  ( Data  *meta*) 

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

Parameters metathe data structure containing the source data No error checking on compatibility with the mesh! 



<a id="a6ea94be0aad697ad6148cc817a381ebd"></a>## [◆ ](#a6ea94be0aad697ad6148cc817a381ebd)add() \[7/7\]

 add  ( [MetaStructure](class_meta_structure.xhtml)  *meta*) 

adds all contents of the given [MetaStructure](class_meta_structure.xhtml "Defines a meta structure which contains all data that is used to create a finite element mesh...")

Parameters metathe data structure containing the source data 



<a id="aa1f17b21db9e172ffe3e185980e5f1d1"></a>## [◆ ](#aa1f17b21db9e172ffe3e185980e5f1d1)addAndMerge()

 addAndMerge  ( Mesh  *meta*) 

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

Parameters metathe data structure containing the source data Exceptions anexception is thrown if any duplicate nodes/elements exist. No error checking on compatibility, etc. 



<a id="a14e566d1311ac5a0b7a07a7f8ca683b2"></a>## [◆ ](#a14e566d1311ac5a0b7a07a7f8ca683b2)addElementData()

 addElementData  ( string  *ident*,    ElementData  *data*   ) 

adds the given element data

Parameters identthe ident of the node data datathe data container to be added 



<a id="a25329a79194551b18aea7e5c08c5e17d"></a>## [◆ ](#a25329a79194551b18aea7e5c08c5e17d)addPointData()

 addPointData  ( string  *ident*,    PointData  *data*   ) 

adds the given node data

Parameters identthe ident of the node data datathe data container to be added 



<a id="abcf3380c52c3c4952f99ec692b3940a6"></a>## [◆ ](#abcf3380c52c3c4952f99ec692b3940a6)addScalarData()

 addScalarData  ( string  *ident*,    ScalarData  *data*   ) 

adds the given scalar data

Parameters identthe ident of the scalar data datathe data container to be added 



<a id="a6029fd927112ed832c9d5a73debfc78d"></a>## [◆ ](#a6029fd927112ed832c9d5a73debfc78d)data()

 Data data  ( ) 

Returnsm\_data 



<a id="afb44f41c68a96be59ad5dc0fd2d01185"></a>## [◆ ](#afb44f41c68a96be59ad5dc0fd2d01185)emptyData()

 bool emptyData  ( ) 

Returnstrue if there are no data items in this object 



<a id="a052f40c68d733e32f5c2270ec731be52"></a>## [◆ ](#a052f40c68d733e32f5c2270ec731be52)emptyMesh()

 bool emptyMesh  ( ) 

Returnstrue if there is no structural data in this object 



<a id="a09c0c49149538f5d9c9011ed65539d0d"></a>## [◆ ](#a09c0c49149538f5d9c9011ed65539d0d)isCompatible()

 std::list&lt; string &gt; isCompatible  ( [MetaStructure](class_meta_structure.xhtml)  *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 otherThe other mesh ReturnsA 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.





<a id="a6e26b6a66ca01a61d79ec04b5b823586"></a>## [◆ ](#a6e26b6a66ca01a61d79ec04b5b823586)isSubsetOf()

 bool isSubsetOf  ( [MetaStructure](class_meta_structure.xhtml)  *other*) 

ReturnsReturns true if this mesh is a subset of the otherThat 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 otherthe other mesh 



<a id="ae0215a61006d85b5f48f844ea5e3d525"></a>## [◆ ](#ae0215a61006d85b5f48f844ea5e3d525)mesh()

 Mesh mesh  ( ) 

Returnsm\_mesh 



<a id="a0fa467c4d87ada12f40346a0f0ee11b4"></a>## [◆ ](#a0fa467c4d87ada12f40346a0f0ee11b4)meshRef()

 Mesh meshRef  ( ) 

Returnsm\_mesh 



<a id="abd0a4f066c62067fc1fee92d9ca03f06"></a>## [◆ ](#abd0a4f066c62067fc1fee92d9ca03f06)operator=()

 [MetaStructure](class_meta_structure.xhtml) operator=  ( [MetaStructure](class_meta_structure.xhtml)  *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 otherthe source object Returnsa reference to \*this 



<a id="addbbfeba3b0fc1f2e654709a60c400b8"></a>## [◆ ](#addbbfeba3b0fc1f2e654709a60c400b8)operator==()

 bool operator==  ( [MetaStructure](class_meta_structure.xhtml)  *other*) 

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

Parameters otherthe object to be compared Returnstrue if both are equal 



<a id="a0025b025dbbaab629429bf1964c07192"></a>## [◆ ](#a0025b025dbbaab629429bf1964c07192)setGridIdents()

 setGridIdents  ( string  *x* = `""`,    string  *y* = `""`,    string  *z* = `""`   ) 

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

Parameters xthe x parameter ident ythe y parameter ident zthe z parameter ident 



<a id="a747b502eaa9fb41b0449a6e53c3f9384"></a>## [◆ ](#a747b502eaa9fb41b0449a6e53c3f9384)setMeshTypePixel()

 setMeshTypePixel  ( number  *nx*,    number  *ny*   ) 

sets the mesh type to MESH\_PIXEL

Parameters nxthe number of grid points along the x axis nythe number of grid points along the y axis 



<a id="accb91ec1873165e99a5be652c305b234"></a>## [◆ ](#accb91ec1873165e99a5be652c305b234)setMeshTypeRay()

 setMeshTypeRay  ( number  *nx*) 

sets the mesh type to MESH\_RAY

Parameters nxthe number of grid points along the x axis 



<a id="a91fdad2fce28831e4de1e28117c7762a"></a>## [◆ ](#a91fdad2fce28831e4de1e28117c7762a)setMeshTypeVoxel()

 setMeshTypeVoxel  ( number  *nx*,    number  *ny*,    number  *nz*   ) 

sets the mesh type to MESH\_VOXEL

Parameters nxthe number of grid points along the x axis nythe number of grid points along the y axis nzthe number of grid points along the z axis