14 #ifndef KRATOS_COMPRESSIBLE_ELEMENT_ROTATION_UTILITY
15 #define KRATOS_COMPRESSIBLE_ELEMENT_ROTATION_UTILITY
53 template<
class TLocalMatrixType,
class TLocalVectorType>
77 const unsigned int DomainSize,
100 TLocalMatrixType& rLocalMatrix,
101 TLocalVectorType& rLocalVector,
104 if (this->
GetDomainSize() == 2) this->
template RotateAux<2,4,1>(rLocalMatrix,rLocalVector,rGeometry);
105 else if (this->
GetDomainSize() == 3) this->
template RotateAux<3,5,1>(rLocalMatrix,rLocalVector,rGeometry);
110 TLocalVectorType& rLocalVector,
113 TLocalMatrixType
dummy =
ZeroMatrix(rLocalVector.size(),rLocalVector.size());
114 if (this->
GetDomainSize() == 2) this->
template RotateAux<2,4,1>(
dummy,rLocalVector,rGeometry);
115 else if (this->
GetDomainSize() == 3) this->
template RotateAux<3,5,1>(
dummy,rLocalVector,rGeometry);
125 TLocalVectorType& rLocalVector,
128 const unsigned int LocalSize = rLocalVector.size();
132 for(
unsigned int itNode = 0; itNode < rGeometry.
PointsNumber(); ++itNode)
134 if(this->
IsSlip(rGeometry[itNode]) )
139 for(
unsigned int i = 0;
i <
j; ++
i)
141 rLocalMatrix(
i,
j) = 0.0;
142 rLocalMatrix(
j,
i) = 0.0;
144 for(
unsigned int i =
j+1;
i < LocalSize; ++
i)
146 rLocalMatrix(
i,
j) = 0.0;
147 rLocalMatrix(
j,
i) = 0.0;
150 rLocalVector(
j) = 0.0;
151 rLocalMatrix(
j,
j) = 1.0;
161 if (rLocalVector.size() > 0)
163 for(
unsigned int itNode = 0; itNode < rGeometry.
PointsNumber(); ++itNode)
165 if( this->
IsSlip(rGeometry[itNode]) )
169 rLocalVector[
j] = 0.0;
182 #pragma omp parallel for firstprivate(momentum,Tmp)
183 for(
int iii=0; iii<static_cast<int>(rModelPart.
Nodes().size()); iii++)
186 if( this->
IsSlip(*itNode) )
195 for(
unsigned int i = 0;
i < 3;
i++) momentum[
i] = rMomentum[
i];
197 for(
unsigned int i = 0;
i < 3;
i++) rMomentum[
i] = Tmp[
i];
205 for(
unsigned int i = 0;
i < 2;
i++) momentum[
i] = rMomentum[
i];
207 for(
unsigned int i = 0;
i < 2;
i++) rMomentum[
i] = Tmp[
i];
220 #pragma omp parallel for firstprivate(momentum,Tmp)
221 for(
int iii=0; iii<static_cast<int>(rModelPart.
Nodes().size()); iii++)
224 if( this->
IsSlip(*itNode) )
232 for(
unsigned int i = 0;
i < 3;
i++) momentum[
i] = rMomentum[
i];
234 for(
unsigned int i = 0;
i < 3;
i++) rMomentum[
i] = Tmp[
i];
242 for(
unsigned int i = 0;
i < 2;
i++) momentum[
i] = rMomentum[
i];
244 for(
unsigned int i = 0;
i < 2;
i++) rMomentum[
i] = Tmp[
i];
263 std::string
Info()
const override
265 std::stringstream buffer;
266 buffer <<
"CompressibleElementRotationUtility";
273 rOStream <<
"CompressibleElementRotationUtility";
277 void PrintData(std::ostream& rOStream)
const override {}
362 template<
class TLocalMatrixType,
class TLocalVectorType>
369 template<
class TLocalMatrixType,
class TLocalVectorType>
373 rOStream << std::endl;
A utility to rotate the local contributions of certain nodes to the system matrix,...
Definition: compressible_element_rotation_utility.h:54
~CompressibleElementRotationUtility() override
Destructor.
Definition: compressible_element_rotation_utility.h:83
void ApplySlipCondition(TLocalVectorType &rLocalVector, GeometryType &rGeometry) const override
RHS only version of ApplySlipCondition.
Definition: compressible_element_rotation_utility.h:158
Node NodeType
Definition: compressible_element_rotation_utility.h:62
Geometry< Node > GeometryType
Definition: compressible_element_rotation_utility.h:64
CompressibleElementRotationUtility(const unsigned int DomainSize, const Kratos::Flags &rFlag=SLIP)
Constructor.
Definition: compressible_element_rotation_utility.h:76
void RecoverVelocities(ModelPart &rModelPart) const override
Transform nodal velocities from the rotated system to the original one.
Definition: compressible_element_rotation_utility.h:214
std::string Info() const override
Turn back information as a string.
Definition: compressible_element_rotation_utility.h:263
void Rotate(TLocalMatrixType &rLocalMatrix, TLocalVectorType &rLocalVector, GeometryType &rGeometry) const override
Rotate the local system contributions so that they are oriented with each node's normal.
Definition: compressible_element_rotation_utility.h:99
void RotateVelocities(ModelPart &rModelPart) const override
Transform nodal velocities to the rotated coordinates (aligned with each node's normal)
Definition: compressible_element_rotation_utility.h:176
void Rotate(TLocalVectorType &rLocalVector, GeometryType &rGeometry) const override
RHS only version of Rotate.
Definition: compressible_element_rotation_utility.h:109
void ApplySlipCondition(TLocalMatrixType &rLocalMatrix, TLocalVectorType &rLocalVector, GeometryType &rGeometry) const override
Apply slip boundary conditions to the rotated local contributions.
Definition: compressible_element_rotation_utility.h:124
KRATOS_CLASS_POINTER_DEFINITION(CompressibleElementRotationUtility)
Pointer definition of CompressibleElementRotationUtility.
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: compressible_element_rotation_utility.h:277
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: compressible_element_rotation_utility.h:271
Geometry base class.
Definition: geometry.h:71
SizeType PointsNumber() const
Definition: geometry.h:528
Definition: amatrix_interface.h:41
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
MeshType::NodeIterator NodeIterator
Definition: model_part.h:134
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
This class defines the node.
Definition: node.h:65
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
AMatrix::MatrixProductExpression< TExpression1Type, TExpression2Type > prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:568
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
AMatrix::TransposeMatrix< const T > trans(const T &TheMatrix)
Definition: amatrix_interface.h:486
TABLE_NUMBER_ANGULAR_VELOCITY TABLE_NUMBER_MOMENT I33 BEAM_INERTIA_ROT_UNIT_LENGHT_Y KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, double, BEAM_INERTIA_ROT_UNIT_LENGHT_Z) typedef std double
Definition: DEM_application_variables.h:182
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
int j
Definition: quadrature.py:648
dummy
Definition: script.py:194
integer i
Definition: TensorModule.f:17