A bit more search let to the fact that the SuperLu-MT solver is also available in Trilinos-Ameso2 package (see
https://docs.trilinos.org/latest-release/packages/amesos2/doc/html/classAmesos2_1_1Superlumt.html#a102812eafbb572475b7330b825809b09).
The current code uses dealii::SparseMatrix<double> and dealii::Vector<double> objects to store the system matrix and, the solution and rhs vectors respectively.
In order to test it out, my idea was to use a dealii::TrilinosWrappers::SparseMatrix (which would be reinit from the already assembled dealii::SparseMatrix) and then extract the underlying matrix (using the TrilinosWrappers::SparseMatrix::trilinos_matrix() function) for use with the Superlu-MT solver. This works fine.
For the vectors (solution & rhs), the idea was to copy the values from the dealii::Vector to dealii::LinearAlgebra::EpetraWrappers::Vector. As an intermediate step I first copy the dealii::Vector to dealii::LinearAlgebra::Vector<doule> using the constructor :
https://www.dealii.org/current/doxygen/deal.II/classLinearAlgebra_1_1Vector.html#af441b2c23134f8e6e08c833f918888a2. This works fine. However, when I try to call dealii::LinearAlgebra::EpetraWrappers::Vector::reinit(dealii::LinearAlgebra::Vector<doule>) the following error occurs:
An error occurred in line <85> of file </opt/spack/var/spack/stage/dealii-9.0.1-ssxm6qr7mlmymdmjssazlr4s32qar5cv/dealii-9.0.1/source/lac/trilinos_epetra_vector.cc> in function
virtual void dealii::LinearAlgebra::EpetraWrappers::Vector::reinit(const dealii::LinearAlgebra::VectorSpaceVector<double>&, bool)
The violated condition was:
dynamic_cast<const Vector *>(&V)!=nullptr
Additional information:
(none)
Stacktrace:
-----------
#0 /opt/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.3.0/dealii-9.0.1-ssxm6qr7mlmymdmjssazlr4s32qar5cv/lib/libdeal_II.g.so.9.0.1: dealii::LinearAlgebra::EpetraWrappers::Vector::reinit(dealii::LinearAlgebra::VectorSpaceVector<double> const&, bool)
#1 /calculate/Paras_Work/PhD_Work/FRASCAL-CODE/MNC-Frac/_build/libmncfrac.so: std::pair<unsigned int, double> mncfrac::Solve_linearEquationSystem<2u, double>(mncfrac::LinearAlgebraItems<double>&, mncfrac::buildingblocks::inputreader::LinearSolverParameters const&, dealii::Vector<double>&)
#2 ./variants/homogenization: mncfrac::homogenization::RVE<2u, double>::Solve_timeStep(dealii::Tensor<2, 2, double> const&, mncfrac::utilities::BoundaryConditionType const&, dealii::Vector<double>&)
#3 ./variants/homogenization: mncfrac::homogenization::RVE<2u, double>::Homogenize(dealii::Tensor<2, 2, double> const&, mncfrac::utilities::BoundaryConditionType)
#4 ./variants/homogenization: main
I could not understand why does the conversion fails? Could you please help me understand where am I doing wrong. Any better alternatives you would suggest?
It is clear that copying matrices and vectors for each solver call is probably not very efficient, but this is just for trying out the solver.
Best regards,
Paras