Loading...
Searching...
No Matches
cholmod.hh File Reference
`#include <dune/common/fmatrix.hh>`
`#include <dune/common/fvector.hh>`
`#include <dune/istl/bcrsmatrix.hh>`
`#include <dune/istl/bvector.hh>`
`#include <dune/istl/solver.hh>`
`#include <dune/istl/solverregistry.hh>`
`#include <dune/istl/foreach.hh>`
`#include <vector>`
`#include <memory>`
`#include <cholmod.h>`

Go to the source code of this file.

## Classes

class | Dune::Cholmod< Vector, Index >
| Dune wrapper for SuiteSparse/CHOLMOD solver. More...

## Namespaces

namespace | Dune

## Functions

Dune::DUNE_REGISTER_SOLVER ("cholmod", [](auto opTraits, const auto &op, const Dune::ParameterTree &config) -> std::shared_ptr< typename decltype(opTraits)::solver_type > { using OpTraits=decltype(opTraits);using M=typename OpTraits::matrix_type;using D=typename OpTraits::domain_type;if constexpr(OpTraits::isParallel){ if(opTraits.getCommOrThrow(op).communicator().size() > 1) DUNE_THROW(Dune::InvalidStateException, "CholMod works only for sequential operators.");} if constexpr(OpTraits::isAssembled &&(std::is_same_v< typename FieldTraits< D >::field_type, double >||std::is_same_v< typename FieldTraits< D >::field_type, float >)){ const auto &A=opTraits.getAssembledOpOrThrow(op);const M &mat=A->getmat();auto solver=std::make_shared< Dune::Cholmod< D > >();solver->setMatrix(mat);return solver;} DUNE_THROW(UnsupportedType, "Unsupported Type in Cholmod (only double and float supported)");})