KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
Static Public Member Functions | List of all members
Kratos::TetrahedraSplit Class Reference

This class performs the splitting of a tetrahedra. It contains three helper functions to ease the splitting: TetrahedraSplitMode, Split_Tetrahedra, and TetrahedraGetNewConnectivityGID. More...

#include <split_tetrahedra.h>

Collaboration diagram for Kratos::TetrahedraSplit:

Static Public Member Functions

static void TetrahedraSplitMode (int aux_ids[11], int edge_ids[6])
 Returns the edges vector filled with the splitting pattern. Provided the array of nodal ids, this method computes the edge by edge intersection and collapse pattern and saves it in a c array. More...
 
static void TetrahedraGetNewConnectivityGID (const int tetra_index, const int t[56], const int aux_ids[11], int *id0, int *id1, int *id2, int *id3)
 Returns the ids of a subtetra Provided the splitting connectivities array and the array containing the nodal ids, this function returns the global ids for a given subtetrahedron. More...
 
static int Split_Tetrahedra (const int edges[6], int t[56], int *nel, int *splitted_edges, int *nint)
 Function to split a tetrahedron For a given edges splitting pattern, this function computes the internal tetrahedral subdivision. More...
 

Detailed Description

This class performs the splitting of a tetrahedra. It contains three helper functions to ease the splitting: TetrahedraSplitMode, Split_Tetrahedra, and TetrahedraGetNewConnectivityGID.

EXAMPLE: imagine that a user would like to split a tetrahedra formed by the ids 3 9 7 12 by introducing a new node 15 on the edge between 9 and 7. Then he should define:

int aux[11]; int edge_ids[6]; int t[56];

and initialize aux[11] as:

aux[0] = 3; aux[1] = 9; aux[2] = 7; aux[3] = 12; aux[4] = -1; // Edge 01 --> edge not to be refined aux[5] = 15; // Edge 02 --> this is the only edge in where we want to add a node aux[6] = -1; // Edge 03 --> edge not to be refined aux[7] = -1; // Edge 12 --> edge not to be refined aux[8] = -1; // Edge 13 --> edge not to be refined aux[9] = -1; // Edge 23 --> edge not to be refined aux[10] = -1; // Internal (Steiner) node (set it to -1 for the moment)

then call:

TetrahedraSplitMode(aux, edge_ids); int nel; //number of element generated
int number_splitted_edges; //number of splitted edges
int nint; //number of internal nodes
bool split_needed = Split_Tetrahedra(edge_ids, t, &nel, &number_splitted_edges, &nint)

if (nint == 1) { // we need to generate a new internal node aux[10] = new node id }

the new tetrahedra ids can be then inspected by calling

for(int i = 0; i < nel; ++i) { int i0,i1,i2,i3; TetrahedraGetNewConnectivityGID(i, t, aux, &i0, &i1, &i2, &i3); }

Member Function Documentation

◆ Split_Tetrahedra()

static int Kratos::TetrahedraSplit::Split_Tetrahedra ( const int  edges[6],
int  t[56],
int nel,
int splitted_edges,
int nint 
)
inlinestatic

Function to split a tetrahedron For a given edges splitting pattern, this function computes the internal tetrahedral subdivision.

Parameters
edgesInput array of size 6 containing the edges splitting pattern. Edges are enumerated as 01 02 03 12 13 23
tInteger c array of size 56 (= 14*4) containing the splitting connectivities
nelNumber of elements (subdivisions) generated
splitted_edgesNumber of splitted edges
nintIf 1, the internal (Steiner) node is needed
Returns
int 1 if splitting is needed and 0 if not

◆ TetrahedraGetNewConnectivityGID()

static void Kratos::TetrahedraSplit::TetrahedraGetNewConnectivityGID ( const int  tetra_index,
const int  t[56],
const int  aux_ids[11],
int id0,
int id1,
int id2,
int id3 
)
inlinestatic

Returns the ids of a subtetra Provided the splitting connectivities array and the array containing the nodal ids, this function returns the global ids for a given subtetrahedron.

Parameters
tetra_indexIndex of the new subtetrahedron
tInteger array containing the connectivities (provided by Split_Tetrahedra)
aux_idsArray used in constructing the edge_ids
id0Global id of node 0 of the new tetrahedron
id1Global id of node 1 of the new tetrahedron
id2Global id of node 2 of the new tetrahedron
id3Global id of node 3 of the new tetrahedron

◆ TetrahedraSplitMode()

static void Kratos::TetrahedraSplit::TetrahedraSplitMode ( int  aux_ids[11],
int  edge_ids[6] 
)
inlinestatic

Returns the edges vector filled with the splitting pattern. Provided the array of nodal ids, this method computes the edge by edge intersection and collapse pattern and saves it in a c array.

Parameters
aux_idsArray with 11 components containing the nodal ids. 4 components for the vertices, 6 for the edge nodes (which value is negative if the edge is not split) and an extra one for those cases in where the internal (Steiner) node is needed: aux_ids[0] = id of the FIRST node of the original tetra aux_ids[1] = id of the SECOND node of the original tetra aux_ids[2] = id of the THIRD node of the original tetra aux_ids[3] = id of the FOURTH node of the original tetra aux_ids[4] = id of new node to be used for the edge 01 (-1 if edge not to be splitted) aux_ids[5] = id of new node to be used for the edge 02 (-1 if edge not to be splitted) aux_ids[6] = id of new node to be used for the edge 03 (-1 if edge not to be splitted) aux_ids[7] = id of new node to be used for the edge 12 (-1 if edge not to be splitted) aux_ids[8] = id of new node to be used for the edge 13 (-1 if edge not to be splitted) aux_ids[9] = id of new node to be used for the edge 23 (-1 if edge not to be splitted) aux_ids[10] = id of new internal node (can be setted by the user or if needed, that is, if nint=1)
edge_idsArray with 6 components in where the collapse local numbering pattern is saved.

The documentation for this class was generated from the following file: