10 #if !defined(KRATOS_SOLUTION_BUILDER_AND_SOLVER_H_INCLUDED)
11 #define KRATOS_SOLUTION_BUILDER_AND_SOLVER_H_INCLUDED
58 template<
class TSparseSpace,
96 this->
Set(LocalFlagType::DOFS_INITIALIZED,
false);
105 this->
Set(LocalFlagType::DOFS_INITIALIZED,
false);
317 KRATOS_INFO(
"Builder and Solver Cleared") <<
"Clear Function called" << std::endl;
413 KRATOS_INFO(
"Dx") <<
"Solution = " << rDx << std::endl;
414 KRATOS_INFO(
"RHS") <<
"Vector = " << rb << std::endl;
418 KRATOS_INFO(
"LHS") <<
"Matrix = " << rA << std::endl;
419 KRATOS_INFO(
"Dx") <<
"Solution = " << rDx << std::endl;
420 KRATOS_INFO(
"RHS") <<
"Vector = " << rb << std::endl;
425 unsigned int iteration_number = 0;
427 iteration_number = rModelPart.
GetProcessInfo()[NL_ITERATION_NUMBER];
429 std::stringstream matrix_market_name;
430 matrix_market_name <<
"A_" << rModelPart.
GetProcessInfo()[TIME] <<
"_" << iteration_number <<
".mm";
433 std::stringstream matrix_market_vectname;
434 matrix_market_vectname <<
"b_" << rModelPart.
GetProcessInfo()[TIME] <<
"_" << iteration_number <<
".mm.rhs";
bool Has(const Variable< TDataType > &rThisVariable) const
Checks if the data container has a value associated with a given variable.
Definition: data_value_container.h:382
void Set(const Flags ThisFlag)
Definition: flags.cpp:33
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
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
void clear()
Clear the set, removing all elements.
Definition: pointer_vector_set.h:663
Solution Buider and Solver base class.
Definition: solution_builder_and_solver.hpp:63
unsigned int mEquationSystemSize
Definition: solution_builder_and_solver.hpp:479
virtual void Clear()
This function is intended to be called at the end of the solution step to clean up memory storage not...
Definition: solution_builder_and_solver.hpp:305
virtual void SetUpDofSet(SchemePointerType pScheme, ModelPart &rModelPart)
Builds the list of the DofSets involved in the problem by "asking" to each element and condition its ...
Definition: solution_builder_and_solver.hpp:240
TSparseSpace::MatrixPointerType SystemMatrixPointerType
Definition: solution_builder_and_solver.hpp:78
virtual void BuildRHS(SchemePointerType pScheme, ModelPart &rModelPart, SystemVectorType &rb)
Function to perform the build of the RHS.
Definition: solution_builder_and_solver.hpp:138
SolutionScheme< TSparseSpace, TDenseSpace > SchemeType
Definition: solution_builder_and_solver.hpp:84
SystemVectorPointerType mpReactionsVector
Definition: solution_builder_and_solver.hpp:485
Flags & GetOptions()
Get strategy options.
Definition: solution_builder_and_solver.hpp:373
SolverLocalFlags LocalFlagType
Definition: solution_builder_and_solver.hpp:72
void SetOptions(Flags &rOptions)
Sets strategy options.
Definition: solution_builder_and_solver.hpp:364
SolutionBuilderAndSolver()
Default Constructor.
Definition: solution_builder_and_solver.hpp:94
virtual void CalculateReactions(SchemePointerType pScheme, ModelPart &rModelPart, SystemMatrixType &rA, SystemVectorType &rDx, SystemVectorType &rb)
Calculates system reactions.
Definition: solution_builder_and_solver.hpp:294
unsigned int GetEquationSystemSize()
Get size of the system.
Definition: solution_builder_and_solver.hpp:346
LinearSolverPointerType GetLinearSystemSolver()
Get linear solver.
Definition: solution_builder_and_solver.hpp:355
virtual DofsArrayType & GetDofSet()
Allows to get the list of system Dofs.
Definition: solution_builder_and_solver.hpp:446
TSparseSpace::VectorType SystemVectorType
Definition: solution_builder_and_solver.hpp:76
TDenseSpace::VectorType LocalSystemVectorType
Definition: solution_builder_and_solver.hpp:82
TSparseSpace::MatrixType SystemMatrixType
Definition: solution_builder_and_solver.hpp:75
ModelPart::DofsArrayType DofsArrayType
Definition: solution_builder_and_solver.hpp:74
Flags mOptions
Definition: solution_builder_and_solver.hpp:476
virtual void FinalizeSolutionStep(SchemePointerType pScheme, ModelPart &rModelPart, SystemMatrixPointerType &pA, SystemVectorPointerType &pDx, SystemVectorPointerType &pb)
Performs all the required operations that should be done (for each step) after solving the solution s...
Definition: solution_builder_and_solver.hpp:281
virtual void InitializeSolutionStep(SchemePointerType pScheme, ModelPart &rModelPart, SystemMatrixPointerType &pA, SystemVectorPointerType &pDx, SystemVectorPointerType &pb)
Performs all the required operations that should be done (for each step) before solving the solution ...
Definition: solution_builder_and_solver.hpp:269
SolutionBuilderAndSolver(LinearSolverPointerType pLinearSystemSolver)
Constructor.
Definition: solution_builder_and_solver.hpp:103
virtual void SetEchoLevel(const int Level)
This sets the level of echo for the builder and solver.
Definition: solution_builder_and_solver.hpp:390
virtual void SystemSolve(SystemMatrixType &rA, SystemVectorType &rDx, SystemVectorType &rb)
This is a call to the linear system solver.
Definition: solution_builder_and_solver.hpp:158
virtual void Build(SchemePointerType pScheme, ModelPart &rModelPart, SystemMatrixType &rA, SystemVectorType &rb)
Function to perform the building of the LHS and RHS.
Definition: solution_builder_and_solver.hpp:148
virtual void SetUpSystemMatrices(SchemePointerType pScheme, ModelPart &rModelPart, SystemMatrixPointerType &pA, SystemVectorPointerType &pDx, SystemVectorPointerType &pb)
Resizes and Initializes the system vectors and matrices after SetUpDofSet and SetUpSytem has been cal...
Definition: solution_builder_and_solver.hpp:256
DofsArrayType mDofSet
Definition: solution_builder_and_solver.hpp:473
TDenseSpace::MatrixType LocalSystemMatrixType
Definition: solution_builder_and_solver.hpp:81
TLinearSolver::Pointer LinearSolverPointerType
Definition: solution_builder_and_solver.hpp:87
virtual void ApplyDirichletConditions(SchemePointerType pScheme, ModelPart &rModelPart, SystemMatrixType &rA, SystemVectorType &rDx, SystemVectorType &rb)
applies the dirichlet conditions.
Definition: solution_builder_and_solver.hpp:196
virtual int GetEchoLevel()
Definition: solution_builder_and_solver.hpp:395
virtual void EchoInfo(ModelPart &rModelPart, SystemMatrixType &rA, SystemVectorType &rDx, SystemVectorType &rb)
This method returns the components of the system of equations depending of the echo level.
Definition: solution_builder_and_solver.hpp:404
~SolutionBuilderAndSolver() override
Destructor.
Definition: solution_builder_and_solver.hpp:112
TSparseSpace::VectorPointerType SystemVectorPointerType
Definition: solution_builder_and_solver.hpp:79
LinearSolverPointerType mpLinearSystemSolver
Definition: solution_builder_and_solver.hpp:470
virtual void BuildLHS(SchemePointerType pScheme, ModelPart &rModelPart, SystemMatrixType &rA)
Function to perform the building of the LHS,.
Definition: solution_builder_and_solver.hpp:128
int mEchoLevel
Definition: solution_builder_and_solver.hpp:482
virtual void BuildRHSAndSolve(SchemePointerType pScheme, ModelPart &rModelPart, SystemMatrixType &rA, SystemVectorType &rDx, SystemVectorType &rb)
Function to perform the building of the RHS and solving phase at the same time.
Definition: solution_builder_and_solver.hpp:181
virtual void BuildAndSolve(SchemePointerType pScheme, ModelPart &rModelPart, SystemMatrixType &rA, SystemVectorType &rDx, SystemVectorType &rb)
Function to perform the building and solving phase at the same time.
Definition: solution_builder_and_solver.hpp:169
virtual int Check(ModelPart &rModelPart)
Definition: solution_builder_and_solver.hpp:329
KRATOS_CLASS_POINTER_DEFINITION(SolutionBuilderAndSolver)
Pointer definition of SolutionBuilderAndSolver.
SchemeType::Pointer SchemePointerType
Definition: solution_builder_and_solver.hpp:85
virtual void SetUpSystem()
organises the dofset in order to speed up the building phase
Definition: solution_builder_and_solver.hpp:248
Solution scheme base class.
Definition: solution_scheme.hpp:54
Solver local flags class definition.
Definition: solution_local_flags.hpp:48
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_INFO(label)
Definition: logger.h:250
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
bool WriteMatrixMarketVector(const char *FileName, VectorType &V)
Definition: matrix_market_interface.h:539
bool WriteMatrixMarketMatrix(const char *FileName, CompressedMatrixType &M, bool Symmetric)
Definition: matrix_market_interface.h:308