40 template<
typename Scalar>
46 node_wise_ordering =
false;
49 template<
typename Scalar>
55 template<
typename Scalar>
61 template<
typename Scalar>
64 return this->general_matrix;
67 template<
typename Scalar>
70 return this->general_rhs;
73 template<
typename Scalar>
79 template<
typename Scalar>
85 template<
typename Scalar>
91 template<
typename Scalar>
94 this->reuse_scheme = reuse_scheme;
97 template<
typename Scalar>
101 this->n_eq = num_pdes;
102 this->node_wise_ordering =
true;
105 template<
typename Scalar>
109 this->node_wise_ordering =
false;
112 template<
typename Scalar>
119 template<
typename Scalar>
131 template<
typename Scalar>
143 template<
typename Scalar>
155 template<
typename Scalar>
167 template<
typename Scalar>
170 throw Exceptions::MethodNotOverridenException(
"ExternalSolver<Scalar>::create_external_solver");
185 case Hermes::SOLVER_EXTERNAL:
192 case Hermes::SOLVER_AZTECOO:
194 if (use_direct_solver)
196 #if defined HAVE_AZTECOO && defined HAVE_EPETRA
204 case Hermes::SOLVER_AMESOS:
206 #if defined HAVE_AMESOS && defined HAVE_EPETRA
214 case Hermes::SOLVER_MUMPS:
224 case Hermes::SOLVER_PETSC:
226 if (use_direct_solver)
229 if (rhs !=
nullptr)
return new PetscLinearMatrixSolver<double>(
static_cast<PetscMatrix<double>*
>(matrix),
static_cast<PetscVector<double>*
>(rhs));
230 else return new PetscLinearMatrixSolver<double>(
static_cast<PetscMatrix<double>*
>(matrix),
static_cast<PetscVector<double>*
>(rhs_dummy));
236 case Hermes::SOLVER_UMFPACK:
246 case Hermes::SOLVER_PARALUTION_ITERATIVE:
248 if (use_direct_solver)
250 #ifdef WITH_PARALUTION
257 case Hermes::SOLVER_PARALUTION_AMG:
259 if (use_direct_solver)
261 #ifdef WITH_PARALUTION
268 case Hermes::SOLVER_SUPERLU:
290 case Hermes::SOLVER_EXTERNAL:
297 case Hermes::SOLVER_AZTECOO:
299 if (use_direct_solver)
301 #if defined HAVE_AZTECOO && defined HAVE_EPETRA
309 case Hermes::SOLVER_AMESOS:
311 #if defined HAVE_AMESOS && defined HAVE_EPETRA
319 case Hermes::SOLVER_MUMPS:
329 case Hermes::SOLVER_PETSC:
331 if (use_direct_solver)
334 if (rhs !=
nullptr)
return new PetscLinearMatrixSolver<std::complex<double> >(
static_cast<PetscMatrix<std::complex<double>
>*>(matrix),
static_cast<PetscVector<std::complex<double>
>*>(rhs));
335 else return new PetscLinearMatrixSolver<std::complex<double> >(
static_cast<PetscMatrix<std::complex<double>
>*>(matrix),
static_cast<PetscVector<std::complex<double>
>*>(rhs_dummy));
341 case Hermes::SOLVER_UMFPACK:
351 case Hermes::SOLVER_PARALUTION_ITERATIVE:
352 case Hermes::SOLVER_PARALUTION_AMG:
354 if (use_direct_solver)
356 #ifdef WITH_PARALUTION
363 case Hermes::SOLVER_SUPERLU:
379 template <
typename Scalar>
384 template <
typename Scalar>
389 template <
typename Scalar>
395 template <
typename Scalar>
399 this->process_matrix_output(this->m);
400 this->process_vector_output(this->rhs);
403 std::string resultFileName = this->command();
406 this->sln = malloc_with_check<Scalar>(this->m->get_size());
408 temp.
alloc(this->m->get_size());
410 memcpy(this->sln, temp.v, this->m->get_size() *
sizeof(Scalar));
413 template <
typename Scalar>
418 template <
typename Scalar>
424 template <
typename Scalar>
429 template<
typename Scalar>
432 this->tolerance = tol;
433 this->toleranceType = AbsoluteTolerance;
436 template<
typename Scalar>
439 this->tolerance = tol;
440 this->toleranceType = toleranceType;
443 template<
typename Scalar>
446 this->max_iters = iters;
449 template <
typename Scalar>
454 template<
typename Scalar>
457 this->iterSolverType = iterSolverType;
460 template <
typename Scalar>
465 template<
typename Scalar>
468 this->smootherPreconditionerType = preconditionerType_;
469 this->smootherSolverType = solverType_;
General (abstract) matrix representation in Hermes.
AmesosSolver class as an interface to Amesos.
General namespace for the Hermes library.
Linear matrix solver functionality.
Exception interface Basically a std::exception, but with a constructor with string and with print_msg...
Encapsulation of AztecOO linear solver.
General (abstract) vector representation in Hermes.
PARALUTION solver interface.
Encapsulation of PARALUTION AMG linear solver.
virtual void alloc(unsigned int ndofs)
Namespace containing classes for vector / matrix operations.
File containing common definitions, and basic global enums etc. for HermesCommon. ...
PreconditionerType
The preconditioner type.
General (abstract) sparse matrix representation in Hermes.
Abstract class for defining interface for Algebraic Multigrid solvers. Internal, though utilizable fo...
An example class for using external solvers that run a command and store the result in a file...
Plain ascii file lines contains row column and value.
Vector used with MUMPS solver.
Special-purpose abstract class for using external solvers. For examples implementation, see the class SimpleExternalSolver.
Encapsulation of Amesos linear solver.
AztecOOSolver class as an interface to AztecOO.
General CSC Matrix class. (can be used in umfpack, in that case use the CSCMatrix subclass...
HERMES_COMMON_API Hermes::Api HermesCommonApi
Global instance used inside Hermes which is also accessible to users.
virtual void set_tolerance(double tol)
virtual void set_max_iters(int iters)
Abstract middle-class for solvers that work in a loop of a kind (iterative, multigrid, ...)
HERMES_API LinearMatrixSolver< Scalar > * create_linear_solver(Matrix< Scalar > *matrix, Vector< Scalar > *rhs, bool use_direct_solver=false)
Function returning a solver according to the users's choice.
General Paralution matrix.
Matrix used with MUMPS solver.
existing factorization data.
File containing definition of exceptions classes.
UMFPACK solver interface.
Abstract class for defining solver interface.
MatrixStructureReuseScheme
Abstract class for defining interface for iterative solvers. Internal, though utilizable for defining...
Encapsulation of UMFPACK linear solver.
Method is not overriden and should be.
virtual void set_smoother(IterSolverType solverType, PreconditionerType preconditionerType)
Set smoother (an iterative linear matrix solver).
SuperLU solver interface.
Class representing the vector for UMFPACK.
Encapsulation of PARALUTION iterative linear solver.
void set_solver_type(IterSolverType iterSolverType)