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.
|
A class template for handling data types, matrices, and vectors in a Ublas space. More...
#include <ublas_space.h>
Public Member Functions | |
Life Cycle | |
UblasSpace () | |
Default constructor. More... | |
virtual | ~UblasSpace () |
Destructor. More... | |
Static Public Member Functions | |
Operations | |
static MatrixPointerType | CreateEmptyMatrixPointer () |
static VectorPointerType | CreateEmptyVectorPointer () |
static IndexType | Size (VectorType const &rV) |
return size of vector rV More... | |
static IndexType | Size1 (MatrixType const &rM) |
return number of rows of rM More... | |
static IndexType | Size2 (MatrixType const &rM) |
return number of columns of rM More... | |
template<typename TColumnType > | |
static void | GetColumn (unsigned int j, Matrix &rM, TColumnType &rX) |
rXi = rMij More... | |
template<typename TColumnType > | |
static void | SetColumn (unsigned int j, Matrix &rM, TColumnType &rX) |
static void | Copy (MatrixType const &rX, MatrixType &rY) |
rY = rX More... | |
static void | Copy (VectorType const &rX, VectorType &rY) |
rY = rX More... | |
static TDataType | Dot (VectorType const &rX, VectorType const &rY) |
rX * rY More... | |
static TDataType | TwoNorm (VectorType const &rX) |
||rX||2 More... | |
static TDataType | TwoNorm (const Matrix &rA) |
static TDataType | TwoNorm (const compressed_matrix< TDataType > &rA) |
static TDataType | JacobiNorm (const Matrix &rA) |
static TDataType | JacobiNorm (const compressed_matrix< TDataType > &rA) |
static void | Mult (const Matrix &rA, VectorType &rX, VectorType &rY) |
static void | Mult (const compressed_matrix< TDataType > &rA, VectorType &rX, VectorType &rY) |
template<class TOtherMatrixType > | |
static void | TransposeMult (TOtherMatrixType &rA, VectorType &rX, VectorType &rY) |
static SizeType | GraphDegree (IndexType i, TMatrixType &A) |
static void | GraphNeighbors (IndexType i, TMatrixType &A, std::vector< IndexType > &neighbors) |
static void | InplaceMult (VectorType &rX, const double A) |
static void | Assign (VectorType &rX, const double A, const VectorType &rY) |
static void | UnaliasedAdd (VectorType &rX, const double A, const VectorType &rY) |
static void | ScaleAndAdd (const double A, const VectorType &rX, const double B, const VectorType &rY, VectorType &rZ) |
static void | ScaleAndAdd (const double A, const VectorType &rX, const double B, VectorType &rY) |
static double | RowDot (unsigned int i, MatrixType &rA, VectorType &rX) |
rA[i] * rX More... | |
static void | SetValue (VectorType &rX, IndexType i, TDataType value) |
static void | Set (VectorType &rX, TDataType A) |
rX = A More... | |
static void | Resize (MatrixType &rA, SizeType m, SizeType n) |
static void | Resize (MatrixPointerType &pA, SizeType m, SizeType n) |
static void | Resize (VectorType &rX, SizeType n) |
static void | Resize (VectorPointerType &pX, SizeType n) |
static void | Clear (MatrixPointerType &pA) |
static void | Clear (VectorPointerType &pX) |
template<class TOtherMatrixType > | |
static void | ResizeData (TOtherMatrixType &rA, SizeType m) |
static void | ResizeData (compressed_matrix< TDataType > &rA, SizeType m) |
static void | ResizeData (VectorType &rX, SizeType m) |
template<class TOtherMatrixType > | |
static void | SetToZero (TOtherMatrixType &rA) |
static void | SetToZero (compressed_matrix< TDataType > &rA) |
static void | SetToZero (VectorType &rX) |
template<class TOtherMatrixType , class TEquationIdVectorType > | |
static void | AssembleLHS (MatrixType &A, TOtherMatrixType &LHS_Contribution, TEquationIdVectorType &EquationId) |
static double | CheckAndCorrectZeroDiagonalValues (const ProcessInfo &rProcessInfo, MatrixType &rA, VectorType &rb, const SCALING_DIAGONAL ScalingDiagonal=SCALING_DIAGONAL::NO_SCALING) |
This method checks and corrects the zero diagonal values. More... | |
static double | GetScaleNorm (const ProcessInfo &rProcessInfo, const MatrixType &rA, const SCALING_DIAGONAL ScalingDiagonal=SCALING_DIAGONAL::NO_SCALING) |
This method returns the scale norm considering for scaling the diagonal. More... | |
static double | GetDiagonalNorm (const MatrixType &rA) |
This method returns the diagonal norm considering for scaling the diagonal. More... | |
static double | GetAveragevalueDiagonal (const MatrixType &rA) |
This method returns the diagonal max value. More... | |
static double | GetMaxDiagonal (const MatrixType &rA) |
This method returns the diagonal max value. More... | |
static double | GetMinDiagonal (const MatrixType &rA) |
This method returns the diagonal min value. More... | |
Type Definitions | |
using | DataType = TDataType |
The data type considered. More... | |
using | MatrixType = TMatrixType |
The matrix type considered. More... | |
using | VectorType = TVectorType |
The vector type considered. More... | |
using | IndexType = std::size_t |
The index type considered. More... | |
using | SizeType = std::size_t |
The size type considered. More... | |
using | MatrixPointerType = typename Kratos::shared_ptr< TMatrixType > |
The pointer to the matrix type. More... | |
using | VectorPointerType = typename Kratos::shared_ptr< TVectorType > |
The pointer to the vector type. More... | |
using | DofUpdaterType = DofUpdater< UblasSpace< TDataType, TMatrixType, TVectorType > > |
The DoF updater type. More... | |
using | DofUpdaterPointerType = typename DofUpdaterType::UniquePointer |
The pointer to the DoF updater type. More... | |
KRATOS_CLASS_POINTER_DEFINITION (UblasSpace) | |
Pointer definition of UblasSpace. More... | |
Input and output | |
virtual std::string | Info () const |
Turn back information as a string. More... | |
virtual void | PrintInfo (std::ostream &rOStream) const |
Print information about this object. More... | |
virtual void | PrintData (std::ostream &rOStream) const |
Print object's data. More... | |
static constexpr bool | IsDistributed () |
static TDataType | GetValue (const VectorType &x, std::size_t I) |
static void | GatherValues (const VectorType &x, const std::vector< std::size_t > &IndexArray, TDataType *pValues) |
template<class TOtherMatrixType > | |
static bool | WriteMatrixMarketMatrix (const char *pFileName, TOtherMatrixType &rM, const bool Symmetric) |
template<class VectorType > | |
static bool | WriteMatrixMarketVector (const char *pFileName, const VectorType &rV) |
static DofUpdaterPointerType | CreateDofUpdater () |
static constexpr bool | IsDistributedSpace () |
Check if the UblasSpace is distributed. More... | |
A class template for handling data types, matrices, and vectors in a Ublas space.
This class template is designed to work with different data types, matrix types, and vector types within a Ublas space. It provides typedefs and utilities for managing these types effectively.
TDataType | The data type used in the Ublas space. |
TMatrixType | The matrix type used in the Ublas space. |
TVectorType | The vector type used in the Ublas space. |
using Kratos::UblasSpace< TDataType, TMatrixType, TVectorType >::DataType = TDataType |
The data type considered.
using Kratos::UblasSpace< TDataType, TMatrixType, TVectorType >::DofUpdaterPointerType = typename DofUpdaterType::UniquePointer |
The pointer to the DoF updater type.
using Kratos::UblasSpace< TDataType, TMatrixType, TVectorType >::DofUpdaterType = DofUpdater<UblasSpace<TDataType, TMatrixType, TVectorType> > |
The DoF updater type.
using Kratos::UblasSpace< TDataType, TMatrixType, TVectorType >::IndexType = std::size_t |
The index type considered.
using Kratos::UblasSpace< TDataType, TMatrixType, TVectorType >::MatrixPointerType = typename Kratos::shared_ptr<TMatrixType> |
The pointer to the matrix type.
using Kratos::UblasSpace< TDataType, TMatrixType, TVectorType >::MatrixType = TMatrixType |
The matrix type considered.
using Kratos::UblasSpace< TDataType, TMatrixType, TVectorType >::SizeType = std::size_t |
The size type considered.
using Kratos::UblasSpace< TDataType, TMatrixType, TVectorType >::VectorPointerType = typename Kratos::shared_ptr<TVectorType> |
The pointer to the vector type.
using Kratos::UblasSpace< TDataType, TMatrixType, TVectorType >::VectorType = TVectorType |
The vector type considered.
|
inline |
Default constructor.
|
inlinevirtual |
Destructor.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
This method checks and corrects the zero diagonal values.
This method returns the scale norm considering for scaling the diagonal
rProcessInfo | The problem process info |
rA | The LHS matrix |
rb | The RHS vector |
ScalingDiagonal | The type of caling diagonal considered |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
rY = rX
|
inlinestatic |
rY = rX
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
rX * rY
|
inlinestatic |
|
inlinestatic |
This method returns the diagonal max value.
rA | The LHS matrix |
|
inlinestatic |
rXi = rMij
|
inlinestatic |
This method returns the diagonal norm considering for scaling the diagonal.
rA | The LHS matrix |
|
inlinestatic |
This method returns the diagonal max value.
rA | The LHS matrix |
|
inlinestatic |
This method returns the diagonal min value.
rA | The LHS matrix |
|
inlinestatic |
This method returns the scale norm considering for scaling the diagonal.
rProcessInfo | The problem process info |
rA | The LHS matrix |
ScalingDiagonal | The type of caling diagonal considered |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinevirtual |
Turn back information as a string.
|
inlinestatic |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
Check if the UblasSpace is distributed.
This static member function checks whether the UblasSpace is distributed or not.
|
inlinestatic |
|
inlinestatic |
This method computes the Jacobi norm
rA | The matrix to compute the Jacobi norm |
Kratos::UblasSpace< TDataType, TMatrixType, TVectorType >::KRATOS_CLASS_POINTER_DEFINITION | ( | UblasSpace< TDataType, TMatrixType, TVectorType > | ) |
Pointer definition of UblasSpace.
|
inlinestatic |
|
inlinestatic |
|
inlinevirtual |
Print object's data.
|
inlinevirtual |
Print information about this object.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
rA[i] * rX
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
rX = A
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
return size of vector rV
|
inlinestatic |
return number of rows of rM
|
inlinestatic |
return number of columns of rM
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
||rX||2
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |