22 #include <amgcl/backend/builtin.hpp>
23 #include <amgcl/adapter/zero_copy.hpp>
24 #include <amgcl/value_type/complex.hpp>
25 #include <amgcl/solver/skyline_lu.hpp>
33 #if !defined(KRATOS_SKYLINE_LU_CUSTOM_SCALAR_SOLVER_H_INCLUDED)
34 #define KRATOS_SKYLINE_LU_CUSTOM_SCALAR_SOLVER_H_INCLUDED
41 template <
class TSparseSpaceType,
class TDenseSpaceType,
class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType>>
43 :
public DirectSolver<TSparseSpaceType, TDenseSpaceType, TReordererType>
54 typedef typename TSparseSpaceType::DataType
DataType;
61 :
DirectSolver<TSparseSpaceType, TDenseSpaceType, TReordererType>()
66 :
DirectSolver<TSparseSpaceType, TDenseSpaceType, TReordererType>(rParam)
79 pBuiltinMatrix = amgcl::adapter::zero_copy(
81 rA.index1_data().begin(),
82 rA.index2_data().begin(),
83 rA.value_data().begin());
85 pSolver = Kratos::make_shared<SolverType>(*pBuiltinMatrix);
90 std::vector<DataType>
x(rX.size());
91 std::vector<DataType>
b(rB.size());
93 std::copy(std::begin(rB),
std::end(rB), std::begin(
b));
97 std::copy(std::begin(
x),
std::end(
x), std::begin(rX));
117 pBuiltinMatrix.reset();
122 rOStream <<
"Skyline LU custom scalar solver";
138 template<
class TSparseSpaceType,
class TDenseSpaceType,
class TReordererType>
145 template<
class TSparseSpaceType,
class TDenseSpaceType,
class TReordererType>
149 rOStream << std::endl;
Definition: direct_solver.h:48
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: direct_solver.h:79
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
Definition: skyline_lu_custom_scalar_solver.h:44
SkylineLUCustomScalarSolver()
Definition: skyline_lu_custom_scalar_solver.h:60
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: skyline_lu_custom_scalar_solver.h:120
TSparseSpaceType::DataType DataType
Definition: skyline_lu_custom_scalar_solver.h:54
~SkylineLUCustomScalarSolver() override
Definition: skyline_lu_custom_scalar_solver.h:70
void Clear() override
Definition: skyline_lu_custom_scalar_solver.h:114
KRATOS_CLASS_POINTER_DEFINITION(SkylineLUCustomScalarSolver)
bool Solve(SparseMatrixType &rA, VectorType &rX, VectorType &rB) override
Definition: skyline_lu_custom_scalar_solver.h:100
amgcl::solver::skyline_lu< DataType > SolverType
Definition: skyline_lu_custom_scalar_solver.h:58
SkylineLUCustomScalarSolver(Parameters &rParam)
Definition: skyline_lu_custom_scalar_solver.h:65
void FinalizeSolutionStep(SparseMatrixType &rA, VectorType &rX, VectorType &rB) override
Definition: skyline_lu_custom_scalar_solver.h:109
void InitializeSolutionStep(SparseMatrixType &rA, VectorType &rX, VectorType &rB) override
Definition: skyline_lu_custom_scalar_solver.h:75
TDenseSpaceType::MatrixType DenseMatrixType
Definition: skyline_lu_custom_scalar_solver.h:52
void PerformSolutionStep(SparseMatrixType &rA, VectorType &rX, VectorType &rB) override
Definition: skyline_lu_custom_scalar_solver.h:88
amgcl::backend::builtin< DataType >::matrix BuiltinMatrixType
Definition: skyline_lu_custom_scalar_solver.h:56
TSparseSpaceType::VectorType VectorType
Definition: skyline_lu_custom_scalar_solver.h:50
TSparseSpaceType::MatrixType SparseMatrixType
Definition: skyline_lu_custom_scalar_solver.h:48
end
Definition: DEM_benchmarks.py:180
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::shared_ptr< T > shared_ptr
Definition: smart_pointers.h:27
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
x
Definition: sensitivityMatrix.py:49