13 #if !defined(KRATOS_FRACTIONAL_STEP_H_INCLUDED )
14 #define KRATOS_FRACTIONAL_STEP_H_INCLUDED
63 template<
unsigned int TDim >
146 Element(NewId, pGeometry, pProperties)
172 Element::PropertiesType::Pointer pProperties)
const override
174 return Kratos::make_intrusive< FractionalStep<TDim> >(NewId, this->
GetGeometry().
Create(ThisNodes), pProperties);
185 Element::Pointer
Create(
IndexType NewId, Element::GeometryType::Pointer pGeom, Element::PropertiesType::Pointer pProperties)
const override
187 return Kratos::make_intrusive< FractionalStep<TDim> >(NewId, pGeom, pProperties);
202 pNewElement->SetData(this->
GetData());
203 pNewElement->SetFlags(this->
GetFlags());
226 KRATOS_THROW_ERROR(std::logic_error,
"FractionalStep::CalculateLeftHandSide not implemented",
"");
234 KRATOS_THROW_ERROR(std::logic_error,
"FractionalStep::CalculateRightHandSide not implemented",
"");
267 const ProcessInfo& rCurrentProcessInfo)
const override;
275 const ProcessInfo& rCurrentProcessInfo)
const override;
299 std::vector<double>& rValues,
313 this->GetElementalValueForOutput< array_1d<double,6> >(rVariable,rValues);
324 std::vector<Vector>& rValues,
327 this->GetElementalValueForOutput< Vector >(rVariable,rValues);
338 std::vector<Matrix>& rValues,
341 this->GetElementalValueForOutput< Matrix >(rVariable,rValues);
375 std::string
Info()
const override
377 std::stringstream buffer;
378 buffer <<
"FractionalStep #" <<
Id();
385 rOStream <<
"FractionalStep" << TDim <<
"D";
443 const int Step = 0)
const ;
446 const int Step = 0)
const ;
498 const double Weight);
502 const double Density,
503 const Vector& rConvOperator,
505 const double OldPressure,
509 const double MassProjection,
512 const double Weight);
516 const double Weight);
542 const double Density,
543 const double Viscosity,
550 const double Weight);
557 const double Weight);
562 const double Weight);
594 template<
class TVariableType >
602 rResult = rShapeFunc[0] * rGeom[0].FastGetSolutionStepValue(Var);
606 rResult += rShapeFunc[
i] * rGeom[
i].FastGetSolutionStepValue(Var);
620 template<
class TVariableType >
629 rResult = rShapeFunc[0] * rGeom[0].FastGetSolutionStepValue(Var,Step);
633 rResult += rShapeFunc[
i] * rGeom[
i].FastGetSolutionStepValue(Var,Step);
644 const double& var = rGeom[0].FastGetSolutionStepValue(Var);
646 rResult[
d] = rDN_DX(0,
d) * var;
650 const double& var = rGeom[
i].FastGetSolutionStepValue(Var);
652 rResult[
d] += rDN_DX(
i,
d) * var;
670 rResult += rDN_DX(
i,
d) * var[
d];
680 template<
class TValueType>
682 std::vector<TValueType>& rOutput)
685 rOutput.resize(NumValues);
693 const TValueType& Val = const_this->
GetValue(rVariable);
695 for (
unsigned int i = 0;
i < NumValues;
i++)
730 void save(
Serializer& rSerializer)
const override
786 template<
unsigned int TDim >
794 template<
unsigned int TDim >
799 rOStream << std::endl;
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Base class for all Elements.
Definition: element.h:60
std::size_t SizeType
Definition: element.h:94
std::vector< DofType::Pointer > DofsVectorType
Definition: element.h:100
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: element.h:1135
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
PropertiesType::Pointer pGetProperties()
returns the pointer to the property of the element. Does not throw an error, to allow copying of elem...
Definition: element.h:1014
std::size_t IndexType
Definition: flags.h:74
A stabilized element for the incompressible Navier-Stokes equations.
Definition: fractional_step.h:65
void CalculateEndOfStepSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: fractional_step.cpp:723
Vector VectorType
Vector type for local contributions to the linear system.
Definition: fractional_step.h:83
std::vector< std::size_t > EquationIdVectorType
Definition: fractional_step.h:92
double EquivalentStrainRate(const ShapeFunctionDerivativesType &rDN_DX) const
EquivalentStrainRate Calculate the second invariant of the strain rate tensor GammaDot = (2SijSij)^0....
Definition: fractional_step.cpp:1167
void InitializeNonLinearIteration(const ProcessInfo &rCurrentProcessInfo) override
Definition: fractional_step.cpp:24
void CalculateOnIntegrationPoints(const Variable< array_1d< double, 3 > > &rVariable, std::vector< array_1d< double, 3 > > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Obtain an array_1d<double,3> elemental variable, evaluated on gauss points.
Definition: fractional_step.cpp:300
int Check(const ProcessInfo &rCurrentProcessInfo) const override
Checks the input and that all required Kratos variables have been registered.
Definition: fractional_step.cpp:796
virtual void CalculateLocalFractionalVelocitySystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: fractional_step.cpp:508
virtual double EffectiveViscosity(double Density, const ShapeFunctionsType &rN, const ShapeFunctionDerivativesType &rDN_DX, double ElemSize, const ProcessInfo &rProcessInfo)
EffectiveViscosity Calculate the viscosity at given integration point, using Smagorinsky if enabled.
Definition: fractional_step.cpp:1144
std::size_t SizeType
Definition: fractional_step.h:90
GeometryData::IntegrationMethod GetIntegrationMethod() const override
Definition: fractional_step.cpp:294
const Parameters GetSpecifications() const override
This method provides the specifications/requirements of the element.
Definition: fractional_step.cpp:843
PointerVectorSet< Dof< double >, IndexedObject > DofsArrayType
Definition: fractional_step.h:96
GeometryType::ShapeFunctionsGradientsType ShapeFunctionDerivativesArrayType
Type for an array of shape function gradient matrices.
Definition: fractional_step.h:105
void GetVelocityValues(Vector &rValues, const int Step=0) const
void InitializeSolutionStep(const ProcessInfo &rCurrentProcessInfo) override
Initializes the element and all geometric information required for the problem.
Definition: fractional_step.cpp:19
void VelocityEquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const
FractionalStep(IndexType NewId, const NodesArrayType &ThisNodes)
Constructor using an array of nodes.
Definition: fractional_step.h:126
void AddMomentumMassTerm(Matrix &rMassMatrix, const ShapeFunctionsType &rN, const double Weight)
Add integration point contribution to the mass matrix.
Definition: fractional_step.cpp:1194
void GetPressureDofList(DofsVectorType &rElementalDofList, const ProcessInfo &rCurrentProcessInfo) const
Definition: fractional_step.cpp:979
Kratos::Vector ShapeFunctionsType
Type for shape function values container.
Definition: fractional_step.h:99
Geometry< NodeType >::PointsArrayType NodesArrayType
Definition of nodes container type, redefined from GeometryType.
Definition: fractional_step.h:80
void EvaluateGradientInPoint(array_1d< double, TDim > &rResult, const Kratos::Variable< double > &Var, const ShapeFunctionDerivativesType &rDN_DX)
Definition: fractional_step.h:637
FractionalStep(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Constuctor using geometry and properties.
Definition: fractional_step.h:145
void PressureEquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const
Definition: fractional_step.cpp:922
double ElementSize()
Definition: fractional_step.cpp:1099
void EvaluateInPoint(TVariableType &rResult, const Kratos::Variable< TVariableType > &Var, const ShapeFunctionsType &rShapeFunc)
Write the value of a variable at a point inside the element to a double.
Definition: fractional_step.h:595
void CalculateOnIntegrationPoints(const Variable< array_1d< double, 6 > > &rVariable, std::vector< array_1d< double, 6 > > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Obtain an array_1d<double,6> elemental variable, evaluated on gauss points.
Definition: fractional_step.h:308
void CalculateOnIntegrationPoints(const Variable< Matrix > &rVariable, std::vector< Matrix > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Obtain a Matrix elemental variable, evaluated on gauss points.
Definition: fractional_step.h:336
void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Calculate the element's local contribution to the system for the current step.
Definition: fractional_step.cpp:30
void GetDofList(DofsVectorType &rElementalDofList, const ProcessInfo &rCurrentProcessInfo) const override
Returns a list of the element's Dofs.
Definition: fractional_step.cpp:262
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: fractional_step.h:383
virtual void EvaluateConvVelocity(array_1d< double, 3 > &rConvVel, const ShapeFunctionsType &N)
Evaluate ALE convective velocity (velocity-mesh velocity) at a given point.
Definition: fractional_step.cpp:1591
Node NodeType
Node type (default is: Node)
Definition: fractional_step.h:74
Element::Pointer Clone(IndexType NewId, NodesArrayType const &rThisNodes) const override
Definition: fractional_step.h:198
virtual void CalculateGeometryData(ShapeFunctionDerivativesArrayType &rDN_DX, Matrix &rNContainer, Vector &rGaussWeights)
Determine integration point weights and shape funcition derivatives from the element's geometry.
Definition: fractional_step.cpp:1054
void CalculateLeftHandSide(MatrixType &rLeftHandSideMatrix, const ProcessInfo &rCurrentProcessInfo) override
Definition: fractional_step.h:222
virtual void CalculateLocalPressureSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: fractional_step.cpp:609
void AddViscousTerm(MatrixType &rDampingMatrix, const ShapeFunctionDerivativesType &rShapeDeriv, const double Weight)
std::string Info() const override
Turn back information as a string.
Definition: fractional_step.h:375
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(FractionalStep)
Pointer definition of FractionalStep.
void Initialize(const ProcessInfo &rCurrentProcessInfo) override
Definition: fractional_step.cpp:14
void Calculate(const Variable< double > &rVariable, double &rOutput, const ProcessInfo &rCurrentProcessInfo) override
Definition: fractional_step.cpp:65
void CalculateOnIntegrationPoints(const Variable< Vector > &rVariable, std::vector< Vector > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Obtain a Vector elemental variable, evaluated on gauss points.
Definition: fractional_step.h:322
Element::Pointer Create(IndexType NewId, Element::GeometryType::Pointer pGeom, Element::PropertiesType::Pointer pProperties) const override
Definition: fractional_step.h:185
virtual void CalculateProjectionRHS(VectorType &rMomentumRHS, VectorType &rMassRHS, const ShapeFunctionsType &rN, const ShapeFunctionDerivativesType &rDN_DX, const double Weight)
Definition: fractional_step.cpp:1382
void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: fractional_step.h:230
virtual void CalculateTau(double &TauOne, double &TauTwo, double ElemSize, const array_1d< double, 3 > &rAdvVel, const double Density, const double Viscosity, const ProcessInfo &rCurrentProcessInfo)
Calculate Stabilization parameters.
Definition: fractional_step.cpp:1357
~FractionalStep() override
Destructor.
Definition: fractional_step.h:150
void EvaluateDivergenceInPoint(double &rResult, const Kratos::Variable< array_1d< double, 3 > > &Var, const ShapeFunctionDerivativesType &rDN_DX)
Definition: fractional_step.h:657
void GetPressureValues(Vector &rValues, const int Step=0) const
Definition: fractional_step.cpp:997
void GetVelocityDofList(DofsVectorType &rElementalDofList, const ProcessInfo &rCurrentProcessInfo) const
FractionalStep(IndexType NewId=0)
Default constuctor.
Definition: fractional_step.h:117
void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const override
Provides the global indices for each one of this element's local rows.
Definition: fractional_step.cpp:230
std::size_t IndexType
Definition: fractional_step.h:88
void ConvectionOperator(Vector &rResult, const array_1d< double, 3 > &rConvVel, const ShapeFunctionDerivativesType &DN_DX)
Write the convective operator evaluated at this point (for each nodal funciton) to an array.
Definition: fractional_step.cpp:1574
void EvaluateInPoint(TVariableType &rResult, const Kratos::Variable< TVariableType > &Var, const ShapeFunctionsType &rShapeFunc, const IndexType Step)
Write the value of a variable at a point inside the element to a double.
Definition: fractional_step.h:621
std::vector< Dof< double >::Pointer > DofsVectorType
Definition: fractional_step.h:94
void GetElementalValueForOutput(const Kratos::Variable< TValueType > &rVariable, std::vector< TValueType > &rOutput)
Helper function to print results on gauss points.
Definition: fractional_step.h:681
Kratos::Matrix ShapeFunctionDerivativesType
Type for a matrix containing the shape function gradients.
Definition: fractional_step.h:102
Matrix MatrixType
Matrix type for local contributions to the linear system.
Definition: fractional_step.h:86
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, Element::PropertiesType::Pointer pProperties) const override
Create a new element of this type.
Definition: fractional_step.h:171
void ModulatedGradientDiffusion(MatrixType &rDampingMatrix, const ShapeFunctionDerivativesType &rDN_DX, const double Weight)
Definition: fractional_step.cpp:1476
virtual void AddMomentumSystemTerms(Matrix &rLHSMatrix, Vector &rRHSVector, const double Density, const Vector &rConvOperator, const array_1d< double, 3 > &rBodyForce, const double OldPressure, const double TauOne, const double TauTwo, const array_1d< double, 3 > &rMomentumProjection, const double MassProjection, const ShapeFunctionsType &rN, const ShapeFunctionDerivativesType &rDN_DX, const double Weight)
Definition: fractional_step.cpp:1218
Geometry< NodeType > GeometryType
Geometry type (using with given NodeType)
Definition: fractional_step.h:77
FractionalStep(IndexType NewId, GeometryType::Pointer pGeometry)
Constructor using a geometry object.
Definition: fractional_step.h:135
TVariableType::Type & GetValue(const TVariableType &rThisVariable)
Definition: geometrical_object.h:248
Flags & GetFlags()
Returns the flags of the object.
Definition: geometrical_object.h:176
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
DataValueContainer & GetData()
Definition: geometrical_object.h:212
IntegrationMethod
Definition: geometry_data.h:76
Geometry base class.
Definition: geometry.h:71
SizeType PointsNumber() const
Definition: geometry.h:528
virtual Pointer Create(PointsArrayType const &rThisPoints) const
Creates a new geometry pointer.
Definition: geometry.h:813
SizeType IntegrationPointsNumber() const
Definition: geometry.h:2257
This object defines an indexed object.
Definition: indexed_object.h:54
IndexType Id() const
Definition: indexed_object.h:107
This class defines the node.
Definition: node.h:65
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
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
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
#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
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
def load(f)
Definition: ode_solve.py:307
int d
Definition: ode_solve.py:397
N
Definition: sensitivityMatrix.py:29
integer i
Definition: TensorModule.f:17