1 #ifndef KRATOS_TRILINOS_STOKES_INITIALIZATION_PROCESS_H
2 #define KRATOS_TRILINOS_STOKES_INITIALIZATION_PROCESS_H
7 #include "Epetra_MpiComm.h"
18 #include "../FluidDynamicsApplication/custom_processes/stokes_initialization_process.h"
50 template<
class TSparseSpace,
71 typename TLinearSolver::Pointer pLinearSolver,
72 unsigned int DomainSize,
74 BaseType(rModelPart,pLinearSolver,DomainSize,this),
100 pStokesMPIComm->LocalMesh().SetNodes( rReferenceComm.
LocalMesh().
pNodes() );
102 pStokesMPIComm->GhostMesh().SetNodes( rReferenceComm.
GhostMesh().
pNodes() );
105 pStokesMPIComm->pInterfaceMesh(
i)->SetNodes( rReferenceComm.
pInterfaceMesh(
i)->pNodes() );
106 pStokesMPIComm->pLocalMesh(
i)->SetNodes( rReferenceComm.
pLocalMesh(
i)->pNodes() );
107 pStokesMPIComm->pGhostMesh(
i)->SetNodes( rReferenceComm.
pGhostMesh(
i)->pNodes() );
112 std::string ElementName;
113 if (BaseDomainSize == 2)
114 ElementName = std::string(
"StationaryStokes2D");
116 ElementName = std::string(
"StationaryStokes3D");
121 for (ModelPart::ElementsContainerType::iterator itElem = rReferenceModelPart.
ElementsBegin(); itElem != rReferenceModelPart.
ElementsEnd(); itElem++)
123 Element::Pointer pElem = rReferenceElement.
Create(itElem->Id(), itElem->GetGeometry(), itElem->pGetProperties() );
124 rStokesModelPart.
Elements().push_back(pElem);
129 auto pScheme = Kratos::make_shared< ResidualBasedIncrementalUpdateStaticScheme< TSparseSpace, TDenseSpace > >();
133 if(BaseDomainSize == 2)
138 auto pBuildAndSolver = Kratos::make_shared<TrilinosBlockBuilderAndSolverPeriodic<TSparseSpace,TDenseSpace,TLinearSolver> >(
146 bool ReactionFlag =
false;
147 bool ReformDofSetFlag =
false;
148 bool CalculateNormDxFlag =
false;
149 bool MoveMeshFlag =
false;
151 pSolutionStrategy = Kratos::make_shared< ResidualBasedLinearStrategy<TSparseSpace, TDenseSpace, TLinearSolver> >(
162 pSolutionStrategy->
Check();
203 std::string
Info()
const override
205 std::stringstream buffer;
206 buffer <<
" TrilinosStokesInitializationProcess";
214 rOStream <<
" TrilinosStokesInitializationProcess";
334 template<
class TSparseSpace,
346 template<
class TSparseSpace,
354 rOStream << std::endl;
The Commmunicator class manages communication for distributed ModelPart instances.
Definition: communicator.h:67
NeighbourIndicesContainerType & NeighbourIndices()
Definition: communicator.cpp:162
MeshType & GhostMesh()
Returns the reference to the mesh storing all ghost entities.
Definition: communicator.cpp:251
MeshType::Pointer pInterfaceMesh()
Returns pointer to the mesh storing all interface entities.
Definition: communicator.cpp:191
SizeType GetNumberOfColors() const
Definition: communicator.cpp:121
MeshType::Pointer pLocalMesh()
Returns pointer to the mesh storing all local entities.
Definition: communicator.cpp:179
MeshType & InterfaceMesh()
Returns the reference to the mesh storing all interface entities.
Definition: communicator.cpp:257
MeshType & LocalMesh()
Returns the reference to the mesh storing all local entities.
Definition: communicator.cpp:245
MeshType::Pointer pGhostMesh()
Returns pointer to the mesh storing all ghost entities.
Definition: communicator.cpp:185
Base class for all Elements.
Definition: element.h:60
virtual Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const
It creates a new element pointer.
Definition: element.h:202
Implicit solving strategy base class This is the base class from which we will derive all the implici...
Definition: implicit_solving_strategy.h:61
static const TComponentType & Get(const std::string &rName)
Retrieves a component with the specified name.
Definition: kratos_components.h:114
NodesContainerType::Pointer pNodes()
Definition: mesh.h:356
ElementsContainerType & Elements()
Definition: mesh.h:568
ModelPart & CreateModelPart(const std::string &ModelPartName, IndexType NewBufferSize=1)
This method creates a new model part contained in the current Model with a given name and buffer size...
Definition: model.cpp:37
void DeleteModelPart(const std::string &ModelPartName)
This method deletes a modelpart with a given name.
Definition: model.cpp:64
bool HasModelPart(const std::string &rFullModelPartName) const
This method checks if a certain a model part exists given a certain name.
Definition: model.cpp:178
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ElementIterator ElementsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1169
void SetCommunicator(Communicator::Pointer pNewCommunicator)
Definition: model_part.h:1836
void SetNodes(NodesContainerType::Pointer pOtherNodes, IndexType ThisIndex=0)
Definition: model_part.h:522
void SetProcessInfo(ProcessInfo::Pointer pNewProcessInfo)
Definition: model_part.h:1766
void SetProperties(PropertiesContainerType::Pointer pOtherProperties, IndexType ThisIndex=0)
Definition: model_part.h:1013
ProcessInfo::Pointer pGetProcessInfo()
Definition: model_part.h:1756
Communicator & GetCommunicator()
Definition: model_part.h:1821
void SetBufferSize(IndexType NewBufferSize)
This method sets the suffer size of the model part database.
Definition: model_part.cpp:2171
NodesContainerType::Pointer pNodes(IndexType ThisIndex=0)
Definition: model_part.h:517
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
PropertiesContainerType::Pointer pProperties(IndexType ThisIndex=0)
Definition: model_part.h:1008
ElementIterator ElementsEnd(IndexType ThisIndex=0)
Definition: model_part.h:1179
Model & GetModel()
Definition: model_part.h:323
VariablesList & GetNodalSolutionStepVariablesList()
Definition: model_part.h:549
void push_back(TPointerType x)
Adds a pointer to the end of the set.
Definition: pointer_vector_set.h:544
virtual void SetEchoLevel(const int Level)
This sets the level of echo for the solving strategy.
Definition: solving_strategy.h:255
virtual int Check()
Function to perform expensive checks.
Definition: solving_strategy.h:377
A process to provide initial values for Navier-Stokes problems.
Definition: stokes_initialization_process.h:58
ImplicitSolvingStrategy< TSparseSpace, TDenseSpace, TLinearSolver >::Pointer mpSolutionStrategy
Definition: stokes_initialization_process.h:248
TLinearSolver::Pointer mpLinearSolver
Definition: stokes_initialization_process.h:244
ModelPart & mrReferenceModelPart
Definition: stokes_initialization_process.h:242
bool mIsCleared
Definition: stokes_initialization_process.h:250
unsigned int mDomainSize
Definition: stokes_initialization_process.h:246
A process to provide initial values for Navier-Stokes problems.
Definition: trilinos_stokes_initialization_process.h:55
std::string Info() const override
Turn back information as a string.
Definition: trilinos_stokes_initialization_process.h:203
TrilinosStokesInitializationProcess(Epetra_MpiComm &rComm, ModelPart &rModelPart, typename TLinearSolver::Pointer pLinearSolver, unsigned int DomainSize, const Variable< int > &PeriodicPairIndicesVar)
Definition: trilinos_stokes_initialization_process.h:69
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: trilinos_stokes_initialization_process.h:219
StokesInitializationProcess< TSparseSpace, TDenseSpace, TLinearSolver > BaseType
Definition: trilinos_stokes_initialization_process.h:63
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: trilinos_stokes_initialization_process.h:212
Epetra_MpiComm & mrComm
Definition: trilinos_stokes_initialization_process.h:240
const Variable< int > & mrPeriodicVar
Definition: trilinos_stokes_initialization_process.h:242
virtual ~TrilinosStokesInitializationProcess()
Destructor.
Definition: trilinos_stokes_initialization_process.h:171
KRATOS_CLASS_POINTER_DEFINITION(TrilinosStokesInitializationProcess)
Pointer definition of TrilinosStokesInitializationProcess.
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
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
integer i
Definition: TensorModule.f:17