59 template<
class TSparseSpace,
136 typename TLinearSolver::Pointer pNewLinearSystemSolver,
169 typename TLinearSolver::Pointer pNewLinearSystemSolver,
173 return Kratos::make_shared<ClassType>(pNewLinearSystemSolver,ThisParameters);
268 typename TSchemeType::Pointer pScheme,
282 typename TSchemeType::Pointer pScheme,
297 typename TSchemeType::Pointer pScheme,
313 typename TSchemeType::Pointer pScheme,
328 typename TSchemeType::Pointer pScheme,
359 typename TSchemeType::Pointer pScheme,
378 typename TSchemeType::Pointer pScheme,
386 KRATOS_ERROR <<
"No special implementation available for "
387 <<
"BuildAndSolveLinearizedOnPreviousIteration "
388 <<
" please use UseOldStiffnessInFirstIterationFlag=false in the settings of the strategy "
401 typename TSchemeType::Pointer pScheme,
420 typename TSchemeType::Pointer pScheme,
437 typename TSchemeType::Pointer pScheme,
453 typename TSchemeType::Pointer pScheme,
468 typename TSchemeType::Pointer pScheme,
483 typename TSchemeType::Pointer pScheme,
498 typename TSchemeType::Pointer pScheme,
537 typename TSchemeType::Pointer pScheme,
587 typename TSchemeType::Pointer pScheme,
632 "name" : "builder_and_solver",
635 return default_parameters;
644 return "builder_and_solver";
685 KRATOS_ERROR <<
"GetConstraintRelationMatrix is not implemented in base BuilderAndSolver" << std::endl;
694 KRATOS_ERROR <<
"GetConstraintConstantVector is not implemented in base BuilderAndSolver" << std::endl;
706 virtual std::string
Info()
const
708 return "BuilderAndSolver";
773 return ThisParameters;
Current class provides an implementation for the base builder and solving operations.
Definition: builder_and_solver.h:64
ModelPart::DofType TDofType
Definition of the DoF class.
Definition: builder_and_solver.h:103
std::size_t IndexType
Definition of the index type.
Definition: builder_and_solver.h:76
virtual std::string Info() const
Turn back information as a string.
Definition: builder_and_solver.h:706
void SetReshapeMatrixFlag(bool ReshapeMatrixFlag)
This method sets the flag mReshapeMatrixFlag.
Definition: builder_and_solver.h:229
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: builder_and_solver.h:712
bool mDofSetIsInitialized
If the matrix is reshaped each step.
Definition: builder_and_solver.h:743
PointerVectorSet< Element, IndexedObject > ElementsContainerType
The definition of the element container type.
Definition: builder_and_solver.h:114
virtual void BuildLHS_CompleteOnFreeRows(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &rA)
It builds a rectangular matrix of size n*N where "n" is the number of unrestrained degrees of freedom...
Definition: builder_and_solver.h:312
virtual void FinalizeSolutionStep(ModelPart &rModelPart, TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb)
It applies certain operations at the system of equations at the end of the solution step.
Definition: builder_and_solver.h:569
TSparseSpace::VectorType TSystemVectorType
Definition of the vector size.
Definition: builder_and_solver.h:85
virtual void InitializeSolutionStep(ModelPart &rModelPart, TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb)
It applies certain operations at the system of equations at the beginning of the solution step.
Definition: builder_and_solver.h:553
bool mReshapeMatrixFlag
The set containing the DoF of the system.
Definition: builder_and_solver.h:741
ModelPart::NodesContainerType NodesArrayType
The containers of the entities.
Definition: builder_and_solver.h:109
virtual void ResizeAndInitializeVectors(typename TSchemeType::Pointer pScheme, TSystemMatrixPointerType &pA, TSystemVectorPointerType &pDx, TSystemVectorPointerType &pb, ModelPart &rModelPart)
This method initializes and resizes the system of equations.
Definition: builder_and_solver.h:536
void SetLinearSystemSolver(typename TLinearSolver::Pointer pLinearSystemSolver)
This method sets the linear solver to be used.
Definition: builder_and_solver.h:256
bool GetCalculateReactionsFlag() const
This method returns the flag mCalculateReactionsFlag.
Definition: builder_and_solver.h:184
TSparseSpace::MatrixType TSystemMatrixType
Definition of the sparse matrix.
Definition: builder_and_solver.h:82
virtual void ApplyDirichletConditions_LHS(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &rA, TSystemVectorType &rDx)
The same of the precedent but affecting only the LHS.
Definition: builder_and_solver.h:436
virtual void ApplyRHSConstraints(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemVectorType &rb)
Applies the constraints with master-slave relation matrix (RHS only)
Definition: builder_and_solver.h:467
virtual int Check(ModelPart &rModelPart)
This function is designed to be called once to perform all the checks needed on the input provided....
Definition: builder_and_solver.h:616
virtual void BuildRHS(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemVectorType &rb)
Function to perform the build of the RHS. The vector could be sized as the total number of dofs or as...
Definition: builder_and_solver.h:281
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: builder_and_solver.h:718
ModelPart::ConditionsContainerType ConditionsArrayType
Definition: builder_and_solver.h:111
virtual TSparseSpace::MatrixType & GetConstraintRelationMatrix()
This method returns constraint relation (T) matrix.
Definition: builder_and_solver.h:683
static std::string Name()
Returns the name of the class as used in the settings (snake_case format)
Definition: builder_and_solver.h:642
KRATOS_CLASS_POINTER_DEFINITION(BuilderAndSolver)
Pointer definition of BuilderAndSolver.
virtual void BuildAndSolve(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb)
Function to perform the building and solving phase at the same time.
Definition: builder_and_solver.h:358
virtual void AssignSettings(const Parameters ThisParameters)
This method assigns settings to member variables.
Definition: builder_and_solver.h:780
TSystemVectorPointerType mpReactionsVector
Definition: builder_and_solver.h:751
virtual void BuildRHSAndSolve(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb)
Corresponds to the previews, but the System's matrix is considered already built and only the RHS is ...
Definition: builder_and_solver.h:400
Scheme< TSparseSpace, TDenseSpace > TSchemeType
Definition of the scheme type.
Definition: builder_and_solver.h:100
BuilderAndSolver(typename TLinearSolver::Pointer pNewLinearSystemSolver, Parameters ThisParameters)
Default constructor with Parameters.
Definition: builder_and_solver.h:135
virtual const DofsArrayType & GetDofSet() const
It allows to get the list of Dofs from the element.
Definition: builder_and_solver.h:515
virtual void BuildAndSolveLinearizedOnPreviousIteration(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb, const bool MoveMesh)
Function to perform the building and solving phase at the same time Linearizing with the database at ...
Definition: builder_and_solver.h:377
virtual Parameters ValidateAndAssignParameters(Parameters ThisParameters, const Parameters DefaultParameters) const
This method validate and assign default parameters.
Definition: builder_and_solver.h:767
virtual TSparseSpace::VectorType & GetConstraintConstantVector()
This method returns constraint constant vector.
Definition: builder_and_solver.h:692
virtual void ApplyDirichletConditions(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb)
It applies the dirichlet conditions. This operation may be very heavy or completely unexpensive depen...
Definition: builder_and_solver.h:419
virtual ClassType::Pointer Create(typename TLinearSolver::Pointer pNewLinearSystemSolver, Parameters ThisParameters) const
Create method.
Definition: builder_and_solver.h:168
ModelPart::DofsArrayType DofsArrayType
Definition of the DoF array type.
Definition: builder_and_solver.h:106
virtual void Clear()
This function is intended to be called at the end of the solution step to clean up memory storage not...
Definition: builder_and_solver.h:600
virtual void SetUpSystem(ModelPart &rModelPart)
It organises the dofset in order to speed up the building phase.
Definition: builder_and_solver.h:524
bool GetDofSetIsInitializedFlag() const
This method returns the flag mDofSetIsInitialized.
Definition: builder_and_solver.h:202
bool GetReshapeMatrixFlag() const
This method returns the flag mReshapeMatrixFlag.
Definition: builder_and_solver.h:220
void SetCalculateReactionsFlag(bool flag)
This method sets the flag mCalculateReactionsFlag.
Definition: builder_and_solver.h:193
virtual void BuildLHS(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &rA)
Function to perform the building of the LHS, depending on the implementation chosen the size of the m...
Definition: builder_and_solver.h:267
BuilderAndSolver< TSparseSpace, TDenseSpace, TLinearSolver > ClassType
The definition of the current class.
Definition: builder_and_solver.h:70
TDenseSpace::MatrixType LocalSystemMatrixType
The local matrix definition.
Definition: builder_and_solver.h:94
TSparseSpace::VectorPointerType TSystemVectorPointerType
Definition of the pointer to the vector.
Definition: builder_and_solver.h:91
TSparseSpace::DataType TDataType
Definition of the data type.
Definition: builder_and_solver.h:79
TLinearSolver::Pointer mpLinearSystemSolver
Definition: builder_and_solver.h:737
void SetEchoLevel(int Level)
It sets the level of echo for the solving strategy.
Definition: builder_and_solver.h:665
virtual void ApplyDirichletConditions_RHS(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemVectorType &rDx, TSystemVectorType &rb)
The same of the precedent but affecting only the RHS.
Definition: builder_and_solver.h:452
int mEchoLevel
Number of degrees of freedom of the problem to be solve.
Definition: builder_and_solver.h:749
virtual void Build(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &rA, TSystemVectorType &rb)
equivalent (but generally faster) then performing BuildLHS and BuildRHS
Definition: builder_and_solver.h:296
BuilderAndSolver(typename TLinearSolver::Pointer pNewLinearSystemSolver)
Default constructor.
Definition: builder_and_solver.h:152
void SetDofSetIsInitializedFlag(bool DofSetIsInitialized)
This method sets the flag mDofSetIsInitialized.
Definition: builder_and_solver.h:211
TLinearSolver::Pointer GetLinearSystemSolver() const
This method return the linear solver used.
Definition: builder_and_solver.h:247
DofsArrayType mDofSet
Pointer to the linear solver.
Definition: builder_and_solver.h:739
virtual void SystemSolve(TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb)
This is a call to the linear system solver.
Definition: builder_and_solver.h:341
TDenseSpace::VectorType LocalSystemVectorType
The local vector definition.
Definition: builder_and_solver.h:97
unsigned int GetEquationSystemSize() const
This method returns the value mEquationSystemSize.
Definition: builder_and_solver.h:238
virtual void ApplyConstraints(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &rA, TSystemVectorType &rb)
Applies the constraints with master-slave relation matrix.
Definition: builder_and_solver.h:482
virtual ~BuilderAndSolver()
Definition: builder_and_solver.h:159
virtual void SetUpDofSet(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart)
Builds the list of the DofSets involved in the problem by "asking" to each element and condition its ...
Definition: builder_and_solver.h:497
TSparseSpace::MatrixPointerType TSystemMatrixPointerType
Definition of the pointer to the sparse matrix.
Definition: builder_and_solver.h:88
std::size_t SizeType
Definition of the size type.
Definition: builder_and_solver.h:73
bool mCalculateReactionsFlag
Flag taking care if the dof set was initialized ot not.
Definition: builder_and_solver.h:745
int GetEchoLevel() const
It returns the echo level.
Definition: builder_and_solver.h:674
BuilderAndSolver()
Default constructor.
Definition: builder_and_solver.h:126
virtual DofsArrayType & GetDofSet()
It allows to get the list of Dofs from the element.
Definition: builder_and_solver.h:507
virtual Parameters GetDefaultParameters() const
This method provides the defaults parameters to avoid conflicts between the different constructors.
Definition: builder_and_solver.h:628
unsigned int mEquationSystemSize
Flag taking in account if it is needed or not to calculate the reactions.
Definition: builder_and_solver.h:747
ModelPart::ElementsContainerType ElementsArrayType
Definition: builder_and_solver.h:110
virtual void BuildLHS_Complete(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &rA)
It builds a matrix of size N*N where "N" is the total number of degrees of freedom involved.
Definition: builder_and_solver.h:327
virtual void CalculateReactions(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb)
It computes the reactions of the system.
Definition: builder_and_solver.h:586
Dof represents a degree of freedom (DoF).
Definition: dof.h:86
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MeshType::ConditionsContainerType ConditionsContainerType
Condintions container. A vector set of Conditions with their Id's as key.
Definition: model_part.h:183
MeshType::ElementsContainerType ElementsContainerType
Element container. A vector set of Elements with their Id's as key.
Definition: model_part.h:168
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
int GetInt() const
This method returns the integer contained in the current Parameter.
Definition: kratos_parameters.cpp:666
void ValidateAndAssignDefaults(const Parameters &rDefaultParameters)
This function is designed to verify that the parameters under testing match the form prescribed by th...
Definition: kratos_parameters.cpp:1306
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
This class provides the implementation of the basic tasks that are needed by the solution strategy.
Definition: scheme.h:56
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_ERROR
Definition: exception.h:161
#define KRATOS_INFO_IF(label, conditional)
Definition: logger.h:251
void MoveMesh(Scheme< SparseSpaceType, LocalSpaceType > &dummy, ModelPart::NodesContainerType &rNodes)
Definition: add_strategies_to_python.cpp:175
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21