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

CUTTING ISOSURFACE APPLICATION. More...

#include <cutting_iso_app.h>

Collaboration diagram for Kratos::Cutting_Isosurface_Application:

Public Types

Type Definitions
typedef ModelPart::NodesContainerType NodesArrayType
 
typedef ModelPart::ElementsContainerType ElementsArrayType
 
typedef ModelPart::ConditionsContainerType ConditionsArrayType
 
typedef boost::numeric::ublas::vector< MatrixMatrix_Order_Tensor
 
typedef boost::numeric::ublas::vector< VectorVector_Order_Tensor
 
typedef boost::numeric::ublas::vector< Vector_Order_TensorNode_Vector_Order_Tensor
 
typedef Node PointType
 
typedef Node ::Pointer PointPointerType
 
typedef std::vector< PointType::Pointer > PointVector
 

Life Cycle

 Cutting_Isosurface_Application ()=default
 Default constructor. More...
 
virtual ~Cutting_Isosurface_Application ()=default
 Destructor. More...
 
template<class TDataType >
void GenerateVariableCut (ModelPart &mr_model_part, ModelPart &mr_new_model_part, Variable< TDataType > &variable, double isovalue, int isosurface_number, float tolerance)
 This function Creates cutting isosurfaces by creating nodes and conditions (to define the conectivities) in a different model part. (new_model_part) More...
 
void AddModelPartElements (ModelPart &mr_model_part, ModelPart &mr_new_model_part, int number)
 ADDMODELPARTELEMENTS: THIS FUNCTION ADDS TO THE NEW MODEL PART THE DATA BELONGING TO THE OLD MODEL PART. More...
 
void AddSkinConditions (ModelPart &mr_model_part, ModelPart &mr_new_model_part, int 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 CSR_Row_Matrix_Mod (ModelPart &this_model_part, compressed_matrix< int > &Coord)
 LIST OF SUBROUTINES. More...
 
void FirstLoop (ModelPart &this_model_part, compressed_matrix< int > &Coord, Variable< double > &variable, double isovalue, int number_of_triangles, vector< int > &Elems_In_Isosurface, float tolerance)
 ‍************************************************************************************************ More...
 
void FirstLoop (ModelPart &this_model_part, compressed_matrix< int > &Coord, Variable< array_1d< double, 3 > > &variable, double isovalue, int number_of_triangles, vector< int > &Elems_In_Isosurface, float tolerance)
 
void Create_List_Of_New_Nodes_Mod (ModelPart &this_model_part, ModelPart &new_model_part, compressed_matrix< int > &Coord, boost::numeric::ublas::vector< int > &List_New_Nodes, boost::numeric::ublas::vector< array_1d< int, 2 > > &Position_Node)
 ‍************************************************************************************************ More...
 
void Calculate_Coordinate_And_Insert_New_Nodes_Mod (ModelPart &this_model_part, ModelPart &new_model_part, const boost::numeric::ublas::vector< array_1d< int, 2 > > &Position_Node, const boost::numeric::ublas::vector< int > &List_New_Nodes, Variable< double > &variable, double isovalue, float tolerance)
 ‍************************************************************************************************ More...
 
void Calculate_Coordinate_And_Insert_New_Nodes_Mod (ModelPart &this_model_part, ModelPart &new_model_part, const boost::numeric::ublas::vector< array_1d< int, 2 > > &Position_Node, const boost::numeric::ublas::vector< int > &List_New_Nodes, Variable< array_1d< double, 3 > > &variable, double isovalue, float tolerance)
 
void GenerateElements (ModelPart &this_model_part, ModelPart &new_model_part, const boost::numeric::ublas::vector< array_1d< int, 4 > > &Position_Node, vector< int > Elems_In_Isosurface, compressed_matrix< int > &Coord, Variable< double > &variable, int surface_number)
 ‍************************************************************************************************ More...
 
void GenerateElements (ModelPart &this_model_part, ModelPart &new_model_part, const boost::numeric::ublas::vector< array_1d< int, 4 > > &Position_Node, vector< int > Elems_In_Isosurface, compressed_matrix< int > &Coord, Variable< array_1d< double, 3 > > &variable, int surface_number)
 
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...
 
void DeleteCutData (ModelPart &new_model_part)
 DELETECUTDATA: THIS FUNCTION DELETES THE MESH FROM THE PREVIOUS TIME STEP. More...
 

Detailed Description

CUTTING ISOSURFACE APPLICATION.

The cutting app is used to create cutting isosurfaces 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 surfaces 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. After each time step DeleteCutData must also be called to have a clean model part for the next step. NOTE: it only work with tetrahedra elements, generating triangles (1 or 2) from the tetrahedra - plane intersection.

Member Typedef Documentation

◆ ConditionsArrayType

◆ ElementsArrayType

◆ Matrix_Order_Tensor

◆ Node_Vector_Order_Tensor

◆ NodesArrayType

◆ PointPointerType

◆ PointType

◆ PointVector

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

◆ Vector_Order_Tensor

Constructor & Destructor Documentation

◆ Cutting_Isosurface_Application()

Kratos::Cutting_Isosurface_Application::Cutting_Isosurface_Application ( )
default

Default constructor.

◆ ~Cutting_Isosurface_Application()

virtual Kratos::Cutting_Isosurface_Application::~Cutting_Isosurface_Application ( )
virtualdefault

Destructor.

Member Function Documentation

◆ AddModelPartElements()

void Kratos::Cutting_Isosurface_Application::AddModelPartElements ( ModelPart mr_model_part,
ModelPart mr_new_model_part,
int  number 
)
inline

ADDMODELPARTELEMENTS: THIS FUNCTION ADDS TO THE NEW MODEL PART THE DATA BELONGING TO THE OLD MODEL PART.

this function adds the elements to the new_model_part. WARNING: They have to be tetrahedras 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
number. layer to add the conditions (integer)

◆ AddSkinConditions()

void Kratos::Cutting_Isosurface_Application::AddSkinConditions ( ModelPart mr_model_part,
ModelPart mr_new_model_part,
int  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 condition. 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
number. layer to add the conditions (integer)

◆ Calculate_Coordinate_And_Insert_New_Nodes_Mod() [1/2]

void Kratos::Cutting_Isosurface_Application::Calculate_Coordinate_And_Insert_New_Nodes_Mod ( ModelPart this_model_part,
ModelPart new_model_part,
const boost::numeric::ublas::vector< array_1d< int, 2 > > &  Position_Node,
const boost::numeric::ublas::vector< int > &  List_New_Nodes,
Variable< array_1d< double, 3 > > &  variable,
double  isovalue,
float  tolerance 
)
inline

calculating the coordinate of the new nodes

inserting the new node in the model part

◆ Calculate_Coordinate_And_Insert_New_Nodes_Mod() [2/2]

void Kratos::Cutting_Isosurface_Application::Calculate_Coordinate_And_Insert_New_Nodes_Mod ( ModelPart this_model_part,
ModelPart new_model_part,
const boost::numeric::ublas::vector< array_1d< int, 2 > > &  Position_Node,
const boost::numeric::ublas::vector< int > &  List_New_Nodes,
Variable< double > &  variable,
double  isovalue,
float  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::Cutting_Isosurface_Application::Create_List_Of_New_Nodes_Mod ( ModelPart this_model_part,
ModelPart new_model_part,
compressed_matrix< int > &  Coord,
boost::numeric::ublas::vector< int > &  List_New_Nodes,
boost::numeric::ublas::vector< 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::Cutting_Isosurface_Application::CSR_Row_Matrix_Mod ( ModelPart this_model_part,
compressed_matrix< int > &  Coord 
)
inline

LIST OF SUBROUTINES.

◆ DeleteCutData()

void Kratos::Cutting_Isosurface_Application::DeleteCutData ( ModelPart new_model_part)
inline

DELETECUTDATA: THIS FUNCTION DELETES THE MESH FROM THE PREVIOUS TIME STEP.

deletes data

Parameters
new_model_part. cut model part

◆ FirstLoop() [1/2]

void Kratos::Cutting_Isosurface_Application::FirstLoop ( ModelPart this_model_part,
compressed_matrix< int > &  Coord,
Variable< array_1d< double, 3 > > &  variable,
double  isovalue,
int  number_of_triangles,
vector< int > &  Elems_In_Isosurface,
float  tolerance 
)
inline

◆ FirstLoop() [2/2]

void Kratos::Cutting_Isosurface_Application::FirstLoop ( ModelPart this_model_part,
compressed_matrix< int > &  Coord,
Variable< double > &  variable,
double  isovalue,
int  number_of_triangles,
vector< int > &  Elems_In_Isosurface,
float  tolerance 
)
inline

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

◆ GenerateElements() [1/2]

void Kratos::Cutting_Isosurface_Application::GenerateElements ( ModelPart this_model_part,
ModelPart new_model_part,
const boost::numeric::ublas::vector< array_1d< int, 4 > > &  Position_Node,
vector< int Elems_In_Isosurface,
compressed_matrix< int > &  Coord,
Variable< array_1d< double, 3 > > &  variable,
int  surface_number 
)
inline

we enter the element loop

we enter in the if for only one triangle in the tetrahedra

entering now the if for 2 triangles inside the tetrahedra.

◆ GenerateElements() [2/2]

void Kratos::Cutting_Isosurface_Application::GenerateElements ( ModelPart this_model_part,
ModelPart new_model_part,
const boost::numeric::ublas::vector< array_1d< int, 4 > > &  Position_Node,
vector< int Elems_In_Isosurface,
compressed_matrix< int > &  Coord,
Variable< double > &  variable,
int  surface_number 
)
inline

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

we enter the element loop

we enter in the if for only one triangle in the tetrahedra

entering now the if for 2 triangles inside the tetrahedra.

◆ GenerateVariableCut()

template<class TDataType >
void Kratos::Cutting_Isosurface_Application::GenerateVariableCut ( ModelPart mr_model_part,
ModelPart mr_new_model_part,
Variable< TDataType > &  variable,
double  isovalue,
int  isosurface_number,
float  tolerance 
)
inline

This function Creates cutting isosurfaces 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 isosurface is created and therefore new nodes and conditions are added to the new model part WARNING: the cutting isosurface 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
variable.variable to define the isosurface
isovalue.value of the variable to define the isosurface
isosurface_number. layer to add the conditions (integer)
tolerancefactor .

◆ UpdateCutData()

void Kratos::Cutting_Isosurface_Application::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: