40 #ifndef KRATOS_WALL_CONDITION_DISCONTINUOUS_H
41 #define KRATOS_WALL_CONDITION_DISCONTINUOUS_H
94 template<
unsigned int TDim,
unsigned int TNumNodes = TDim >
156 GeometryType::Pointer pGeometry):
168 GeometryType::Pointer pGeometry,
169 PropertiesType::Pointer pProperties):
208 return Kratos::make_intrusive<WallConditionDiscontinuous>(NewId, this->
GetGeometry().
Create(ThisNodes), pProperties);
213 Condition::Pointer
Create(
IndexType NewId, Condition::GeometryType::Pointer pGeom, PropertiesType::Pointer pProperties)
const override
215 return Kratos::make_intrusive<WallConditionDiscontinuous>(NewId, pGeom, pProperties);
229 const ProcessInfo& r_process_info = rCurrentProcessInfo;
230 unsigned int step = r_process_info[FRACTIONAL_STEP];
234 const SizeType LocalSize = TDim * TNumNodes;
236 if (rLeftHandSideMatrix.size1() != LocalSize)
237 rLeftHandSideMatrix.
resize(LocalSize,LocalSize);
238 if (rRightHandSideVector.size() != LocalSize)
239 rRightHandSideVector.
resize(LocalSize);
246 this->
ApplyWallLaw(rLeftHandSideMatrix,rRightHandSideVector);
251 const SizeType LocalSize = TNumNodes;
253 if (rLeftHandSideMatrix.size1() != LocalSize)
254 rLeftHandSideMatrix.
resize(LocalSize,LocalSize);
255 if (rRightHandSideVector.size() != LocalSize)
256 rRightHandSideVector.
resize(LocalSize);
265 const unsigned int NumGauss = IntegrationPoints.size();
275 for (
unsigned int g = 0; g < NumGauss; g++)
276 GaussWeights[g] = 2.0*
A * IntegrationPoints[g].Weight();
278 for (
unsigned int g = 0; g < NumGauss; g++)
280 double Weight = GaussWeights[g];
283 for (
unsigned int iNode = 1; iNode < TNumNodes; ++iNode)
285 vgauss +=
N(iNode,g)*rGeom[iNode].FastGetSolutionStepValue(VELOCITY);
290 for (
unsigned int iNode = 0; iNode < TNumNodes; ++iNode)
292 rRightHandSideVector[iNode] -=
N(iNode,g)*Weight*aux;
326 if (rLeftHandSideMatrix.size1() != 0)
327 rLeftHandSideMatrix.
resize(0,0,
false);
329 if (rRightHandSideVector.size() != 0)
330 rRightHandSideVector.
resize(0,
false);
353 if(this->
GetGeometry()[
i].SolutionStepsDataHas(VELOCITY) ==
false)
355 if(this->
GetGeometry()[
i].SolutionStepsDataHas(MESH_VELOCITY) ==
false)
357 if(this->
GetGeometry()[
i].SolutionStepsDataHas(NORMAL) ==
false)
359 if(this->
GetGeometry()[
i].HasDofFor(VELOCITY_X) ==
false ||
360 this->
GetGeometry()[
i].HasDofFor(VELOCITY_Y) ==
false ||
382 const unsigned int LocalSize = TNumNodes;
385 const unsigned int NumGauss = IntegrationPoints.size();
392 double A = std::sqrt(Normal[0]*Normal[0]+Normal[1]*Normal[1]+Normal[2]*Normal[2]);
395 for (
unsigned int g = 0; g < NumGauss; g++)
396 GaussWeights[g] = 2.0*
A * IntegrationPoints[g].Weight();
398 for (
unsigned int g = 0; g < NumGauss; g++)
401 double Weight = GaussWeights[g];
422 double Density = 0.0;
424 for (
unsigned int i = 0;
i < TNumNodes;
i++)
431 double Proj = Vel[0]*Normal[0] + Vel[1]*Normal[1] + Vel[2]*Normal[2];
435 const double W = Weight*Density*Proj;
436 for (
unsigned int i = 0;
i < TNumNodes;
i++)
438 double row =
i*LocalSize;
439 for (
unsigned int j = 0;
j < TNumNodes;
j++)
441 double col =
j*LocalSize;
443 for (
unsigned int d = 0;
d < TDim;
d++)
445 double Tij = W*
N[
i]*
N[
j];
446 rLocalMatrix(
row+
d,col+
d) -= Tij;
447 rLocalVector[
row+
d] += Tij*rVel[
d];
463 const ProcessInfo& rCurrentProcessInfo)
const override;
472 const ProcessInfo& CurrentProcessInfo)
const override;
490 std::string
Info()
const override
492 std::stringstream buffer;
500 rOStream <<
"WallConditionDiscontinuous" << TDim <<
"D #" << this->
Id();
573 void save(
Serializer& rSerializer)
const override
627 template<
unsigned int TDim,
unsigned int TNumNodes >
635 template<
unsigned int TDim,
unsigned int TNumNodes >
640 rOStream << std::endl;
std::size_t SizeType
Definition: condition.h:94
GeometricalObject BaseType
base type: an GeometricalObject that automatically has a unique number
Definition: condition.h:71
std::vector< std::size_t > EquationIdVectorType
Definition: condition.h:98
std::vector< DofType::Pointer > DofsVectorType
Definition: condition.h:100
virtual int Check(const ProcessInfo &rCurrentProcessInfo) const
Definition: condition.h:854
Condition & operator=(Condition const &rOther)
Assignment operator.
Definition: condition.h:181
std::size_t IndexType
Definition: flags.h:74
bool Is(Flags const &rOther) const
Definition: flags.h:274
This defines the geometrical object, base definition of the element and condition entities.
Definition: geometrical_object.h:58
GeometryType::Pointer pGetGeometry()
Returns the pointer to the geometry.
Definition: geometrical_object.h:140
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
Geometry base class.
Definition: geometry.h:71
SizeType size() const
Definition: geometry.h:518
std::vector< IntegrationPointType > IntegrationPointsArrayType
Definition: geometry.h:161
const Matrix & ShapeFunctionsValues() const
Definition: geometry.h:3393
IndexType const & Id() const
Id of this Geometry.
Definition: geometry.h:964
const IntegrationPointsArrayType & IntegrationPoints() const
Definition: geometry.h:2284
This object defines an indexed object.
Definition: indexed_object.h:54
IndexType Id() const
Definition: indexed_object.h:107
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
This class defines the node.
Definition: node.h:65
TVariableType::Type & FastGetSolutionStepValue(const TVariableType &rThisVariable)
Definition: node.h:435
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
A sorted associative container similar to an STL set, but uses a vector to store pointers to its data...
Definition: pointer_vector_set.h:72
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
Implements a wall condition for the monolithic formulation.
Definition: wall_condition_discontinuous.h:96
Geometry< NodeType > GeometryType
Definition: wall_condition_discontinuous.h:108
Vector VectorType
Definition: wall_condition_discontinuous.h:112
~WallConditionDiscontinuous() override
Destructor.
Definition: wall_condition_discontinuous.h:181
WallConditionDiscontinuous(WallConditionDiscontinuous const &rOther)
Copy constructor.
Definition: wall_condition_discontinuous.h:175
PointerVectorSet< Dof< double >, IndexedObject > DofsArrayType
Definition: wall_condition_discontinuous.h:124
Condition::Pointer Create(IndexType NewId, Condition::GeometryType::Pointer pGeom, PropertiesType::Pointer pProperties) const override
Definition: wall_condition_discontinuous.h:213
Node NodeType
Definition: wall_condition_discontinuous.h:104
Properties PropertiesType
Definition: wall_condition_discontinuous.h:106
void GetDofList(DofsVectorType &ConditionDofList, const ProcessInfo &CurrentProcessInfo) const override
Returns a list of the element's Dofs.
std::vector< Dof< double >::Pointer > DofsVectorType
Definition: wall_condition_discontinuous.h:122
Geometry< NodeType >::PointsArrayType NodesArrayType
Definition: wall_condition_discontinuous.h:110
Matrix MatrixType
Definition: wall_condition_discontinuous.h:114
void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Calculate wall stress term for all nodes with SLIP set.
Definition: wall_condition_discontinuous.h:225
int Check(const ProcessInfo &rCurrentProcessInfo) const override
Check that all data required by this condition is available and reasonable.
Definition: wall_condition_discontinuous.h:336
std::size_t IndexType
Definition: wall_condition_discontinuous.h:116
WallConditionDiscontinuous(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Constructor using Properties.
Definition: wall_condition_discontinuous.h:167
Condition::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
Create a new WallConditionDiscontinuous object.
Definition: wall_condition_discontinuous.h:206
std::string Info() const override
Turn back information as a string.
Definition: wall_condition_discontinuous.h:490
void ApplyInflowCondition(MatrixType &rLocalMatrix, VectorType &rLocalVector)
Apply condition to prevent numerical problems due to flow into the domain in unexpected places.
Definition: wall_condition_discontinuous.h:377
WallConditionDiscontinuous(IndexType NewId, const NodesArrayType &ThisNodes)
Constructor using an array of nodes.
Definition: wall_condition_discontinuous.h:144
WallConditionDiscontinuous(IndexType NewId=0)
Default constructor.
Definition: wall_condition_discontinuous.h:134
std::vector< std::size_t > EquationIdVectorType
Definition: wall_condition_discontinuous.h:120
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: wall_condition_discontinuous.h:504
void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const override
Provides the global indices for each one of this element's local rows.
WallConditionDiscontinuous(IndexType NewId, GeometryType::Pointer pGeometry)
Constructor using Geometry.
Definition: wall_condition_discontinuous.h:155
WallConditionDiscontinuous & operator=(WallConditionDiscontinuous const &rOther)
Copy constructor.
Definition: wall_condition_discontinuous.h:189
std::size_t SizeType
Definition: wall_condition_discontinuous.h:118
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(WallConditionDiscontinuous)
Pointer definition of WallConditionDiscontinuous.
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: wall_condition_discontinuous.h:498
Implements a wall condition for the monolithic formulation.
Definition: wall_condition.h:98
void ApplyWallLaw(MatrixType &rLocalMatrix, VectorType &rLocalVector)
Commpute the wall stress and add corresponding terms to the system contributions.
Definition: wall_condition.h:561
void CalculateNormal(array_1d< double, 3 > &An)
#define KRATOS_THROW_ERROR(ExceptionType, ErrorMessage, MoreInfo)
Definition: define.h:77
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
TExpressionType::data_type norm_2(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression)
Definition: amatrix_interface.h:625
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
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::MatrixRow< const TExpressionType > row(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression, std::size_t RowIndex)
Definition: amatrix_interface.h:649
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
int step
Definition: face_heat.py:88
vgauss
Definition: generate_stokes_twofluid_element.py:52
def load(f)
Definition: ode_solve.py:307
int d
Definition: ode_solve.py:397
int j
Definition: quadrature.py:648
A
Definition: sensitivityMatrix.py:70
N
Definition: sensitivityMatrix.py:29
integer i
Definition: TensorModule.f:17