10 #if !defined(KRATOS_EIGEN_DENSE_DIRECT_SOLVER_H_INCLUDED)
11 #define KRATOS_EIGEN_DENSE_DIRECT_SOLVER_H_INCLUDED
29 class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
31 :
public DirectSolver<TSparseSpaceType, TDenseSpaceType, TReordererType>
49 typedef typename TSparseSpaceType::DataType
DataType;
73 Eigen::Map<Kratos::EigenDynamicMatrix<DataType>>
A(rA.data().begin(), rA.size1(), rA.size2());
75 const bool success = m_solver.Compute(
A);
89 Eigen::Map<Kratos::EigenDynamicVector<DataType>>
x(rX.data().begin(), rX.size());
90 Eigen::Map<Kratos::EigenDynamicVector<DataType>>
b(rB.data().begin(), rB.size());
92 const bool success = m_solver.Solve(
b,
x);
94 KRATOS_ERROR_IF(!success) <<
"Solving failed!\n" << m_solver.GetSolverErrorMessages() << std::endl;
123 Eigen::Map<Kratos::EigenDynamicMatrix<DataType>>
X(rX.data().begin(), rX.size1(), rX.size2());
124 Eigen::Map<Kratos::EigenDynamicMatrix<DataType>>
B(rB.data().begin(), rB.size1(), rB.size2());
126 const bool success = m_solver.SolveMultiple(
B,
X);
128 KRATOS_ERROR_IF(!success) <<
"Solving failed!\n" << m_solver.GetSolverErrorMessages() << std::endl;
138 m_solver.PrintInfo(rOStream);
159 class TSparseSpaceType,
160 class TDenseSpaceType,
161 class TReordererType>
163 std::istream &rIStream,
174 class TSparseSpaceType,
175 class TDenseSpaceType,
179 std::ostream &rOStream,
183 rOStream << std::endl;
Here we add the functions needed for the registration of dense linear solvers.
Definition: dense_linear_solver_factory.h:56
Definition: direct_solver.h:48
Definition: eigen_dense_direct_solver.h:32
EigenDenseDirectSolver()
Definition: eigen_dense_direct_solver.h:53
bool Solve(MatrixType &rA, VectorType &rX, VectorType &rB) override
Definition: eigen_dense_direct_solver.h:104
KRATOS_CLASS_POINTER_DEFINITION(EigenDenseDirectSolver)
TSparseSpaceType::VectorType VectorType
Definition: eigen_dense_direct_solver.h:47
void PerformSolutionStep(MatrixType &rA, VectorType &rX, VectorType &rB) override
Definition: eigen_dense_direct_solver.h:87
void InitializeSolutionStep(MatrixType &rA, VectorType &rX, VectorType &rB) override
Definition: eigen_dense_direct_solver.h:71
static DenseLinearSolverFactory< TSparseSpaceType, TDenseSpaceType, EigenDenseDirectSolver > Factory()
Definition: eigen_dense_direct_solver.h:148
DirectSolver< TSparseSpaceType, TDenseSpaceType, TReordererType > BaseType
Definition: eigen_dense_direct_solver.h:43
void PrintInfo(std::ostream &rOStream) const override
Definition: eigen_dense_direct_solver.h:136
TSparseSpaceType::DataType DataType
Definition: eigen_dense_direct_solver.h:49
bool Solve(MatrixType &rA, MatrixType &rX, MatrixType &rB) override
Definition: eigen_dense_direct_solver.h:118
~EigenDenseDirectSolver() override
Definition: eigen_dense_direct_solver.h:60
EigenDenseDirectSolver(Parameters settings)
Definition: eigen_dense_direct_solver.h:55
TSparseSpaceType::MatrixType MatrixType
Definition: eigen_dense_direct_solver.h:45
TDenseSpaceType::MatrixType DenseMatrixType
Definition: eigen_dense_direct_solver.h:51
void PrintData(std::ostream &rOStream) const override
Definition: eigen_dense_direct_solver.h:144
TSparseSpaceType::VectorType VectorType
Definition: linear_solver.h:77
virtual void Initialize(SparseMatrixType &rA, VectorType &rX, VectorType &rB)
Definition: linear_solver.h:131
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
@ Local
Definition: traits.h:20
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
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
dummy
Definition: script.py:194
A
Definition: sensitivityMatrix.py:70
x
Definition: sensitivityMatrix.py:49
B
Definition: sensitivityMatrix.py:76