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.
List of all members
Kratos::CuttingUtility Class Reference

CUTTING UTILITY. More...

#include <cutting_utility.h>

Collaboration diagram for Kratos::CuttingUtility:

Public Types

Type Definitions
typedef ModelPart::NodesContainerType NodesArrayType
 
typedef ModelPart::ElementsContainerType ElementsArrayType
 
typedef ModelPart::ConditionsContainerType ConditionsArrayType
 
typedef DenseVector< MatrixMatrix_Order_Tensor
 
typedef DenseVector< VectorVector_Order_Tensor
 
typedef DenseVector< Vector_Order_TensorNode_Vector_Order_Tensor
 
typedef Node PointType
 
typedef Node ::Pointer PointPointerType
 
typedef std::vector< PointType::Pointer > PointVector
 
typedef PointVector::iterator PointIterator
 

Life Cycle

 CuttingUtility ()
 Default constructor. More...
 
virtual ~CuttingUtility ()
 Destructor. More...
 
void FindSmallestEdge (ModelPart &mr_model_part)
 This function Creates cutting planes by creating nodes and conditions (to define the conectivities) in a different model part. More...
 
void GenerateCut (ModelPart &mr_model_part, ModelPart &mr_new_model_part, const array_1d< double, 3 > &versor, const array_1d< double, 3 > &Xp, int plane_number, double tolerance_factor)
 This function Creates cutting planes by creating nodes and conditions (to define the conectivities) in a different model part. (new_model_part) More...
 
void AddSkinConditions (ModelPart &mr_model_part, ModelPart &mr_new_model_part, int plane_number)
 ADDSKINCONDITIONS: THIS FUNCTION ADDS TO THE NEW MODEL PART THE DATA OF THE CONDITIONS BELONGING TO THE OLD MODEL PART, BASICALLY THE SAME AS THE PREVIOUS FUNCTION BUT THERE'S NO NEED TO INTERPOLATE SINCE THE NODES COORDINATES ALREADY EXIST. WE ONLY NEED TO COPY THEM TO THE NEW MODEL PART. More...
 
void AddVariablesToCutModelPart (const ModelPart &rModelPart, ModelPart &rNewModelPart) const
 Initialize the solution step data container for the cut model part. More...
 
void CSR_Row_Matrix_Mod (ModelPart &this_model_part, boost::numeric::ublas::compressed_matrix< int > &Coord)
 
void FirstLoop (ModelPart &this_model_part, boost::numeric::ublas::compressed_matrix< int > &Coord, const array_1d< double, 3 > &versor, const array_1d< double, 3 > &Xp, int number_of_triangles, DenseVector< int > &Elems_In_Plane, double tolerance)
 
void Create_List_Of_New_Nodes_Mod (ModelPart &this_model_part, ModelPart &new_model_part, boost::numeric::ublas::compressed_matrix< int > &Coord, DenseVector< int > &List_New_Nodes, DenseVector< array_1d< int, 2 > > &Position_Node)
 ‍************************************************************************************************ More...
 
void Calculate_Coordinate_And_Insert_New_Nodes_Mod (ModelPart &this_model_part, ModelPart &new_model_part, const DenseVector< array_1d< int, 2 > > &Position_Node, const DenseVector< int > &List_New_Nodes, const array_1d< double, 3 > &versor, const array_1d< double, 3 > &Xp, double tolerance)
 ‍************************************************************************************************ More...
 
void GenerateElements (ModelPart &this_model_part, ModelPart &new_model_part, DenseVector< int > Elems_In_Plane, boost::numeric::ublas::compressed_matrix< int > &Coord, const array_1d< double, 3 > &versor, int plane_number)
 ‍********************************************************************************** More...
 
void UpdateCutData (ModelPart &new_model_part, ModelPart &old_model_part)
 UPDATECUTDATA: THIS FUNCTION UPDATES THE DATA OF THE NEW MODEL PART READING FROM THE DATA OF THE FATHER NODES (and weight factor) More...
 

Detailed Description

CUTTING UTILITY.

The cutting utility is used to create cutting planes in a 3D domain. Despite this can be done in the postprocessing (using Kratos), on large domains the output data would be really large and include info that is not useful for the user. This app creates nodes and conditions (in a new, empty model part) intersecting the domain with as many planes as the user want. It is also possible to use different layers If conditions are triangles, they can be added too to the new model part. After each time step UpdateCutData must be called to save the new info into the new model part, interpolating from the tetraeda elements NOTE: it only work with tetraedra elements, generating triangles (1 or 2) from the tetraedra - plane intersection.

Member Typedef Documentation

◆ ConditionsArrayType

◆ ElementsArrayType

◆ Matrix_Order_Tensor

◆ Node_Vector_Order_Tensor

◆ NodesArrayType

◆ PointIterator

typedef PointVector::iterator Kratos::CuttingUtility::PointIterator

◆ PointPointerType

◆ PointType

◆ PointVector

typedef std::vector<PointType::Pointer> Kratos::CuttingUtility::PointVector

◆ Vector_Order_Tensor

Constructor & Destructor Documentation

◆ CuttingUtility()

Kratos::CuttingUtility::CuttingUtility ( )
inline

Default constructor.

◆ ~CuttingUtility()

virtual Kratos::CuttingUtility::~CuttingUtility ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ AddSkinConditions()

void Kratos::CuttingUtility::AddSkinConditions ( ModelPart mr_model_part,
ModelPart mr_new_model_part,
int  plane_number 
)
inline

