14 #ifndef KRATOS_MPM_BOUNDARY_ROTATION_UTILITY
15 #define KRATOS_MPM_BOUNDARY_ROTATION_UTILITY
54 template<
class TLocalMatrixType,
class TLocalVectorType>
79 const unsigned int DomainSize,
80 const unsigned int BlockSize,
106 TLocalMatrixType& rLocalMatrix,
107 TLocalVectorType& rLocalVector,
112 if (this->
GetDomainSize() == 2) this->
template RotateAuxPure<2>(rLocalMatrix,rLocalVector,rGeometry);
113 else if (this->
GetDomainSize() == 3) this->
template RotateAuxPure<3>(rLocalMatrix,rLocalVector,rGeometry);
117 if (this->
GetDomainSize() == 2) this->
template RotateAux<2,3>(rLocalMatrix,rLocalVector,rGeometry);
118 else if (this->
GetDomainSize() == 3) this->
template RotateAux<3,4>(rLocalMatrix,rLocalVector,rGeometry);
125 TLocalVectorType& rLocalVector,
128 this->
Rotate(rLocalVector,rGeometry);
138 TLocalVectorType& rLocalVector,
141 const unsigned int LocalSize = rLocalVector.size();
145 for(
unsigned int itNode = 0; itNode < rGeometry.
PointsNumber(); ++itNode)
147 if(this->
IsSlip(rGeometry[itNode]) )
154 const array_1d<double,3> & displacement = rGeometry[itNode].FastGetSolutionStepValue(DISPLACEMENT);
162 if (rLocalMatrix.size1() != 0) {
163 for(
unsigned int i = 0;
i < LocalSize; ++
i)
165 rLocalMatrix(
i,
j) = 0.0;
166 rLocalMatrix(
j,
i) = 0.0;
168 rLocalMatrix(
j,
j) = 1.0;
184 TLocalMatrixType dummyMatrix;
190 TLocalVectorType& rLocalVector,
215 TLocalVectorType& rLocalVector,
226 const unsigned int LocalSize = rLocalVector.size();
231 TLocalMatrixType temp_matrix =
ZeroMatrix(rLocalMatrix.size1(),rLocalMatrix.size2());
232 for(
unsigned int itNode = 0; itNode < rGeometry.
PointsNumber(); ++itNode)
234 if(this->
IsSlip(rGeometry[itNode]) )
241 for (
unsigned int i =
j;
i < rLocalMatrix.size1();
i+=
block_size)
243 temp_matrix(
i,
j) = rLocalMatrix(
i,
j);
244 temp_matrix(
j,
i) = rLocalMatrix(
j,
i);
250 if (
i!=
j) rLocalVector[
i] = 0.0;
256 rLocalMatrix = temp_matrix;
267 TLocalMatrixType dummyMatrix;
274 bool is_penalty =
false;
275 for(
unsigned int itNode = 0; itNode < rGeometry.
PointsNumber(); ++itNode)
277 if(this->
IsSlip(rGeometry[itNode]) )
279 const double identifier = rGeometry[itNode].FastGetSolutionStepValue(mrFlagVariable);
280 const double tolerance = 1.e-6;
281 if (identifier > 1.00 + tolerance)
306 #pragma omp parallel for firstprivate(displacement,Tmp)
307 for(
int iii=0; iii<static_cast<int>(rModelPart.
Nodes().size()); iii++)
310 if( this->
IsSlip(*itNode) )
319 for(
unsigned int i = 0;
i < 3;
i++) displacement[
i] = rDisplacement[
i];
321 for(
unsigned int i = 0;
i < 3;
i++) rDisplacement[
i] = Tmp[
i];
329 for(
unsigned int i = 0;
i < 2;
i++) displacement[
i] = rDisplacement[
i];
331 for(
unsigned int i = 0;
i < 2;
i++) rDisplacement[
i] = Tmp[
i];
351 #pragma omp parallel for firstprivate(displacement,Tmp)
352 for(
int iii=0; iii<static_cast<int>(rModelPart.
Nodes().size()); iii++)
355 if( this->
IsSlip(*itNode) )
363 for(
unsigned int i = 0;
i < 3;
i++) displacement[
i] = rDisplacement[
i];
365 for(
unsigned int i = 0;
i < 3;
i++) rDisplacement[
i] = Tmp[
i];
373 for(
unsigned int i = 0;
i < 2;
i++) displacement[
i] = rDisplacement[
i];
375 for(
unsigned int i = 0;
i < 2;
i++) rDisplacement[
i] = Tmp[
i];
388 #pragma omp parallel for firstprivate(reaction,local_reaction,global_reaction)
389 for(
int iii=0; iii<static_cast<int>(rModelPart.
Nodes().size()); iii++)
392 const double nodal_mass = itNode->FastGetSolutionStepValue(NODAL_MASS, 0);
394 if( this->
IsSlip(*itNode) && nodal_mass > std::numeric_limits<double>::epsilon())
403 for(
unsigned int i = 0;
i < 3;
i++) reaction[
i] = rReaction[
i];
407 local_reaction[1]=0.0;
408 local_reaction[2]=0.0;
412 for(
unsigned int i = 0;
i < 3;
i++) rReaction[
i] = global_reaction[
i];
421 for(
unsigned int i = 0;
i < 2;
i++) reaction[
i] = rReaction[
i];
425 local_reaction[1]=0.0;
429 for(
unsigned int i = 0;
i < 2;
i++) rReaction[
i] = global_reaction[
i];
447 std::string
Info()
const override
449 std::stringstream buffer;
450 buffer <<
"MPMBoundaryRotationUtility";
457 rOStream <<
"MPMBoundaryRotationUtility";
461 void PrintData(std::ostream& rOStream)
const override {}
542 template<
class TLocalMatrixType,
class TLocalVectorType>
549 template<
class TLocalMatrixType,
class TLocalVectorType>
553 rOStream << std::endl;
Geometry base class.
Definition: geometry.h:71
SizeType PointsNumber() const
Definition: geometry.h:528
Definition: amatrix_interface.h:41
Definition: mpm_boundary_rotation_utility.h:55
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: mpm_boundary_rotation_utility.h:105
void ApplySlipCondition(TLocalMatrixType &rLocalMatrix, TLocalVectorType &rLocalVector, GeometryType &rGeometry) const override
Apply roler type boundary conditions to the rotated local contributions.
Definition: mpm_boundary_rotation_utility.h:137
void ConditionApplySlipCondition(TLocalVectorType &rLocalVector, GeometryType &rGeometry) const
Definition: mpm_boundary_rotation_utility.h:262
virtual void RotateDisplacements(ModelPart &rModelPart) const
Same functionalities as RotateVelocities, just to have a clear function naming.
Definition: mpm_boundary_rotation_utility.h:293
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: mpm_boundary_rotation_utility.h:461
MPMBoundaryRotationUtility & operator=(MPMBoundaryRotationUtility const &rOther)
Assignment operator.
Definition: mpm_boundary_rotation_utility.h:89
void ElementApplySlipCondition(TLocalMatrixType &rLocalMatrix, TLocalVectorType &rLocalVector, GeometryType &rGeometry) const
Definition: mpm_boundary_rotation_utility.h:189
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: mpm_boundary_rotation_utility.h:455
Node NodeType
Definition: mpm_boundary_rotation_utility.h:65
KRATOS_CLASS_POINTER_DEFINITION(MPMBoundaryRotationUtility)
Pointer definition of MPMBoundaryRotationUtility.
void CalculateReactionForces(ModelPart &rModelPart)
Definition: mpm_boundary_rotation_utility.h:381
std::string Info() const override
Turn back information as a string.
Definition: mpm_boundary_rotation_utility.h:447
void RotateVelocities(ModelPart &rModelPart) const override
Definition: mpm_boundary_rotation_utility.h:300
bool IsPenalty(GeometryType &rGeometry) const
Definition: mpm_boundary_rotation_utility.h:272
void ApplySlipCondition(TLocalVectorType &rLocalVector, GeometryType &rGeometry) const override
RHS only version of ApplySlipCondition.
Definition: mpm_boundary_rotation_utility.h:179
void RotateRHS(TLocalVectorType &rLocalVector, GeometryType &rGeometry) const
RHS only version of Rotate.
Definition: mpm_boundary_rotation_utility.h:124
MPMBoundaryRotationUtility(const unsigned int DomainSize, const unsigned int BlockSize, const Variable< double > &rVariable)
Constructor.
Definition: mpm_boundary_rotation_utility.h:78
void ConditionApplySlipCondition(TLocalMatrixType &rLocalMatrix, TLocalVectorType &rLocalVector, GeometryType &rGeometry) const
Definition: mpm_boundary_rotation_utility.h:214
virtual void RecoverDisplacements(ModelPart &rModelPart) const
Same functionalities as RecoverVelocities, just to have a clear function naming.
Definition: mpm_boundary_rotation_utility.h:338
void RecoverVelocities(ModelPart &rModelPart) const override
Definition: mpm_boundary_rotation_utility.h:345
Geometry< Node > GeometryType
Definition: mpm_boundary_rotation_utility.h:67
void ElementApplySlipCondition(TLocalVectorType &rLocalVector, GeometryType &rGeometry) const
Definition: mpm_boundary_rotation_utility.h:202
~MPMBoundaryRotationUtility() override
Destructor.
Definition: mpm_boundary_rotation_utility.h:86
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
TExpression1Type::data_type inner_prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:592
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 block_size
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:16
int j
Definition: quadrature.py:648
integer i
Definition: TensorModule.f:17