Commit 667f5a9d authored by Timo Koch's avatar Timo Koch
Browse files

Merge branch 'feature/discretization-tags-introduction' into 'master'

Feature/discretization tags introduction

Closes #1054

See merge request !2844
parents 5de58da2 b181b832
......@@ -12,6 +12,14 @@ Differences Between DuMu<sup>x</sup> 3.5 and DuMu<sup>x</sup> 3.4
### Improvements and Enhancements
- __Discretization tags__: We introduced tags in the namespace `DiscretizationMethods` (with s) for each discretization method.
These tags replace the `enum class DiscretizationMethod`. Tags have several advantages over the enum. Each tag is a named type
(see `dumux/common/tag.hh`) so they can for example be used in tag dispatch. Moreover specializing with tags is extensible.
For example we specialize the template `DarcysLawImplementation` for each discretization. When using the enum no new discretization
methods can be added without changing `enum class DiscretizationMethod`. With tags you can make your own tag and specialize a
class for that tag. This means new discretization methods can be developed in a modular fashion. The introduction of tags
involves a couple of non-backwards-compatible changes, mostly in implementation classes that shouldn't affect most users (see below).
- __Geometry__:
- Add implementation of sphere and bounding sphere approximation algorithms
- Add distance queries for Point->BoundingBoxTree
......@@ -48,10 +56,14 @@ for (const auto& element : elements(gridGeometry.gridView()))
- __Coupling managers__: The coupling managers now store shared_ptrs of the subdomain solutions to be able to manage memory outside. There is compatibility interface that is deprecated but it won't allow for assignments
of the form `this->curSol() = sol;` since curSol returns a MultiTypeVector of references. If assignment is needed for some reason, use a hybrid loop over all subdomain indices.
- __ShallowWaterViscousFlux__: The template argument `PrimaryVariables` has been removed without deprecation. It was not needed.
- __Discretization tags__: The following classes have changed from a template argument of type `DiscretizationMethod` (an `enum`) to
class type template arguments and are now specialized for tags: `TwoPScvSaturationReconstruction`, `ScvfToScvBoundaryTypes`, `ProblemTraits`, `FluxStencil`, `EffectiveStressLaw`, `HookesLaw`, `FacetCouplingManager`, `FacetCouplingMapper`. Moreover this affects the following helper classes: `IsFicksLaw`, `CheckOverlapSize`, `PartialReassemblerEngine`, `SubDomainAssemblerType`. Finally, this change has been made for many implementation classes. These should not have been used directly anyway, so we do not explicitly list them here. Examples are `DarcysLawImplementation`, `LinearSolverTraitsImpl`. See !2844 for more details.
If you face a compiler error from these changes, contact us. Most like the solution is to simply try replacing occurrences of `DiscretizationMethod` with the corresponding tag from `DiscretizationMethods`, or types `DiscretizationMethod` in template arguments by generic `class`.
### Deprecated properties/classes/functions/files, to be removed after 3.5:
- `update()` functions of grid geometries, which do not receive the `gridView`, are deprecated, use `update(gridView)` instead.
- `enum class DiscretizationMethod` and associated functions, to be replaced by tags
### New experimental features (possibly subject to backwards-incompatible changes in the future)
......
......@@ -52,7 +52,7 @@ class GridAdaptInitializationIndicator
using GridVariables = GetPropType<TypeTag, Properties::GridVariables>;
using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
static constexpr bool isBox = GetPropType<TypeTag, Properties::GridGeometry>::discMethod == DiscretizationMethod::box;
static constexpr bool isBox = GetPropType<TypeTag, Properties::GridGeometry>::discMethod == DiscretizationMethods::box;
public:
......
......@@ -477,7 +477,7 @@ public:
}
// also consider lateral faces outside the own element for face-centered staggered schemes
if constexpr (GridGeometry::discMethod == DiscretizationMethod::fcstaggered)
if constexpr (GridGeometry::discMethod == DiscretizationMethods::fcstaggered)
{
if (scvf.isLateral())
{
......@@ -509,7 +509,7 @@ public:
}
// also consider lateral faces outside the own element for face-centered staggered schemes
if constexpr (GridGeometry::discMethod == DiscretizationMethod::fcstaggered)
if constexpr (GridGeometry::discMethod == DiscretizationMethods::fcstaggered)
{
if (scvf.isLateral())
{
......@@ -549,7 +549,7 @@ public:
}
// also consider lateral faces outside the own element for face-centered staggered schemes
if constexpr (GridGeometry::discMethod == DiscretizationMethod::fcstaggered)
if constexpr (GridGeometry::discMethod == DiscretizationMethods::fcstaggered)
{
// treat normal/parallel scvs for parallel runs TODO description, put in function
if (problem.gridGeometry().gridView().comm().size() > 1 && element.partitionType() == Dune::InteriorEntity)
......
......@@ -41,32 +41,32 @@
namespace Dumux::Detail {
template<DiscretizationMethod diffMethod>
template<class DiscretizationMethod>
struct LocalAssemblerChooser;
template<>
struct LocalAssemblerChooser<DiscretizationMethod::box>
struct LocalAssemblerChooser<DiscretizationMethods::Box>
{
template<class TypeTag, class Impl, DiffMethod diffMethod, bool isImplicit>
using type = BoxLocalAssembler<TypeTag, Impl, diffMethod, isImplicit>;
};
template<>
struct LocalAssemblerChooser<DiscretizationMethod::ccmpfa>
struct LocalAssemblerChooser<DiscretizationMethods::CCMpfa>
{
template<class TypeTag, class Impl, DiffMethod diffMethod, bool isImplicit>
using type = CCLocalAssembler<TypeTag, Impl, diffMethod, isImplicit>;
};
template<>
struct LocalAssemblerChooser<DiscretizationMethod::cctpfa>
struct LocalAssemblerChooser<DiscretizationMethods::CCTpfa>
{
template<class TypeTag, class Impl, DiffMethod diffMethod, bool isImplicit>
using type = CCLocalAssembler<TypeTag, Impl, diffMethod, isImplicit>;
};
template<>
struct LocalAssemblerChooser<DiscretizationMethod::fcstaggered>
struct LocalAssemblerChooser<DiscretizationMethods::FCStaggered>
{
template<class TypeTag, class Impl, DiffMethod diffMethod, bool isImplicit>
using type = FaceCenteredLocalAssembler<TypeTag, Impl, diffMethod, isImplicit>;
......@@ -74,7 +74,7 @@ struct LocalAssemblerChooser<DiscretizationMethod::fcstaggered>
template<class TypeTag, class Impl, DiffMethod diffMethod, bool isImplicit>
using LocalAssemblerChooser_t = typename LocalAssemblerChooser<
GetPropType<TypeTag, Properties::GridGeometry>::discMethod
typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod
>::template type<TypeTag, Impl, diffMethod, isImplicit>;
} // end namespace Dumux::Detail
......@@ -98,7 +98,7 @@ class FVAssembler
using TimeLoop = TimeLoopBase<GetPropType<TypeTag, Properties::Scalar>>;
using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>;
static constexpr bool isBox = GridGeo::discMethod == DiscretizationMethod::box;
static constexpr bool isBox = GridGeo::discMethod == DiscretizationMethods::box;
using ThisType = FVAssembler<TypeTag, diffMethod, isImplicit>;
using LocalAssembler = typename Detail::LocalAssemblerChooser_t<TypeTag, ThisType, diffMethod, isImplicit>;
......@@ -450,7 +450,7 @@ private:
DUNE_THROW(NumericalProblem, "A process did not succeed in linearizing the system");
}
template<class GG> std::enable_if_t<GG::discMethod == DiscretizationMethod::box, void>
template<class GG> std::enable_if_t<GG::discMethod == DiscretizationMethods::box, void>
enforcePeriodicConstraints_(JacobianMatrix& jac, SolutionVector& res, const SolutionVector& curSol, const GG& gridGeometry)
{
for (const auto& m : gridGeometry.periodicVertexMap())
......@@ -471,7 +471,7 @@ private:
}
}
template<class GG> std::enable_if_t<GG::discMethod != DiscretizationMethod::box, void>
template<class GG> std::enable_if_t<GG::discMethod != DiscretizationMethods::box, void>
enforcePeriodicConstraints_(JacobianMatrix& jac, SolutionVector& res, const SolutionVector& curSol, const GG& gridGeometry) {}
//! pointer to the problem to be solved
......
......@@ -423,7 +423,7 @@ public:
//! Compute the derivative of the flux residual
template<class PartialDerivativeMatrices, class T = TypeTag>
std::enable_if_t<GetPropType<T, Properties::GridGeometry>::discMethod != DiscretizationMethod::box, void>
std::enable_if_t<GetPropType<T, Properties::GridGeometry>::discMethod != DiscretizationMethods::box, void>
addFluxDerivatives(PartialDerivativeMatrices& derivativeMatrices,
const Problem& problem,
const Element& element,
......@@ -437,7 +437,7 @@ public:
//! Compute the derivative of the flux residual for the box method
template<class JacobianMatrix, class T = TypeTag>
std::enable_if_t<GetPropType<T, Properties::GridGeometry>::discMethod == DiscretizationMethod::box, void>
std::enable_if_t<GetPropType<T, Properties::GridGeometry>::discMethod == DiscretizationMethods::box, void>
addFluxDerivatives(JacobianMatrix& A,
const Problem& problem,
const Element& element,
......
......@@ -43,7 +43,7 @@ void assembleInitialSolution(SolutionVector& sol, const Problem& problem)
using GridGeometry = std::decay_t<decltype(gg)>;
// box method
if constexpr (GridGeometry::discMethod == DiscretizationMethod::box)
if constexpr (GridGeometry::discMethod == DiscretizationMethods::box)
{
constexpr int dim = GridGeometry::GridView::dimension;
const auto numDofs = gg.vertexMapper().size();
......@@ -79,7 +79,7 @@ void assembleInitialSolution(SolutionVector& sol, const Problem& problem)
}
// staggered methods
else if constexpr (GridGeometry::discMethod == DiscretizationMethod::staggered)
else if constexpr (GridGeometry::discMethod == DiscretizationMethods::staggered)
{
problem.applyInitialSolution(sol);
}
......
......@@ -35,7 +35,7 @@ namespace Dumux {
* \brief Helper function to generate Jacobian pattern for the box method
*/
template<bool isImplicit, class GridGeometry,
typename std::enable_if_t<(GridGeometry::discMethod == DiscretizationMethod::box), int> = 0>
typename std::enable_if_t<(GridGeometry::discMethod == DiscretizationMethods::box), int> = 0>
Dune::MatrixIndexSet getJacobianPattern(const GridGeometry& gridGeometry)
{
const auto numDofs = gridGeometry.numDofs();
......@@ -84,8 +84,8 @@ Dune::MatrixIndexSet getJacobianPattern(const GridGeometry& gridGeometry)
* \brief Helper function to generate Jacobian pattern for cell-centered methods
*/
template<bool isImplicit, class GridGeometry,
typename std::enable_if_t<( (GridGeometry::discMethod == DiscretizationMethod::cctpfa)
|| (GridGeometry::discMethod == DiscretizationMethod::ccmpfa) ), int> = 0>
typename std::enable_if_t<( (GridGeometry::discMethod == DiscretizationMethods::cctpfa)
|| (GridGeometry::discMethod == DiscretizationMethods::ccmpfa) ), int> = 0>
Dune::MatrixIndexSet getJacobianPattern(const GridGeometry& gridGeometry)
{
const auto numDofs = gridGeometry.numDofs();
......@@ -118,7 +118,7 @@ Dune::MatrixIndexSet getJacobianPattern(const GridGeometry& gridGeometry)
* \brief Helper function to generate Jacobian pattern for the staggered method
*/
template<bool isImplicit, class GridGeometry,
typename std::enable_if_t<( (GridGeometry::discMethod == DiscretizationMethod::staggered) ), int> = 0>
typename std::enable_if_t<( (GridGeometry::discMethod == DiscretizationMethods::staggered) ), int> = 0>
auto getJacobianPattern(const GridGeometry& gridGeometry)
{
// resize the jacobian and the residual
......@@ -200,7 +200,7 @@ Dune::MatrixIndexSet getFEJacobianPattern(const FEBasis& feBasis)
* in fem is the same independent of the time discretization scheme.
*/
template<bool isImplicit, class GridGeometry,
typename std::enable_if_t<(GridGeometry::discMethod == DiscretizationMethod::fem), int> = 0>
typename std::enable_if_t<(GridGeometry::discMethod == DiscretizationMethods::fem), int> = 0>
Dune::MatrixIndexSet getJacobianPattern(const GridGeometry& gridGeometry)
{ return getFEJacobianPattern(gridGeometry.feBasis()); }
......@@ -209,7 +209,7 @@ Dune::MatrixIndexSet getJacobianPattern(const GridGeometry& gridGeometry)
* \brief Helper function to generate Jacobian pattern for the face-centered staggered method
*/
template<bool isImplicit, class GridGeometry,
typename std::enable_if_t<( (GridGeometry::discMethod == DiscretizationMethod::fcstaggered) ), int> = 0>
typename std::enable_if_t<( (GridGeometry::discMethod == DiscretizationMethods::fcstaggered) ), int> = 0>
Dune::MatrixIndexSet getJacobianPattern(const GridGeometry& gridGeometry)
{
// resize the jacobian and the residual
......
......@@ -70,7 +70,7 @@ public:
};
//! the partial reassembler engine specialized for discretization methods
template<class Assembler, DiscretizationMethod discMethod>
template<class Assembler, class DiscretizationMethod>
class PartialReassemblerEngine
{
public:
......@@ -98,7 +98,7 @@ public:
* \brief The partial reassembler engine specialized for the box method
*/
template<class Assembler>
class PartialReassemblerEngine<Assembler, DiscretizationMethod::box>
class PartialReassemblerEngine<Assembler, DiscretizationMethods::Box>
{
using Scalar = typename Assembler::Scalar;
using GridGeometry = typename Assembler::GridGeometry;
......@@ -310,7 +310,7 @@ private:
* \brief The partial reassembler engine specialized for the cellcentered TPFA method
*/
template<class Assembler>
class PartialReassemblerEngine<Assembler, DiscretizationMethod::cctpfa>
class PartialReassemblerEngine<Assembler, DiscretizationMethods::CCTpfa>
{
using Scalar = typename Assembler::Scalar;
using GridGeometry = typename Assembler::GridGeometry;
......@@ -407,10 +407,10 @@ private:
* \brief The partial reassembler engine specialized for the cellcentered MPFA method
*/
template<class Assembler>
class PartialReassemblerEngine<Assembler, DiscretizationMethod::ccmpfa>
: public PartialReassemblerEngine<Assembler, DiscretizationMethod::cctpfa>
class PartialReassemblerEngine<Assembler, DiscretizationMethods::CCMpfa>
: public PartialReassemblerEngine<Assembler, DiscretizationMethods::CCTpfa>
{
using ParentType = PartialReassemblerEngine<Assembler, DiscretizationMethod::cctpfa>;
using ParentType = PartialReassemblerEngine<Assembler, DiscretizationMethods::CCTpfa>;
public:
using ParentType::ParentType;
};
......@@ -435,8 +435,8 @@ class PartialReassembler
using JacobianMatrix = typename Assembler::JacobianMatrix;
using VertexMapper = typename GridGeometry::VertexMapper;
static constexpr DiscretizationMethod discMethod = GridGeometry::discMethod;
using Engine = PartialReassemblerEngine<Assembler, discMethod>;
using DiscretizationMethod = typename GridGeometry::DiscretizationMethod;
using Engine = PartialReassemblerEngine<Assembler, DiscretizationMethod>;
public:
......
......@@ -71,8 +71,8 @@ class FVProblem
using PointSourceMap = std::map< std::pair<std::size_t, std::size_t>,
std::vector<PointSource> >;
static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethod::box;
static constexpr bool isStaggered = GridGeometry::discMethod == DiscretizationMethod::staggered;
static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethods::box;
static constexpr bool isStaggered = GridGeometry::discMethod == DiscretizationMethods::staggered;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>;
......
......@@ -301,7 +301,7 @@ public:
// split the source values equally among all concerned entities
source.setEmbeddings(entities.size()*source.embeddings());
if constexpr (GridGeometry::discMethod == DiscretizationMethod::box)
if constexpr (GridGeometry::discMethod == DiscretizationMethods::box)
{
// loop over all concerned elements
auto fvGeometry = localView(gridGeometry);
......
......@@ -31,7 +31,7 @@ namespace Dumux {
// forward declare
namespace Detail {
template<class Problem, DiscretizationMethod dm>
template<class Problem, class DiscretizationMethod>
struct ProblemTraits;
} // end namespace Detail
......@@ -43,7 +43,7 @@ template<class Problem>
struct ProblemTraits
{
using GridGeometry = std::decay_t<decltype(std::declval<Problem>().gridGeometry())>;
using BoundaryTypes = typename Detail::template ProblemTraits<Problem, GridGeometry::discMethod>::BoundaryTypes;
using BoundaryTypes = typename Detail::template ProblemTraits<Problem, typename GridGeometry::DiscretizationMethod>::BoundaryTypes;
};
} // end namespace Dumux
......
......@@ -110,7 +110,7 @@ struct BaseLocalResidual<TypeTag, TTag::BoxModel> { using type = BoxLocalResidua
namespace Detail {
template<class Problem>
struct ProblemTraits<Problem, DiscretizationMethod::box>
struct ProblemTraits<Problem, DiscretizationMethods::Box>
{
private:
using GG = std::decay_t<decltype(std::declval<Problem>().gridGeometry())>;
......
......@@ -116,7 +116,7 @@ private:
*/
template<class Element, class SolutionVector, class GridGeometry>
auto elementSolution(const Element& element, const SolutionVector& sol, const GridGeometry& gg)
-> std::enable_if_t<GridGeometry::discMethod == DiscretizationMethod::box,
-> std::enable_if_t<GridGeometry::discMethod == DiscretizationMethods::box,
BoxElementSolution<typename GridGeometry::LocalView,
std::decay_t<decltype(std::declval<SolutionVector>()[0])>>
>
......@@ -131,7 +131,7 @@ auto elementSolution(const Element& element, const SolutionVector& sol, const Gr
*/
template<class Element, class ElementVolumeVariables, class FVElementGeometry>
auto elementSolution(const Element& element, const ElementVolumeVariables& elemVolVars, const FVElementGeometry& gg)
-> std::enable_if_t<FVElementGeometry::GridGeometry::discMethod == DiscretizationMethod::box,
-> std::enable_if_t<FVElementGeometry::GridGeometry::discMethod == DiscretizationMethods::box,
BoxElementSolution<FVElementGeometry,
typename ElementVolumeVariables::VolumeVariables::PrimaryVariables>>
{
......
......@@ -97,8 +97,9 @@ class BoxFVGridGeometry<Scalar, GV, true, Traits>
typename Traits::SubControlVolumeFace>;
public:
//! export discretization method
static constexpr DiscretizationMethod discMethod = DiscretizationMethod::box;
//! export the discretization method this geometry belongs to
using DiscretizationMethod = DiscretizationMethods::Box;
static constexpr DiscretizationMethod discMethod{};
//! export the type of the fv element geometry (the local view type)
using LocalView = typename Traits::template LocalView<ThisType, true>;
......@@ -385,8 +386,9 @@ class BoxFVGridGeometry<Scalar, GV, false, Traits>
using CoordScalar = typename GV::ctype;
public:
//! export discretization method
static constexpr DiscretizationMethod discMethod = DiscretizationMethod::box;
//! export the discretization method this geometry belongs to
using DiscretizationMethod = DiscretizationMethods::Box;
static constexpr DiscretizationMethod discMethod{};
//! export the type of the fv element geometry (the local view type)
using LocalView = typename Traits::template LocalView<ThisType, false>;
......
......@@ -34,7 +34,7 @@ namespace Dumux {
* \ingroup BoxDiscretization
* \brief Convert intersection boundary types to vertex boundary types
*/
template<class BoundaryTypes, DiscretizationMethod discMethod>
template<class BoundaryTypes, class DiscretizationMethod>
class ScvfToScvBoundaryTypes
{
public:
......@@ -44,7 +44,7 @@ public:
void computeBoundaryTypes(const Problem& problem)
{
// only do something for box
if (discMethod == DiscretizationMethod::box)
if (DiscretizationMethod{} == DiscretizationMethods::box)
{
const auto& gridGeometry = problem.gridGeometry();
scvBoundaryTypes.resize(gridGeometry.vertexMapper().size());
......@@ -81,7 +81,7 @@ public:
template<class SubControlVolume>
const BoundaryTypes& boundaryTypes(const SubControlVolume& scv) const
{
if (discMethod == DiscretizationMethod::box)
if (DiscretizationMethod{} == DiscretizationMethods::box)
return scvBoundaryTypes[scv.dofIndex()];
else
DUNE_THROW(Dune::InvalidStateException, "Only use this for the box discretization!");
......
......@@ -163,7 +163,7 @@ struct BaseLocalResidual<TypeTag, TTag::CCMpfaModel> { using type = CCLocalResid
namespace Detail {
template<class Problem>
struct ProblemTraits<Problem, DiscretizationMethod::ccmpfa>
struct ProblemTraits<Problem, DiscretizationMethods::CCMpfa>
{
private:
using GG = std::decay_t<decltype(std::declval<Problem>().gridGeometry())>;
......
......@@ -99,7 +99,7 @@ struct BaseLocalResidual<TypeTag, TTag::CCTpfaModel> { using type = CCLocalResid
namespace Detail {
template<class Problem>
struct ProblemTraits<Problem, DiscretizationMethod::cctpfa>
struct ProblemTraits<Problem, DiscretizationMethods::CCTpfa>
{
private:
using GG = std::decay_t<decltype(std::declval<Problem>().gridGeometry())>;
......
......@@ -111,8 +111,8 @@ private:
*/
template<class Element, class SolutionVector, class GridGeometry>
auto elementSolution(const Element& element, const SolutionVector& sol, const GridGeometry& gg)
-> std::enable_if_t<GridGeometry::discMethod == DiscretizationMethod::cctpfa ||
GridGeometry::discMethod == DiscretizationMethod::ccmpfa,
-> std::enable_if_t<GridGeometry::discMethod == DiscretizationMethods::cctpfa ||
GridGeometry::discMethod == DiscretizationMethods::ccmpfa,
CCElementSolution<typename GridGeometry::LocalView,
std::decay_t<decltype(std::declval<SolutionVector>()[0])>>
>
......@@ -127,8 +127,8 @@ auto elementSolution(const Element& element, const SolutionVector& sol, const Gr
*/
template<class Element, class ElementVolumeVariables, class FVElementGeometry>
auto elementSolution(const Element& element, const ElementVolumeVariables& elemVolVars, const FVElementGeometry& gg)
-> std::enable_if_t<FVElementGeometry::GridGeometry::discMethod == DiscretizationMethod::cctpfa ||
FVElementGeometry::GridGeometry::discMethod == DiscretizationMethod::ccmpfa,
-> std::enable_if_t<FVElementGeometry::GridGeometry::discMethod == DiscretizationMethods::cctpfa ||
FVElementGeometry::GridGeometry::discMethod == DiscretizationMethods::ccmpfa,
CCElementSolution<FVElementGeometry, typename ElementVolumeVariables::VolumeVariables::PrimaryVariables>>
{
using PrimaryVariables = typename ElementVolumeVariables::VolumeVariables::PrimaryVariables;
......@@ -142,8 +142,8 @@ auto elementSolution(const Element& element, const ElementVolumeVariables& elemV
*/
template<class FVElementGeometry, class PrimaryVariables>
auto elementSolution(PrimaryVariables&& priVars)
-> std::enable_if_t<FVElementGeometry::GridGeometry::discMethod == DiscretizationMethod::cctpfa ||
FVElementGeometry::GridGeometry::discMethod == DiscretizationMethod::ccmpfa,
-> std::enable_if_t<FVElementGeometry::GridGeometry::discMethod == DiscretizationMethods::cctpfa ||
FVElementGeometry::GridGeometry::discMethod == DiscretizationMethods::ccmpfa,
CCElementSolution<FVElementGeometry, PrimaryVariables>>
{
return CCElementSolution<FVElementGeometry, PrimaryVariables>(std::move(priVars));
......@@ -156,8 +156,8 @@ auto elementSolution(PrimaryVariables&& priVars)
*/
template<class FVElementGeometry, class PrimaryVariables>
auto elementSolution(const PrimaryVariables& priVars)
-> std::enable_if_t<FVElementGeometry::GridGeometry::discMethod == DiscretizationMethod::cctpfa ||
FVElementGeometry::GridGeometry::discMethod == DiscretizationMethod::ccmpfa,
-> std::enable_if_t<FVElementGeometry::GridGeometry::discMethod == DiscretizationMethods::cctpfa ||
FVElementGeometry::GridGeometry::discMethod == DiscretizationMethods::ccmpfa,
CCElementSolution<FVElementGeometry, PrimaryVariables>>
{
return CCElementSolution<FVElementGeometry, PrimaryVariables>(priVars);
......
......@@ -56,7 +56,7 @@ template<class GridView>
void checkOverlapSizeCCMpfa(const GridView& gridView)
{
// Check if the overlap size is what we expect
if (!CheckOverlapSize<DiscretizationMethod::ccmpfa>::isValid(gridView))
if (!CheckOverlapSize<DiscretizationMethods::CCMpfa>::isValid(gridView))
DUNE_THROW(Dune::InvalidStateException, "The ccmpfa discretization method needs at least an overlap of 1 for parallel computations. "
<< " Set the parameter \"Grid.Overlap\" in the input file.");
}
......@@ -111,7 +111,8 @@ public:
using MpfaHelper = typename Traits::template MpfaHelper<ThisType>;
//! export the discretization method this geometry belongs to
static constexpr DiscretizationMethod discMethod = DiscretizationMethod::ccmpfa;
using DiscretizationMethod = DiscretizationMethods::CCMpfa;
static constexpr DiscretizationMethod discMethod{};
//! The maximum admissible stencil size (used for static memory allocation during assembly)
static constexpr int maxElementStencilSize = Traits::maxElementStencilSize;
......@@ -502,7 +503,8 @@ public:
using MpfaHelper = typename Traits::template MpfaHelper<ThisType>;
//! export the discretization method this geometry belongs to
static constexpr DiscretizationMethod discMethod = DiscretizationMethod::ccmpfa;
using DiscretizationMethod = DiscretizationMethods::CCMpfa;
static constexpr DiscretizationMethod discMethod{};
//! The maximum admissible stencil size (used for static memory allocation during assembly)
static constexpr int maxElementStencilSize = Traits::maxElementStencilSize;
......
......@@ -112,7 +112,8 @@ public:
using DofMapper = typename Traits::ElementMapper;
//! export the discretization method this geometry belongs to
static constexpr DiscretizationMethod discMethod = DiscretizationMethod::cctpfa;
using DiscretizationMethod = DiscretizationMethods::CCTpfa;
static constexpr DiscretizationMethod discMethod{};
//! The maximum admissible stencil size (used for static memory allocation during assembly)
static constexpr int maxElementStencilSize = LocalView::maxNumElementScvfs*Traits::maxNumScvfNeighbors + 1;
......@@ -125,7 +126,7 @@ public:
: ParentType(gridView)
{
// Check if the overlap size is what we expect
if (!CheckOverlapSize<DiscretizationMethod::cctpfa>::isValid(gridView))
if (!CheckOverlapSize<DiscretizationMethod>::isValid(gridView))
DUNE_THROW(Dune::InvalidStateException, "The cctpfa discretization method needs at least an overlap of 1 for parallel computations. "
<< " Set the parameter \"Grid.Overlap\" in the input file.");
......@@ -418,7 +419,8 @@ public:
using DofMapper = typename Traits::ElementMapper;
//! Export the discretization method this geometry belongs to
static constexpr DiscretizationMethod discMethod = DiscretizationMethod::cctpfa;
using DiscretizationMethod = DiscretizationMethods::CCTpfa;
static constexpr DiscretizationMethod discMethod{};
//! The maximum admissible stencil size (used for static memory allocation during assembly)
static constexpr int maxElementStencilSize = LocalView::maxNumElementScvfs*Traits::maxNumScvfNeighbors + 1;
......@@ -431,7 +433,7 @@ public:
: ParentType(gridView)
{
// Check if the overlap size is what we expect
if (!CheckOverlapSize<DiscretizationMethod::cctpfa>::isValid(gridView))
if (!CheckOverlapSize<DiscretizationMethod>::isValid(gridView))
DUNE_THROW(Dune::InvalidStateException, "The cctpfa discretization method needs at least an overlap of 1 for parallel computations. "
<< " Set the parameter \"Grid.Overlap\" in the input file.");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment