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.
|
TRILINOS CUTTING APPLICATION. More...
#include <trilinos_cutting_app.h>
Public Types | |
typedef ModelPart::NodesContainerType | NodesArrayType |
typedef ModelPart::ElementsContainerType | ElementsArrayType |
typedef ModelPart::ConditionsContainerType | ConditionsArrayType |
typedef vector< Matrix > | Matrix_Order_Tensor |
typedef vector< Vector > | Vector_Order_Tensor |
typedef vector< Vector_Order_Tensor > | Node_Vector_Order_Tensor |
typedef Node | PointType |
typedef Node ::Pointer | PointPointerType |
typedef std::vector< PointType::Pointer > | PointVector |
typedef PointVector::iterator | PointIterator |
Public Member Functions | |
TrilinosCuttingApplication (Epetra_MpiComm &Comm) | |
~TrilinosCuttingApplication () | |
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 | 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, THE NODES COORDINATES ALREADY EXIST. WE ONLY NEED TO COPY THEM INTO 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 | 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 | Clear () |
void | CSR_Row_Matrix (ModelPart &this_model_part, Kratos::shared_ptr< Epetra_FECrsMatrix > &p_edge_ids, Kratos::shared_ptr< Epetra_FECrsMatrix > &used_nodes_matrix) |
void | FirstLoop (ModelPart &this_model_part, Kratos::shared_ptr< Epetra_FECrsMatrix > &p_edge_ids, Kratos::shared_ptr< Epetra_FECrsMatrix > &p_partition_ids, array_1d< double, 3 > versor, array_1d< double, 3 > Xp, int &number_of_triangles, vector< int > &Elems_In_Plane, double tolerance, Kratos::shared_ptr< Epetra_FECrsMatrix > &used_nodes_matrix) |
void | Create_List_Of_New_Nodes (ModelPart &this_model_part, ModelPart &new_model_part, Kratos::shared_ptr< Epetra_FECrsMatrix > &p_edge_ids, Kratos::shared_ptr< Epetra_FECrsMatrix > &p_partition_ids, vector< int > &List_New_Nodes, vector< int > &partition_new_nodes, vector< array_1d< int, 2 > > &father_node_ids, Kratos::shared_ptr< Epetra_FECrsMatrix > &used_nodes_matrix) |
void | Calculate_Coordinate_And_Insert_New_Nodes (ModelPart &this_model_part, ModelPart &new_model_part, const vector< array_1d< int, 2 > > &father_node_ids, const vector< int > &List_New_Nodes, const vector< int > &partition_new_nodes, array_1d< double, 3 > versor, array_1d< double, 3 > Xp, double tolerance) |
void | GenerateElements (ModelPart &this_model_part, ModelPart &new_model_part, vector< int > Elems_In_Plane, const Kratos::shared_ptr< Epetra_FECrsMatrix > p_edge_ids, array_1d< double, 3 > versor, int plane_number, int &number_of_triangles) |
void | UpdateCutData (ModelPart &new_model_part, ModelPart &old_model_part) |
Protected Member Functions | |
double | GetValueFromRow (int row, int j, int row_size, int *indices, double *values) |
double | GetUpperTriangularMatrixValue (const Kratos::shared_ptr< Epetra_FECrsMatrix > &p_edge_ids, int index_0, int index_1, int &MaxNumEntries, int &NumEntries, int *Indices, double *values) |
Protected Attributes | |
double | smallest_edge |
bool | mMPICommSetup_is_defined |
Epetra_MpiComm & | mrComm |
Kratos::shared_ptr< Epetra_Map > | mp_overlapping_map |
Kratos::shared_ptr< Epetra_Map > | mp_non_overlapping_map |
int | mtotal_number_of_existing_nodes |
Kratos::shared_ptr< Epetra_FECrsGraph > | mp_non_overlapping_graph |
Kratos::shared_ptr< Epetra_CrsGraph > | mp_overlapping_graph |
TRILINOS CUTTING APPLICATION.
The cutting app 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. Info describing how to use it can be found in the wiki.
typedef vector<Matrix> Kratos::TrilinosCuttingApplication::Matrix_Order_Tensor |
typedef PointVector::iterator Kratos::TrilinosCuttingApplication::PointIterator |
typedef Node ::Pointer Kratos::TrilinosCuttingApplication::PointPointerType |
typedef std::vector<PointType::Pointer> Kratos::TrilinosCuttingApplication::PointVector |
typedef vector<Vector> Kratos::TrilinosCuttingApplication::Vector_Order_Tensor |
|
inline |
constructor:
ModelPart& | the model part to be refined |
Epetra_MpiComm | the Epetra Communicator to be used |
|
inline |
|
inline |
ADDSKINCONDITIONS: THIS FUNCTION ADDS TO THE NEW MODEL PART THE DATA OF THE CONDITIONS BELONGING TO THE OLD MODEL PART, THE NODES COORDINATES ALREADY EXIST. WE ONLY NEED TO COPY THEM INTO 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
mr_model_part | . original model part |
mr__new_model_part | . destinantion model part |
plane_number | . layer to add the conditions (integer) |
KRATOS_WATCH('line349')
|
inline |
Initialize the solution step data container for the cut model part.
Please call this function before either GenerateCut or AddSkinCondition.
rModelPart | the reference (problem) model part. |
rNewModelPart | the new model part, where cut data will be stored. |
|
inline |
calculating the coordinate of the new nodes
|
inline |
|
inline |
|
inline |
|
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)
mr_model_part | . model part to find the smallest edge |
|
inline |
|
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
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) |
tolerance | factor . 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. |
|
inline |
as the name says...
we enter the element loop
we enter in the if for only one triangle in the tetraedra
entering now the if for 2 triangles inside the tetraedra.
|
inlineprotected |
|
inlineprotected |
this function transfers the Constitutive Law internal variables from the father to the child. note that this is done through the vector Variable INTERNAL_VARIABLES which should also contain the geometric data needed for this.
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |