52#ifndef AMESOS2_MUMPS_DECL_HPP
53#define AMESOS2_MUMPS_DECL_HPP
56#include "Amesos2_SolverCore.hpp"
83template <
class Matrix,
class Vector>
84class MUMPS :
public SolverCore<Amesos2::MUMPS, Matrix, Vector>
86 friend class SolverCore<Amesos2::MUMPS,Matrix,Vector>;
94 typedef MUMPS<Matrix,Vector> type;
95 typedef
SolverCore<Amesos2::MUMPS,Matrix,Vector> super_type;
98 typedef typename super_type::scalar_type scalar_type;
99 typedef typename super_type::local_ordinal_type local_ordinal_type;
100 typedef typename super_type::global_ordinal_type global_ordinal_type;
101 typedef typename super_type::global_size_type global_size_type;
103 typedef
TypeMap<Amesos2::MUMPS,scalar_type> type_map;
105 typedef typename type_map::type mumps_type;
106 typedef typename type_map::magnitude_type magnitude_type;
107 typedef typename type_map::MUMPS_STRUC_C MUMPS_STRUC_C;
109 typedef Kokkos::DefaultHostExecutionSpace HostExecSpaceType;
110 typedef typename HostExecSpaceType::memory_space HostMemSpaceType;
112 typedef Kokkos::View<local_ordinal_type*, HostExecSpaceType> host_ordinal_type_view;
113 typedef Kokkos::View<mumps_type*, HostExecSpaceType> host_value_type_view;
115 MUMPS(Teuchos::RCP<const Matrix> A,
116 Teuchos::RCP<Vector> X,
117 Teuchos::RCP<const Vector> B);
131 int symbolicFactorization_impl();
153 int
solve_impl(const Teuchos::Ptr<MultiVecAdapter<Vector> > X,
154 const Teuchos::Ptr<const MultiVecAdapter<Vector> > B) const;
178 const Teuchos::RCP<Teuchos::ParameterList> & parameterList );
201 int ConvertToTriplet();
203 void MUMPS_ERROR() const;
210 bool MUMPS_MATRIX_LOAD;
212 mutable bool MUMPS_MATRIX_LOAD_PREORDERING;
223 mutable Teuchos::Array<mumps_type>
xvals_; local_ordinal_type ldx_;
225 mutable Teuchos::Array<mumps_type>
bvals_; local_ordinal_type ldb_;
227 mutable MUMPS_STRUC_C mumps_par;
234template <class Matrix,class Vector>
235class MUMPSNS :
public SolverCore<Amesos2::MUMPS, Matrix, Vector>
237 friend class SolverCore<Amesos2::MUMPS,Matrix,Vector>;
243 MUMPSNS(Teuchos::RCP<const Matrix> A,
244 Teuchos::RCP<Vector> X,
245 Teuchos::RCP<const Vector> B);
263 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
264 "This solver is not support for these types.");
268 int symbolicFactorization_impl()
271 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
272 "This solver is not support for these types.");
279 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
280 "This solver is not support for these types.");
288 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
289 "This solver is not support for these types.");
296 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
297 "This solver is not support for these types.");
302 const Teuchos::RCP<Teuchos::ParameterList> & parameterList )
305 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
306 "This solver is not support for these types.");
313 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
314 "This solver is not support for these types.");
322 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
323 "This solver is not support for these types.");
328 int ConvertToTriplet()
331 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
332 "This solver is not support for these types.");
337 void MUMPS_ERROR()
const
340 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
341 "This solver is not support for these types.");
360#ifdef HAVE_TEUCHOS_COMPLEX
361 typedef Meta::make_list4<float,
364 std::complex<double> > supported_scalars;
366 typedef Meta::make_list2<float, double> supported_scalars;
Provides a mechanism to map function calls to the correct Solver function based on the scalar type of...
Provides access to interesting solver traits.
Amesos2 interface to the MUMPS package.
Definition Amesos2_MUMPS_decl.hpp:85
Teuchos::Array< mumps_type > xvals_
Persisting 1D store for X.
Definition Amesos2_MUMPS_decl.hpp:223
host_ordinal_type_view host_rows_view_
Stores the location in Ai_ and Aval_ that starts row j.
Definition Amesos2_MUMPS_decl.hpp:218
bool loadA_impl(EPhase current_phase)
Reads matrix data into internal structures.
Definition Amesos2_MUMPS_def.hpp:379
bool matrixShapeOK_impl() const
Determines whether the shape of the matrix is OK for this solver.
Definition Amesos2_MUMPS_def.hpp:299
int solve_impl(const Teuchos::Ptr< MultiVecAdapter< Vector > > X, const Teuchos::Ptr< const MultiVecAdapter< Vector > > B) const
MUMPS specific solve.
Definition Amesos2_MUMPS_def.hpp:225
host_value_type_view host_nzvals_view_
Stores the values of the nonzero entries for MUMPS.
Definition Amesos2_MUMPS_decl.hpp:216
host_ordinal_type_view host_col_ptr_view_
Stores the row indices of the nonzero entries.
Definition Amesos2_MUMPS_decl.hpp:220
static const char * name
Name of this solver interface.
Definition Amesos2_MUMPS_decl.hpp:92
int numericFactorization_impl()
MUMPS specific numeric factorization.
Definition Amesos2_MUMPS_def.hpp:202
int preOrdering_impl()
Performs pre-ordering on the matrix to increase efficiency.
Definition Amesos2_MUMPS_def.hpp:173
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters_impl() const
Definition Amesos2_MUMPS_def.hpp:351
Teuchos::Array< mumps_type > bvals_
Persisting 1D store for B.
Definition Amesos2_MUMPS_decl.hpp:225
void setParameters_impl(const Teuchos::RCP< Teuchos::ParameterList > ¶meterList)
Definition Amesos2_MUMPS_def.hpp:308
SolverCore(Teuchos::RCP< const Matrix > A, Teuchos::RCP< Vector > X, Teuchos::RCP< const Vector > B)
EPhase
Used to indicate a phase in the direct solution.
Definition Amesos2_TypeDecl.hpp:65
A templated MultiVector class adapter for Amesos2.
Definition Amesos2_MultiVecAdapter_decl.hpp:176
Map types to solver-specific data-types and enums.
Definition Amesos2_TypeMap.hpp:82
Provides traits about solvers.
Definition Amesos2_SolverTraits.hpp:71