# How to work with Groups (Meshes)

(Difference between revisions)
 Revision as of 12:15, 12 July 2015 (view source)Maceli (Talk | contribs) (Created page with "What is a Group? '''A Group is a subset of entities of the domain'''. In numerical simulation, they are useful to ''identify parts of the domain that have different data associa...") Revision as of 12:16, 12 July 2015 (view source)Maceli (Talk | contribs) Newer edit → Line 25: Line 25: Begin Mesh Begin Mesh − + Begin MeshData Begin MeshData IDENTIFIER Custom_Name IDENTIFIER Custom_Name Line 31: Line 31: EULER_ANGLES [3] (0.0,0.0,0.0) EULER_ANGLES [3] (0.0,0.0,0.0) End MeshData End MeshData − + Begin MeshNodes Begin MeshNodes 3 3 Line 37: Line 37: 7 7 End MeshNodes End MeshNodes − + Begin MeshElements Begin MeshElements 10 10 12 12 End MeshElements End MeshElements − + Begin MeshConditions Begin MeshConditions 6 6 7 7 End MeshConditions End MeshConditions − + End Mesh End Mesh

## Revision as of 12:16, 12 July 2015

What is a Group?

A Group is a subset of entities of the domain. In numerical simulation, they are useful to identify parts of the domain that have different data associated to them. For instance, the nodes belonging to a fluid inlet can belong to a group, the nodes where we want to plot some result can belong to a different group, the elements that belong to a rigid body can belong to a different group, etc... As a big difference with Partitions, the Groups can overlap, in such a way that a node can belong to different groups. This is the reason why Groups know what entities they contain, while the entities not necessarily know what Groups they belong to.

How to use Groups in Kratos? The Meshes

The keyword that Kratos uses for Group is Mesh. A Mesh is a subset of a Model Part which can contain simultaneously Nodes, Elements, Conditions and Shared Data.

The main features of the Mesh are the following:

• It contains pointers to the entities included (not copies of the entities)
• It has an interface accessible from C++ and Python for the most usual operations.
• The Nodes are loopable. The Elements and the Conditions are loopable too.
• It features a container (Mesh Data) which can store variables of any kind, as many as wanted

Important Note: All the entities of the Model Part are saved by default in Mesh 0, so when the Model Part loops over all its entities, it actually loops over the entities of Mesh 0. All the other meshes point to entities that are already included in Mesh 0. Care must be taken when adding an newly created entity to a Mesh. It must be added to Mesh 0 as well if we want the ModelPart to be aware of the inclusion of the new entity.

How to create a Mesh?

The easiest option is to write it in the input file (.mdpa file). The syntax is the following:

```Begin Mesh

Begin MeshData
IDENTIFIER Custom_Name
YOUNG_MODULUS 1.0e9
EULER_ANGLES [3] (0.0,0.0,0.0)
End MeshData

Begin MeshNodes
3
5
7
End MeshNodes

Begin MeshElements
10
12
End MeshElements

Begin MeshConditions
6
7
End MeshConditions

End Mesh
```