18#ifndef AMESOS2_MUMPS_DECL_HPP
19#define AMESOS2_MUMPS_DECL_HPP
22#include "Amesos2_SolverCore.hpp"
49template <
class Matrix,
class Vector>
60 typedef
MUMPS<Matrix,Vector> type;
64 typedef typename super_type::scalar_type scalar_type;
65 typedef typename super_type::local_ordinal_type local_ordinal_type;
66 typedef typename super_type::global_ordinal_type global_ordinal_type;
67 typedef typename super_type::global_size_type global_size_type;
69 typedef
TypeMap<Amesos2::MUMPS,scalar_type> type_map;
71 typedef typename type_map::type mumps_type;
72 typedef typename type_map::magnitude_type magnitude_type;
73 typedef typename type_map::MUMPS_STRUC_C MUMPS_STRUC_C;
75 typedef Kokkos::DefaultHostExecutionSpace HostExecSpaceType;
76 typedef typename HostExecSpaceType::memory_space HostMemSpaceType;
78 typedef Kokkos::View<local_ordinal_type*, HostExecSpaceType> host_ordinal_type_view;
79 typedef Kokkos::View<mumps_type*, HostExecSpaceType> host_value_type_view;
81 MUMPS(Teuchos::RCP<const Matrix> A,
82 Teuchos::RCP<Vector> X,
83 Teuchos::RCP<const Vector> B);
97 int symbolicFactorization_impl();
119 int
solve_impl(const Teuchos::Ptr<MultiVecAdapter<Vector> > X,
120 const Teuchos::Ptr<const MultiVecAdapter<Vector> > B) const;
127 const Teuchos::EVerbosityLevel verbLevel) const;
157 const Teuchos::RCP<Teuchos::ParameterList> & parameterList );
180 int ConvertToTriplet();
182 void MUMPS_ERROR() const;
189 bool MUMPS_MATRIX_LOAD;
191 mutable bool MUMPS_MATRIX_LOAD_PREORDERING;
202 mutable Teuchos::Array<mumps_type>
xvals_; local_ordinal_type ldx_;
204 mutable Teuchos::Array<mumps_type>
bvals_; local_ordinal_type ldb_;
206 mutable MUMPS_STRUC_C mumps_par;
213template <class Matrix,class Vector>
214class MUMPSNS :
public SolverCore<Amesos2::MUMPS, Matrix, Vector>
222 MUMPSNS(Teuchos::RCP<const Matrix> A,
223 Teuchos::RCP<Vector> X,
224 Teuchos::RCP<const Vector> B);
239 int preOrdering_impl()
242 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
243 "This solver is not support for these types.");
247 int symbolicFactorization_impl()
250 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
251 "This solver is not support for these types.");
255 int numericFactorization_impl()
258 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
259 "This solver is not support for these types.");
267 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
268 "This solver is not support for these types.");
272 bool matrixShapeOK_impl()
const
275 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
276 "This solver is not support for these types.");
280 void setParameters_impl(
281 const Teuchos::RCP<Teuchos::ParameterList> & parameterList )
284 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
285 "This solver is not support for these types.");
289 Teuchos::RCP<const Teuchos::ParameterList> getValidParameters_impl()
const
292 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
293 "This solver is not support for these types.");
298 bool loadA_impl(
EPhase current_phase)
301 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
302 "This solver is not support for these types.");
307 int ConvertToTriplet()
310 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
311 "This solver is not support for these types.");
316 void MUMPS_ERROR()
const
319 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
320 "This solver is not support for these types.");
339#ifdef HAVE_TEUCHOS_COMPLEX
340 typedef Meta::make_list4<float,
343 std::complex<double> > supported_scalars;
345 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:51
Teuchos::Array< mumps_type > xvals_
Persisting 1D store for X.
Definition Amesos2_MUMPS_decl.hpp:202
host_ordinal_type_view host_rows_view_
Stores the location in Ai_ and Aval_ that starts row j.
Definition Amesos2_MUMPS_decl.hpp:197
bool loadA_impl(EPhase current_phase)
Reads matrix data into internal structures.
Definition Amesos2_MUMPS_def.hpp:325
bool matrixShapeOK_impl() const
Determines whether the shape of the matrix is OK for this solver.
Definition Amesos2_MUMPS_def.hpp:245
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:188
static const char * name
Name of this solver interface.
Definition Amesos2_MUMPS_decl.hpp:58
host_value_type_view host_nzvals_view_
Stores the values of the nonzero entries for MUMPS.
Definition Amesos2_MUMPS_decl.hpp:195
host_ordinal_type_view host_col_ptr_view_
Stores the row indices of the nonzero entries.
Definition Amesos2_MUMPS_decl.hpp:199
int numericFactorization_impl()
MUMPS specific numeric factorization.
Definition Amesos2_MUMPS_def.hpp:170
int preOrdering_impl()
Performs pre-ordering on the matrix to increase efficiency.
Definition Amesos2_MUMPS_def.hpp:138
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters_impl() const
Definition Amesos2_MUMPS_def.hpp:297
Teuchos::Array< mumps_type > bvals_
Persisting 1D store for B.
Definition Amesos2_MUMPS_decl.hpp:204
void setParameters_impl(const Teuchos::RCP< Teuchos::ParameterList > ¶meterList)
Definition Amesos2_MUMPS_def.hpp:254
void describe_impl(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
Prints the status information about the current solver with some level of verbosity.
Definition Amesos2_MUMPS_def.hpp:380
Amesos2::SolverCore: A templated interface for interaction with third-party direct sparse solvers.
Definition Amesos2_SolverCore_decl.hpp:72
EPhase
Used to indicate a phase in the direct solution.
Definition Amesos2_TypeDecl.hpp:31
A templated MultiVector class adapter for Amesos2.
Definition Amesos2_MultiVecAdapter_decl.hpp:142
Map types to solver-specific data-types and enums.
Definition Amesos2_TypeMap.hpp:48
Provides traits about solvers.
Definition Amesos2_SolverTraits.hpp:37