ADDSKINCONDITIONS: THIS FUNCTION ADDS TO THE NEW MODEL PART THE DATA OF THE CONDITIONS BELONGING TO THE OLD MODEL PART, BASICALLY THE SAME AS THE PREVIOUS FUNCTION BUT THERE'S NO NEED TO INTERPOLATE SINCE THE NODES COORDINATES ALREADY EXIST. WE ONLY NEED TO COPY THEM TO THE NEW MODEL PART.

this function adds the skin condtion. WARNING: They have to be triangles and it CAN'T be empty, otherwise a segmentation fault will appear

Parameters
mr_model_part. original model part
mr__new_model_part. destinantion model part
plane_number. layer to add the conditions (integer)

◆ AddVariablesToCutModelPart()

void Kratos::CuttingUtility::AddVariablesToCutModelPart ( const ModelPart rModelPart,
ModelPart rNewModelPart 
) const
inline

Initialize the solution step data container for the cut model part.

Please call this function before either GenerateCut or AddSkinCondition.

Parameters
rModelPartthe reference (problem) model part.
rNewModelPartthe new model part, where cut data will be stored.

◆ Calculate_Coordinate_And_Insert_New_Nodes_Mod()

void Kratos::CuttingUtility::Calculate_Coordinate_And_Insert_New_Nodes_Mod ( ModelPart this_model_part,
ModelPart new_model_part,
const DenseVector< array_1d< int, 2 > > &  Position_Node,
const DenseVector< int > &  List_New_Nodes,
const array_1d< double, 3 > &  versor,
const array_1d< double, 3 > &  Xp,
double  tolerance 
)
inline

‍************************************************************************************************

calculating the coordinate of the new nodes

inserting the new node in the model part

◆ Create_List_Of_New_Nodes_Mod()

void Kratos::CuttingUtility::Create_List_Of_New_Nodes_Mod ( ModelPart this_model_part,
ModelPart new_model_part,
boost::numeric::ublas::compressed_matrix< int > &  Coord,
DenseVector< int > &  List_New_Nodes,
DenseVector< array_1d< int, 2 > > &  Position_Node 
)
inline

‍************************************************************************************************

*WARNING

  • New Id de los Nodos
  • setting edges -2 to the new id of the new node

◆ CSR_Row_Matrix_Mod()

void Kratos::CuttingUtility::CSR_Row_Matrix_Mod ( ModelPart this_model_part,
boost::numeric::ublas::compressed_matrix< int > &  Coord 
)
inline

◆ FindSmallestEdge()

void Kratos::CuttingUtility::FindSmallestEdge ( ModelPart mr_model_part)
inline

This function Creates cutting planes by creating nodes and conditions (to define the conectivities) in a different model part.

It is used to find the smallest edge that will be used later as a reference to identify whether a node is part of the plane or is simple close (and therefore a new point will be created by interpolation)

Parameters
mr_model_part. model part to find the smallest edge

◆ FirstLoop()

void Kratos::CuttingUtility::FirstLoop ( ModelPart this_model_part,
boost::numeric::ublas::compressed_matrix< int > &  Coord,
const array_1d< double, 3 > &  versor,
const array_1d< double, 3 > &  Xp,
int  number_of_triangles,
DenseVector< int > &  Elems_In_Plane,
double  tolerance 
)
inline

◆ GenerateCut()

void Kratos::CuttingUtility::GenerateCut ( ModelPart mr_model_part,
ModelPart mr_new_model_part,
const array_1d< double, 3 > &  versor,
const array_1d< double, 3 > &  Xp,
int  plane_number,
double  tolerance_factor 
)
inline

This function Creates cutting planes by creating nodes and conditions (to define the conectivities) in a different model part. (new_model_part)

each time it is called a new cutting plane is created and therefore new nodes and conditions are added to the new model part WARNING: the cutting plane MUST cut the domain in at least one triangle, otherwise a segmentiation fault might appear

Parameters
mr_model_part. original model part
mr__new_model_part. destinantion model part
versor.unit vector perpendicular to the plane
Xp.a point that is part of the plane
plane_number. layer to add the conditions (integer)
tolerancefactor . if find_smallest edge has been called, then it is the tolerance relative to that edge, in this case it should be 0.5>factor>0. high values will generate less triangles but the result will not be a perfect plane. on the other hand small values will generate a perfect plane but with lots of ugly triangles. If findsmallestedge has noot been run, it absolute tolerance.

◆ GenerateElements()

void Kratos::CuttingUtility::GenerateElements ( ModelPart this_model_part,
ModelPart new_model_part,
DenseVector< int Elems_In_Plane,
boost::numeric::ublas::compressed_matrix< int > &  Coord,
const array_1d< double, 3 > &  versor,
int  plane_number 
)
inline

‍**********************************************************************************

we enter the element loop

we eter in the if for only one triangle in the tetraedra

entering now the if for 2 triangles inside the tetraedra.

◆ UpdateCutData()

void Kratos::CuttingUtility::UpdateCutData ( ModelPart new_model_part,
ModelPart old_model_part 
)
inline

UPDATECUTDATA: THIS FUNCTION UPDATES THE DATA OF THE NEW MODEL PART READING FROM THE DATA OF THE FATHER NODES (and weight factor)

interpolates data form the origin model part into the new model part (containing the cutting planes)

Parameters
new_model_part. destination model part
old_model_part. origin model part

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