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.
|
#include <normal_calculation_utils.h>
Public Types | |
Type Definitions | |
typedef std::size_t | IndexType |
The index type definition. More... | |
typedef std::size_t | SizeType |
The size type definition. More... | |
typedef Node | NodeType |
typedef Geometry< NodeType > | GeometryType |
Definition of geometries. More... | |
typedef ModelPart::ConditionType | ConditionType |
Condition type definition. More... | |
typedef ModelPart::ConditionsContainerType | ConditionsArrayType |
Conditions array definition. More... | |
using | NormalVariableType = Variable< array_1d< double, 3 > > |
Normal variable definition. More... | |
Public Member Functions | |
template<class TContainerType > | |
void | CalculateNormalsInContainer (ModelPart &rModelPart, const Variable< array_1d< double, 3 >> &rNormalVariable) |
template<class TContainerType , bool TIsHistorical> | |
void | InitializeNormals (ModelPart &rModelPart, const Variable< array_1d< double, 3 >> &rNormalVariable) |
template<class TContainerType , bool TIsHistorical> | |
void | CalculateUnitNormals (ModelPart &rModelPart, const bool EnforceGenericGeometryAlgorithm, const Variable< array_1d< double, 3 >> &rNormalVariable) |
template<class TContainerType , bool TIsHistorical> | |
void | ComputeUnitNormalsFromAreaNormals (ModelPart &rModelPart, const Variable< array_1d< double, 3 >> &rNormalVariable) |
template<> | |
ModelPart::ConditionsContainerType & | GetContainer (ModelPart &rModelPart) |
Operations | |
template<class TContainerType > | |
void | CalculateNormalsInContainer (ModelPart &rModelPart, const NormalVariableType &rNormalVariable=NORMAL) |
It computes the normal in the conditions. More... | |
template<class TContainerType , bool TIsHistorical = true> | |
void | CalculateNormals (ModelPart &rModelPart, const bool EnforceGenericGeometryAlgorithm=false, const bool ConsiderUnitNormal=false, const NormalVariableType &rNormalVariable=NORMAL) |
It computes the mean of the normal in the entities and in all the nodes. More... | |
template<class TContainerType , bool TIsHistorical = true> | |
void | CalculateUnitNormals (ModelPart &rModelPart, const bool EnforceGenericGeometryAlgorithm=false, const NormalVariableType &rNormalVariable=NORMAL) |
It computes the mean of the normal in the entities and in all the nodes (unit normal version) More... | |
void | CalculateOnSimplex (ConditionsArrayType &rConditions, const std::size_t Dimension, const NormalVariableType &rNormalVariable=NORMAL) |
Calculates the "area normal" (vector oriented as the normal with a dimension proportional to the area). More... | |
void | CalculateOnSimplexNonHistorical (ConditionsArrayType &rConditions, const std::size_t Dimension, const NormalVariableType &rNormalVariable=NORMAL) |
Calculates the "area normal" in the non-historical database (vector oriented as the normal with a dimension proportional to the area). More... | |
void | CalculateNormalShapeDerivativesOnSimplex (ConditionsArrayType &rConditions, const std::size_t Dimension) |
Calculates nodal area normal shape sensitivities w.r.t. nodal coordinates of the condition. More... | |
void | CalculateOnSimplex (ModelPart &rModelPart, const std::size_t Dimension, const NormalVariableType &rNormalVariable=NORMAL) |
Calculates the area normal (vector oriented as the normal with a dimension proportional to the area). More... | |
void | CalculateOnSimplexNonHistorical (ModelPart &rModelPart, const std::size_t Dimension, const NormalVariableType &rNormalVariable=NORMAL) |
Calculates the area normal in the non-historical database (vector oriented as the normal with a dimension proportional to the area). More... | |
void | CalculateOnSimplex (ModelPart &rModelPart, const NormalVariableType &rNormalVariable=NORMAL) |
Calculates the area normal (vector oriented as the normal with a dimension proportional to the area). More... | |
void | CalculateOnSimplexNonHistorical (ModelPart &rModelPart, const NormalVariableType &rNormalVariable=NORMAL) |
Calculates the area normal in the non-historical database (vector oriented as the normal with a dimension proportional to the area). More... | |
void | SwapNormals (ModelPart &rModelPart) |
This function swaps the normal of all of the conditions in a model part. More... | |
template<class TValueType > | |
void | CalculateOnSimplex (ModelPart &rModelPart, const std::size_t Dimension, const Variable< TValueType > &rVariable, const TValueType Zero, const NormalVariableType &rNormalVariable=NORMAL) |
Calculates the area normal (vector oriented as the normal with a dimension proportional to the area) using only nodes marked with a flag variable. More... | |
template<class TValueType > | |
void | CalculateOnSimplex (ModelPart &rModelPart, const std::size_t Dimension, const Variable< TValueType > &rVariable) |
Calculates the area normal (vector oriented as the normal with a dimension proportional to the area) using only nodes marked with a flag variable. More... | |
template<class TValueType > | |
void | CalculateOnSimplex (ModelPart &rModelPart, const std::size_t Dimension, const Variable< TValueType > &rVariable, const TValueType Zero, const double rAlpha, const NormalVariableType &rNormalVariable=NORMAL) |
Calculates the area normal (vector oriented as the normal with a dimension proportional to the area) using only nodes marked with a flag variable and detecting corners. Corners are defined as nodes that recieves more than 2 normals from their neighbor conditions with a difference in angle greater than Alpha . More... | |
template<class TValueType > | |
void | CalculateOnSimplexLowMemory (ModelPart &rModelPart, int Dimension, const Variable< TValueType > &rVariable, const TValueType Zero, const double rAlpha, const NormalVariableType &rNormalVariable=NORMAL) |
Calculates the area normal (vector oriented as the normal with a dimension proportional to the area) using only nodes marked with a flag variable and detecting corners. Corners are defined as nodes that recieves more than 2 normals from their neighbor conditions with a difference in angle greater than Alpha . (Low memory version) More... | |
Conditions array definition.
Condition type definition.
Definition of geometries.
typedef std::size_t Kratos::NormalCalculationUtils::IndexType |
The index type definition.
Normal variable definition.
typedef std::size_t Kratos::NormalCalculationUtils::SizeType |
The size type definition.
void Kratos::NormalCalculationUtils::CalculateNormals | ( | ModelPart & | rModelPart, |
const bool | EnforceGenericGeometryAlgorithm = false , |
||
const bool | ConsiderUnitNormal = false , |
||
const NormalVariableType & | rNormalVariable = NORMAL |
||
) |
It computes the mean of the normal in the entities and in all the nodes.
rModelPart | The model part to compute |
EnforceGenericGeometryAlgorithm | If enforce the generic algorithm for any kind of geometry |
ConsiderUnitNormal | In order to consider directly the unit normal instead of the area normal multiplied with a coefficient |
rNormalVariable | Component variable storing the normal value |
TEntity | The entity type considered |
TIsHistorical | Specifies if the historical or non-historical nodal database is used |
void Kratos::NormalCalculationUtils::CalculateNormalShapeDerivativesOnSimplex | ( | ConditionsArrayType & | rConditions, |
const std::size_t | Dimension | ||
) |
Calculates nodal area normal shape sensitivities w.r.t. nodal coordinates of the condition.
rConditions | List of conditions where shape sensitivities need to be calculated. |
Dimension | Dimensionality of the conditions |
void Kratos::NormalCalculationUtils::CalculateNormalsInContainer | ( | ModelPart & | rModelPart, |
const NormalVariableType & | rNormalVariable = NORMAL |
||
) |
It computes the normal in the conditions.
rModelPart | The model part to compute |
rNormalVariable | Component variable storing the normal value |
void Kratos::NormalCalculationUtils::CalculateNormalsInContainer | ( | ModelPart & | rModelPart, |
const Variable< array_1d< double, 3 >> & | rNormalVariable | ||
) |
void Kratos::NormalCalculationUtils::CalculateOnSimplex | ( | ConditionsArrayType & | rConditions, |
const std::size_t | Dimension, | ||
const NormalVariableType & | rNormalVariable = NORMAL |
||
) |
Calculates the "area normal" (vector oriented as the normal with a dimension proportional to the area).
This is done on the base of the Conditions provided which should be understood as the surface elements of the area of interest.
rConditions | A set of conditions defining the "skin" of a model |
Dimension | Spatial dimension (2 or 3) |
rNormalVariable | Component variable storing the normal value |
void Kratos::NormalCalculationUtils::CalculateOnSimplex | ( | ModelPart & | rModelPart, |
const NormalVariableType & | rNormalVariable = NORMAL |
||
) |
Calculates the area normal (vector oriented as the normal with a dimension proportional to the area).
This is done on the base of the Conditions provided which should be understood as the surface elements of the area of interest.
rModelPart | ModelPart of the problem. Must have a set of conditions defining the "skin" of the domain |
rNormalVariable | Component variable storing the normal value |
void Kratos::NormalCalculationUtils::CalculateOnSimplex | ( | ModelPart & | rModelPart, |
const std::size_t | Dimension, | ||
const NormalVariableType & | rNormalVariable = NORMAL |
||
) |
Calculates the area normal (vector oriented as the normal with a dimension proportional to the area).
This is done on the base of the Conditions provided which should be understood as the surface elements of the area of interest.
rModelPart | ModelPart of the problem. Must have a set of conditions defining the "skin" of the domain |
Dimension | Spatial dimension (2 or 3) |
rNormalVariable | Component variable storing the normal value |
|
inline |
Calculates the area normal (vector oriented as the normal with a dimension proportional to the area) using only nodes marked with a flag variable.
This function is equivalent to other implementations of CalculateOnSimplex, but instead of using all conditions in the array, it only uses those that contain a value of rVariable != Zero. This is useful in problems where a part of the boundary is a slip condition, as it provides more reasonable values for the normals on the border between this area and other parts of the boundary. This function is safe to use in MPI.
rModelPart | ModelPart of the problem. Must have a set of conditions defining the "skin" of the domain. |
Dimension | Spatial dimension (2 or 3). |
rVariable | The Kratos::Variable used to indicate which parts of the boundary will be used to calculate the normals. Conditions where rVariable == Zero will be skipped. |
|
inline |
Calculates the area normal (vector oriented as the normal with a dimension proportional to the area) using only nodes marked with a flag variable and detecting corners. Corners are defined as nodes that recieves more than 2 normals from their neighbor conditions with a difference in angle greater than Alpha .
This function is equivalent to other implementations of CalculateOnSimplex, but instead of using all conditions in the array, it only uses those that contain a value of rVariable != Zero. This is useful in problems where a part of the boundary is a slip condition, as it provides more reasonable values for the normals on the border between this area and other parts of the boundary. This function is safe to use in MPI.
rModelPart | ModelPart of the problem. Must have a set of conditions defining the "skin" of the domain. |
Dimension | Spatial dimension (2 or 3). |
rVariable | The Kratos::Variable used to indicate which parts of the boundary will be used to calculate the normals. Conditions where rVariable == Zero will be skipped. |
rAlpha | the maximum angle to distinguish normals. |
rNormalVariable | Component variable storing the normal value |
|
inline |
Calculates the area normal (vector oriented as the normal with a dimension proportional to the area) using only nodes marked with a flag variable.
This function is equivalent to other implementations of CalculateOnSimplex, but instead of using all conditions in the array, it only uses those that contain a value of rVariable != Zero. This is useful in problems where a part of the boundary is a slip condition, as it provides more reasonable values for the normals on the border between this area and other parts of the boundary. This function is safe to use in MPI.
rModelPart | ModelPart of the problem. Must have a set of conditions defining the "skin" of the domain. |
Dimension | Spatial dimension (2 or 3). |
rVariable | The Kratos::Variable used to indicate which parts of the boundary will be used to calculate the normals. |
Zero | The 'off' value for the flag. Conditions where rVariable == Zero will be skipped for normal calculation. |
rNormalVariable | Component variable storing the normal value |
|
inline |
Calculates the area normal (vector oriented as the normal with a dimension proportional to the area) using only nodes marked with a flag variable and detecting corners. Corners are defined as nodes that recieves more than 2 normals from their neighbor conditions with a difference in angle greater than Alpha . (Low memory version)
This function is equivalent to other implementations of CalculateOnSimplex, but instead of using all conditions in the array, it only uses those that contain a value of rVariable != Zero. This is useful in problems where a part of the boundary is a slip condition, as it provides more reasonable values for the normals on the border between this area and other parts of the boundary. This function is safe to use in MPI.
rModelPart | ModelPart of the problem. Must have a set of conditions defining the "skin" of the domain. |
Dimension | Spatial dimension (2 or 3). |
rVariable | The Kratos::Variable used to indicate which parts of the boundary will be used to calculate the normals. Conditions where rVariable == Zero will be skipped. |
rAlpha | the maximum angle to distinguish normals. |
rNormalVariable | Component variable storing the normal value |
void Kratos::NormalCalculationUtils::CalculateOnSimplexNonHistorical | ( | ConditionsArrayType & | rConditions, |
const std::size_t | Dimension, | ||
const NormalVariableType & | rNormalVariable = NORMAL |
||
) |
Calculates the "area normal" in the non-historical database (vector oriented as the normal with a dimension proportional to the area).
This is done on the base of the Conditions provided which should be understood as the surface elements of the area of interest.
rConditions | A set of conditions defining the "skin" of a model |
Dimension | Spatial dimension (2 or 3) |
rNormalVariable | Component variable storing the normal value |
void Kratos::NormalCalculationUtils::CalculateOnSimplexNonHistorical | ( | ModelPart & | rModelPart, |
const NormalVariableType & | rNormalVariable = NORMAL |
||
) |
Calculates the area normal in the non-historical database (vector oriented as the normal with a dimension proportional to the area).
This is done on the base of the Conditions provided which should be understood as the surface elements of the area of interest.
rModelPart | ModelPart of the problem. Must have a set of conditions defining the "skin" of the domain |
rNormalVariable | Component variable storing the normal value |
void Kratos::NormalCalculationUtils::CalculateOnSimplexNonHistorical | ( | ModelPart & | rModelPart, |
const std::size_t | Dimension, | ||
const NormalVariableType & | rNormalVariable = NORMAL |
||
) |
Calculates the area normal in the non-historical database (vector oriented as the normal with a dimension proportional to the area).
This is done on the base of the Conditions provided which should be understood as the surface elements of the area of interest.
rModelPart | ModelPart of the problem. Must have a set of conditions defining the "skin" of the domain |
Dimension | Spatial dimension (2 or 3) |
rNormalVariable | Component variable storing the normal value |
void Kratos::NormalCalculationUtils::CalculateUnitNormals | ( | ModelPart & | rModelPart, |
const bool | EnforceGenericGeometryAlgorithm, | ||
const Variable< array_1d< double, 3 >> & | rNormalVariable | ||
) |
void Kratos::NormalCalculationUtils::CalculateUnitNormals | ( | ModelPart & | rModelPart, |
const bool | EnforceGenericGeometryAlgorithm = false , |
||
const NormalVariableType & | rNormalVariable = NORMAL |
||
) |
It computes the mean of the normal in the entities and in all the nodes (unit normal version)
rModelPart | The model part to compute |
EnforceGenericGeometryAlgorithm | If enforce the generic algorithm for any kind of geometry |
rNormalVariable | Component variable storing the normal value |
TEntity | The entity type considered |
TIsHistorical | Specifies if the historical or non-historical nodal database is used |
void Kratos::NormalCalculationUtils::ComputeUnitNormalsFromAreaNormals | ( | ModelPart & | rModelPart, |
const Variable< array_1d< double, 3 >> & | rNormalVariable | ||
) |
ModelPart::ElementsContainerType & Kratos::NormalCalculationUtils::GetContainer | ( | ModelPart & | rModelPart | ) |
void Kratos::NormalCalculationUtils::InitializeNormals | ( | ModelPart & | rModelPart, |
const Variable< array_1d< double, 3 >> & | rNormalVariable | ||
) |
void Kratos::NormalCalculationUtils::SwapNormals | ( | ModelPart & | rModelPart | ) |
This function swaps the normal of all of the conditions in a model part.
This is done by swapping the two first nodes in the geometry and is thus appropriate for simplicial elements
rModelPart | ModelPart of the problem. Must have a set of conditions defining the "skin" of the domain |