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.
|
The class contains three helper functions to ease the splitting: PrismSplitMode, Split_Prism, and PrismGetNewConnectivityGID EXAMPLE: imagine that an user would like to split a prism wit a face formed by the ids 3 9 7 by introducing a new node 15 on the edge between 3 and 9 he should define int aux[12] int edge_ids[6] int t[24] then initialize aux[0] = 3; aux[1] = 9; aux[2] = 7; aux[3] = 15; //node on edge 01: edge to be refined aux[4] = -1; //node on edge 12:edge not to be refined aux[5] = -1; //node on edge 20:edge not to be refined then call. More...
Go to the source code of this file.
Functions | |
void | PrismSplitMode (const int aux_ids[12], int edge_ids[6]) |
void | PrismGetNewConnectivityGID (const int prism_index, const int t[24], const int aux_ids[12], int *id0, int *id1, int *id2, int *id3, int *id4, int *id5) |
int | Split_Prism (const int edges[6], int t[24], int *number_elem, int *splitted_edges, int *nint) |
The class contains three helper functions to ease the splitting: PrismSplitMode, Split_Prism, and PrismGetNewConnectivityGID EXAMPLE: imagine that an user would like to split a prism wit a face formed by the ids 3 9 7 by introducing a new node 15 on the edge between 3 and 9 he should define int aux[12] int edge_ids[6] int t[24] then initialize aux[0] = 3; aux[1] = 9; aux[2] = 7; aux[3] = 15; //node on edge 01: edge to be refined aux[4] = -1; //node on edge 12:edge not to be refined aux[5] = -1; //node on edge 20:edge not to be refined then call.
PrismSplitMode(edge_ids,aux) int number_elem; //number of nodes generated int number_splitted_edges; //number of splitted edges int nint; //number of internal nodes int split_needed = Split_Prism(edge_ids,t, &number_elem, &number_splitted_edges, &nint)
The split of the other face is straightforward, in fact this header is an adaptation of the split_triangle.h
the new prisms ids can be then inspected by for(int i=0; i<number_elem; i++) { int i0,i1,i2, i3,i4,i5; PrismGetNewConnectivityGID(i, t, aux, &i0,&i1,&i2,&i3,&i4,&i5); }
|
inline |
Utility function to get the global ids for the new prisms to be generated
prism_index | the index of the new prism to be generated (Should be less than the number number_elem provided by Split_Prism) |
t | integer array provided by Split_Prism |
aux_ids | array used in constructing the edge_ids (contains the Global Ids of the new nodes) |
id0 | Global ID of node0 of the new prism |
id1 | Global ID of node1 of the new prism |
id2 | Global ID of node2 of the new prism |
id3 | Global ID of node3 of the new prism |
id4 | Global ID of node4 of the new prism |
id5 | Global ID of node5 of the new prism |
void PrismSplitMode | ( | const int | aux_ids[12], |
int | edge_ids[6] | ||
) |
This function computes the splitting mode for the prism
aux_ids | Contains a vector with the input Ids, organized as follows aux_ids[0] = id of FIRST node of the original prism aux_ids[1] = id of SECOND node of the original prism aux_ids[2] = id of THIRD node of the original prism aux_ids[3] = id of FOURTH node of the original prism aux_ids[4] = id of FIFTH node of the original prism aux_ids[5] = id of SIXTH node of the original prism aux_ids[6] = id of new node to be used for the lower edge 01 (-1 if edge not to be splitted) aux_ids[7] = id of new node to be used for the lower edge 12 (-1 if edge not to be splitted) aux_ids[8] = id of new node to be used for the lower edge 20 (-1 if edge not to be splitted) aux_ids[9] = id of new node to be used for the upper edge 01 (-1 if edge not to be splitted) aux_ids[10] = id of new node to be used for the upper edge 12 (-1 if edge not to be splitted) aux_ids[11] = id of new node to be used for the upper edge 20 (-1 if edge not to be splitted) Given this data it fills an auxiliary vector of size 6 that will be used in the splitting |
edge_ids | This is an auxiliary array with the local numbering. It is necessary for the split_prism function |
int Split_Prism | ( | const int | edges[6], |
int | t[24], | ||
int * | number_elem, | ||
int * | splitted_edges, | ||
int * | nint | ||
) |
Utility to split prisms
edges | (input) int c array of size 6 |
t | (output) int c array of size 24 (6*4) |
number_elem | (output) number of elements in the subdivision |
splitted_edges | (output) provides the number of splitted edges |
nint | (output) internal node (not needed for prisms) |