KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
|
This is a multigrid solver based on the AMGCL library. More...
#include <amgcl_mpi_solver.h>
Public Member Functions | |
Life Cycle | |
AmgclMPISolver (Parameters ThisParameters=Parameters(R"({})")) | |
This is the default constructor. More... | |
AmgclMPISolver (const AmgclMPISolver &Other)=delete | |
Copy constructor. More... | |
~AmgclMPISolver () override=default | |
Destructor. More... | |
Operators | |
AmgclMPISolver & | operator= (const AmgclMPISolver &Other)=delete |
Assignment operator. More... | |
Input and output | |
void | PrintInfo (std::ostream &rOStream) const override |
Print information about this object. More... | |
Public Member Functions inherited from Kratos::AMGCLSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > > | |
AMGCLSolver (Parameters ThisParameters=Parameters(R"({})")) | |
This is the default constructor. More... | |
AMGCLSolver (AMGCLSmoother Smoother, AMGCLIterativeSolverType Solver, double Tolerance, int MaxIterationsNumber, int Verbosity, int GMRESSize=50) | |
Default constructor - uses ILU+GMRES. More... | |
AMGCLSolver (AMGCLSmoother Smoother, AMGCLIterativeSolverType Solver, AMGCLCoarseningType Coarsening, double Tolerance, int MaxIterationsNumber, int Verbosity, int GMRESSize=50, bool ProvideCoordinates=false) | |
~AMGCLSolver () override | |
bool | Solve (SparseMatrixType &rA, VectorType &rX, VectorType &rB) override |
Normal solve method. More... | |
bool | Solve (SparseMatrixType &rA, DenseMatrixType &rX, DenseMatrixType &rB) override |
Multi solve method for solving a set of linear systems with same coefficient matrix. More... | |
virtual void | SetIterationsNumber (const IndexType IterationsNumber) |
This method sets the current iteration number. More... | |
virtual void | SetResidualNorm (const double ResidualNorm) |
This method sets the current residual norm. More... | |
IndexType | GetIterationsNumber () override |
This method returns the current iteration number. More... | |
virtual double | GetResidualNorm () |
This method returns the current residual norm. More... | |
bool | AdditionalPhysicalDataIsNeeded () override |
Some solvers may require a minimum degree of knowledge of the structure of the matrix. To make an example when solving a mixed u-p problem, it is important to identify the row associated to v and p. More... | |
void | ProvideAdditionalData (SparseMatrixType &rA, VectorType &rX, VectorType &rB, DofsArrayType &rDofSet, ModelPart &rModelPart) override |
Some solvers may require a minimum degree of knowledge of the structure of the matrix. More... | |
void | PrintInfo (std::ostream &rOStream) const override |
void | PrintData (std::ostream &rOStream) const override |
KRATOS_CLASS_POINTER_DEFINITION (AMGCLSolver) | |
Pointer definition of AMGCLSolver. More... | |
Public Member Functions inherited from Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > > | |
LinearSolver () | |
Default constructor. More... | |
LinearSolver (Reorderer< TSparseSpaceType, TDenseSpaceType > NewReorderer) | |
Constructor with specific reorderer. More... | |
LinearSolver (const LinearSolver &Other) | |
Copy constructor. More... | |
virtual | ~LinearSolver () |
Destructor. More... | |
LinearSolver & | operator= (const LinearSolver &Other) |
Assignment operator. More... | |
virtual void | Initialize (SparseMatrixType &rA, VectorType &rX, VectorType &rB) |
virtual void | InitializeSolutionStep (SparseMatrixType &rA, VectorType &rX, VectorType &rB) |
virtual void | PerformSolutionStep (SparseMatrixType &rA, VectorType &rX, VectorType &rB) |
virtual void | FinalizeSolutionStep (SparseMatrixType &rA, VectorType &rX, VectorType &rB) |
virtual void | Clear () |
virtual void | Solve (SparseMatrixType &K, SparseMatrixType &M, DenseVectorType &Eigenvalues, DenseMatrixType &Eigenvectors) |
virtual TReordererType::Pointer | GetReorderer () |
virtual void | SetReorderer (typename TReordererType::Pointer pNewReorderer) |
virtual void | SetTolerance (double NewTolerance) |
This method allows to set the tolerance in the linear solver. More... | |
virtual double | GetTolerance () |
This method allows to get the tolerance in the linear solver. More... | |
virtual bool | IsConsistent (SparseMatrixType &rA, VectorType &rX, VectorType &rB) |
This method checks if the dimensions of the system of equations are consistent. More... | |
virtual bool | IsConsistent (SparseMatrixType &rA, DenseMatrixType &rX, DenseMatrixType &rB) |
This method checks if the dimensions of the system of equations are consistent (dense matrix for RHS and unknowns version) More... | |
virtual bool | IsNotConsistent (SparseMatrixType &rA, VectorType &rX, VectorType &rB) |
This method checks if the dimensions of the system of equations are not consistent. More... | |
virtual bool | IsNotConsistent (SparseMatrixType &rA, DenseMatrixType &rX, DenseMatrixType &rB) |
This method checks if the dimensions of the system of equations are not consistent. More... | |
virtual std::string | Info () const |
Turn back information as a string. More... | |
KRATOS_CLASS_POINTER_DEFINITION (LinearSolver) | |
Pointer definition of LinearSolver. More... | |
Type Definitions | |
typedef TSparseSpaceType::MatrixType | SparseMatrixType |
The sparse matric type. More... | |
typedef TSparseSpaceType::VectorType | VectorType |
Vector type definition. More... | |
typedef TDenseSpaceType::MatrixType | DenseMatrixType |
Dense matrix type. More... | |
typedef ModelPart::DofsArrayType | DofsArrayType |
DofArray type. More... | |
typedef std::size_t | IndexType |
The index type definition. More... | |
typedef std::size_t | SizeType |
The size type definition. More... | |
KRATOS_CLASS_POINTER_DEFINITION (AmgclMPISolver) | |
Pointer definition of AmgclMPISolver. More... | |
Additional Inherited Members | |
Public Types inherited from Kratos::AMGCLSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > > | |
typedef LinearSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > > | BaseType |
The base class definition. More... | |
typedef TSparseSpaceType::MatrixType | SparseMatrixType |
The sparse matric type. More... | |
typedef TSparseSpaceType::VectorType | VectorType |
Vector type definition. More... | |
typedef TDenseSpaceType::MatrixType | DenseMatrixType |
Dense matrix type. More... | |
typedef ModelPart::DofsArrayType | DofsArrayType |
DofArray type. More... | |
typedef TSparseSpaceType::IndexType | IndexType |
The index type definition to be consistent. More... | |
typedef std::size_t | SizeType |
The size type definition. More... | |
Public Types inherited from Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > > | |
typedef TSparseSpaceType::MatrixType | SparseMatrixType |
typedef TSparseSpaceType::MatrixPointerType | SparseMatrixPointerType |
typedef TSparseSpaceType::VectorType | VectorType |
typedef TSparseSpaceType::VectorPointerType | VectorPointerType |
typedef TDenseSpaceType::MatrixType | DenseMatrixType |
typedef TDenseSpaceType::VectorType | DenseVectorType |
typedef std::size_t | SizeType |
typedef TSparseSpaceType::IndexType | IndexType |
The index type definition to be consistent. More... | |
Protected Member Functions inherited from Kratos::AMGCLSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > > | |
AMGCLSolver (const AMGCLSolver &Other) | |
AMGCLSolver & | operator= (const AMGCLSolver &Other) |
void | CheckIfSelectedOptionIsAvailable (const Parameters ThisParameters, const std::string &rOptionName, const std::set< std::string > &rAvailableOptions) |
void | SetSmootherType (const AMGCLSmoother SmootherType) |
This method sets the smother type to be considered. More... | |
void | SetIterativeSolverType (const AMGCLIterativeSolverType SolverType) |
This method sets the iterative solver to be considered. More... | |
void | SetCoarseningType (const AMGCLCoarseningType CoarseningType) |
This method sets the coarsening type to be considered. More... | |
Protected Attributes inherited from Kratos::AMGCLSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > > | |
double | mTolerance |
IndexType | mMaxIterationsNumber |
The tolerance considered. More... | |
int | mVerbosity |
The maximum number of iterations considered. More... | |
int | mBlockSize |
The versoisty level. More... | |
SizeType | mGMRESSize |
The size of the dof block. More... | |
SizeType | mCoarseEnough |
The size of the GMRES. More... | |
bool | mFallbackToGMRES |
The level of coarsening allowed. More... | |
bool | mProvideCoordinates |
Of consider GMRES as fallback (TODO: Local flag?) More... | |
bool | mUseBlockMatricesIfPossible |
If the coordinates are provided (TODO: Local flag?) More... | |
bool | mUseGPGPU |
If use the bloack matrices if possible (TODO: Local flag?) More... | |
std::vector< array_1d< double, 3 > > | mCoordinates |
Use GPGPU if available. More... | |
boost::property_tree::ptree | mAMGCLParameters |
The vector containing the local coordinates. More... | |
double | mResidualNorm |
The configuration parameters of the AMGCl. More... | |
IndexType | mIterationsNumber |
The current residual norm. More... | |
bool | mUseAMGPreconditioning |
The current iteration number. More... | |
This is a multigrid solver based on the AMGCL library.
Created by Denis Deminov: https://github.com/ddemidov/amgcl AMGCL is a header-only C++ library for solving large sparse linear systems with algebraic multigrid (AMG) method. AMG is one of the most effective iterative methods for solution of equation systems arising, for example, from discretizing PDEs on unstructured grids. The method can be used as a black-box solver for various computational problems, since it does not require any information about the underlying geometry. AMG is often used not as a standalone solver but as a preconditioner within an iterative solver (e.g. Conjugate Gradients, BiCGStab, or GMRES). AMGCL builds the AMG hierarchy on a CPU and then transfers it to one of the provided backends. This allows for transparent acceleration of the solution phase with help of OpenCL, CUDA, or OpenMP technologies. Users may provide their own backends which enables tight integration between AMGCL and the user code.
typedef TDenseSpaceType::MatrixType Kratos::AmgclMPISolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::DenseMatrixType |
Dense matrix type.
typedef ModelPart::DofsArrayType Kratos::AmgclMPISolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::DofsArrayType |
DofArray type.
typedef std::size_t Kratos::AmgclMPISolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::IndexType |
The index type definition.
typedef std::size_t Kratos::AmgclMPISolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::SizeType |
The size type definition.
typedef TSparseSpaceType::MatrixType Kratos::AmgclMPISolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::SparseMatrixType |
The sparse matric type.
typedef TSparseSpaceType::VectorType Kratos::AmgclMPISolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::VectorType |
Vector type definition.
|
inline |
This is the default constructor.
ThisParameters | The configuration parameters |
|
delete |
Copy constructor.
|
overridedefault |
Destructor.
Kratos::AmgclMPISolver< TSparseSpaceType, TDenseSpaceType, TReordererType >::KRATOS_CLASS_POINTER_DEFINITION | ( | AmgclMPISolver< TSparseSpaceType, TDenseSpaceType, TReordererType > | ) |
Pointer definition of AmgclMPISolver.
|
delete |
Assignment operator.
|
inlineoverridevirtual |
Print information about this object.
Reimplemented from Kratos::LinearSolver< TSparseSpaceType, TDenseSpaceType, Reorderer< TSparseSpaceType, TDenseSpaceType > >.