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::DiscontinuousShapeFunctionsUtilities_2D Class Reference

This utility can be used to calculate the enriched shape function for tetrahedra element. More...

#include <discont_2d.h>

Collaboration diagram for Kratos::DiscontinuousShapeFunctionsUtilities_2D:

Static Public Member Functions

template<class TMatrixType , class TVectorType , class TGradientType >
static int CalculateTriangleDiscontinuousShapeFunctions (TMatrixType const &rPoints, TGradientType const &DN_DX, TVectorType rDistances, TVectorType &rVolumes, TMatrixType &rGPShapeFunctionValues, TVectorType &rPartitionsSign, std::vector< TMatrixType > &rGradientsValue, TMatrixType &Nenriched, TVectorType &face_gauss_N, TVectorType &face_gauss_Nenriched, double &face_Area, TVectorType &face_n, unsigned int &type_of_cut)
 The method to calculate the enriched shape functions for given triangle. More...
 
template<class TMatrixType , class TVectorType , class TGradientType >
static int CalculateTriangleDiscontinuousShapeFunctions_ZeroInBoundary (TMatrixType const &rPoints, TGradientType const &DN_DX, TVectorType rDistances, TVectorType &rVolumes, TMatrixType &rGPShapeFunctionValues, TVectorType &rPartitionsSign, std::vector< TMatrixType > &rGradientsValue, TMatrixType &NEnriched, TVectorType &face_gauss_N, TVectorType &face_gauss_Nenriched, double &face_Area, TVectorType &face_n, unsigned int &type_of_cut)
 

Detailed Description

This utility can be used to calculate the enriched shape function for tetrahedra element.

The metodology consists in partitioning the tetrahedra in a set of sub-tetrahedra and cacluate the enrichment information using these partitions.

Member Function Documentation

◆ CalculateTriangleDiscontinuousShapeFunctions()

template<class TMatrixType , class TVectorType , class TGradientType >
static int Kratos::DiscontinuousShapeFunctionsUtilities_2D::CalculateTriangleDiscontinuousShapeFunctions ( TMatrixType const &  rPoints,
TGradientType const &  DN_DX,
TVectorType  rDistances,
TVectorType &  rVolumes,
TMatrixType &  rGPShapeFunctionValues,
TVectorType &  rPartitionsSign,
std::vector< TMatrixType > &  rGradientsValue,
TMatrixType &  Nenriched,
TVectorType &  face_gauss_N,
TVectorType &  face_gauss_Nenriched,
double face_Area,
TVectorType &  face_n,
unsigned int type_of_cut 
)
inlinestatic

The method to calculate the enriched shape functions for given triangle.

Basically, two shape functions are provided,

  1. One is the enrichment to capturate discontinuities in the gradients of the pressure ("Improving Eulerian two-phase flow finite element approximation with discontinuous gradient (i.e pressure) shape functions" Coppola-Owen and Codina)
  2. The second one is to capturate discontinuities in the varialbe(ie. pressure). it is a shape function that is zero on the nodes and has a constant discontinuity along the found interfase)
Parameters
rPointsA 3x3 matrix where row i has the coordinates of node i.
DN_DXThe gradient of the shape functions Ni respect to the reference coordinates
rDistancesis an input vector of 3 size which holds relative distance for each node. it is used internally to mark the position of the zero level
rVolumesResult vector with size (3+1) (maximum number of partitions) holding the volume of each partition. Partitions are given in the following order: first the one that is "alone". meaning that it is on the side of the interfase where there's only a triangle and the other 2 are the ones in the other side. So the paritition signs will be allways -1,1,1 or 1,-1,-1 Note:volume 4 is not a partition itself, but is added to be used in the element. it would be the result of creating the 2 triangles of the cuadrilateral paritition with the opposite edge as the current configuration (joining node k_aux with node_4 instead of the current node_j-node5)
rShapeFunctionValuesResult 3x3 matrix where each row represents a partition and holds the shape functions N1 to N3 ( the cut) of the original triangle evaluated in the gauss point (center) of the partition. so that it is N(gauss_index, node_index)
rPartitionsSignA result vector of 3 holding the sign of the distance for the partition. Read rVolumes 5 lines above The value -1 represents the negative distance sign, 1 represents positive distance and 0 stands for not used partition
rGradientsValueRestult vector of size 3 holding the gradient of the enriched shape funciton for each volume. Each element of vector is a 1x3 matrix representing the gradient of enriched shape function. The use of matrix is for possible future improvement.
Nenrichedis a Matrix that contains for every gauss point the values of the enriched shape functions at the position of the gauss point so that Nenriched(1,0) contains the value of the enriched shape function "0" at the gauss point "1"
face_gauss_Nis the location of the (single) integration point of the interfase: its midpoint.
face_gauss_N_enrichis the value of the enrichment shape functions in the integration point actually it's value is always the same so no need to use it: the shape functions were defined to make it 1 in the first shape function, And 1 and -1 the second shape function (it's discontinous, so it has these two values in the interfase)
Warning
Therefore the discontinuity in the shape function is equal to 2.
Parameters
type_of_cutThe partition that is 'alone': the one that is on one side of the shape function the other two are the ones in the other side, meaning they have the same derivatives and , for example, densities.
Returns
number of partitions created which can be from 1 to 3. 1 holds for only 1 partition which is the original element. (No partitioning needed)

◆ CalculateTriangleDiscontinuousShapeFunctions_ZeroInBoundary()

template<class TMatrixType , class TVectorType , class TGradientType >
static int Kratos::DiscontinuousShapeFunctionsUtilities_2D::CalculateTriangleDiscontinuousShapeFunctions_ZeroInBoundary ( TMatrixType const &  rPoints,
TGradientType const &  DN_DX,
TVectorType  rDistances,
TVectorType &  rVolumes,
TMatrixType &  rGPShapeFunctionValues,
TVectorType &  rPartitionsSign,
std::vector< TMatrixType > &  rGradientsValue,
TMatrixType &  NEnriched,
TVectorType &  face_gauss_N,
TVectorType &  face_gauss_Nenriched,
double face_Area,
TVectorType &  face_n,
unsigned int type_of_cut 
)
inlinestatic

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