Commit e6c00df0 authored by Ivan Buntic's avatar Ivan Buntic
Browse files

[Tag] Adapted all comparisons with old enum class DiscretizationMethod.

parent 391ab2bf
Pipeline #9083 failed with stages
......@@ -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:
......
......@@ -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,
......
......@@ -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
......
......@@ -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);
......
......@@ -39,7 +39,7 @@ struct StaggeredVelocityReconstruction
static auto cellCenterVelocity(const VelocityHelper& getFaceVelocity,
const FVElementGeometry& fvGeometry)
{
static_assert(FVElementGeometry::GridGeometry::discMethod == DiscretizationMethod::cctpfa);
static_assert(FVElementGeometry::GridGeometry::discMethod == DiscretizationMethods::cctpfa);
using VelocityVector = typename FVElementGeometry::GridGeometry::GlobalCoordinate;
VelocityVector result(0.0);
......
......@@ -76,7 +76,7 @@ public:
int phaseIdx) const override
{
using Problem = std::decay_t<decltype(elemVolVars.gridVolVars().problem())>;
if constexpr (Problem::momentumDiscretizationMethod == DiscretizationMethod::fcstaggered)
if constexpr (Problem::momentumDiscretizationMethod == DiscretizationMethods::fcstaggered)
calculateVelocityForStaggeredGrid_(velocity, element, fvGeometry, elemVolVars);
}
......
......@@ -414,7 +414,7 @@ private:
void storeWallElementAndDirectionIndex_(const WallData& wallData)
{
// The wall Direction Index is used for flat quadrilateral channel problems only
if (!(GridGeometry::discMethod == DiscretizationMethod::staggered))
if (!(GridGeometry::discMethod == DiscretizationMethods::staggered))
DUNE_THROW(Dune::NotImplemented, "The wall direction Index can only be calculated for quadrilateral structured grids");
// If isFlatWallBounded, the corresonding wall element is stored for each element
......
......@@ -79,11 +79,11 @@ class PoroMechanicsCouplingManager : public virtual CouplingManager< MDTraits >
"The grid types of the two sub-problems have to be equal!");
//! this coupling manager is for cc - box only
static_assert(GridGeometry<PoroMechId>::discMethod == DiscretizationMethod::box,
static_assert(GridGeometry<PoroMechId>::discMethod == DiscretizationMethods::box,
"Poro-mechanical problem must be discretized with the box scheme for this coupling manager!");
static_assert(GridGeometry<PMFlowId>::discMethod == DiscretizationMethod::cctpfa ||
GridGeometry<PMFlowId>::discMethod == DiscretizationMethod::ccmpfa,
static_assert(GridGeometry<PMFlowId>::discMethod == DiscretizationMethods::cctpfa ||
GridGeometry<PMFlowId>::discMethod == DiscretizationMethods::ccmpfa,
"Porous medium flow problem must be discretized with a cell-centered scheme for this coupling manager!");
//! this does not work for enabled grid volume variables caching (update of local view in context has no effect)
......
......@@ -321,7 +321,7 @@ class VtkOutputModule : public VtkOutputModuleBase<typename GridVariables::GridG
using Element = typename GridView::template Codim<0>::Entity;
using VolVarsVector = Dune::FieldVector<Scalar, dimWorld>;
static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethod::box;
static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethods::box;
static constexpr int dofCodim = isBox ? dim : 0;
struct VolVarScalarDataInfo { std::function<Scalar(const VV&)> get; std::string name; Dumux::Vtk::Precision precision_; };
......
......@@ -75,7 +75,7 @@ class ElectroChemistry
};
using GridView = typename GridGeometry::GridView;
static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethod::box;
static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethods::box;
using GlobalPosition = typename Dune::FieldVector<typename GridView::ctype, GridView::dimensionworld>;
public:
......
......@@ -51,7 +51,7 @@ class ElectroChemistryNI : public ElectroChemistry<Scalar, Indices, FluidSystem,
};
using GridView = typename GridGeometry::GridView;
static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethod::box;
static constexpr bool isBox = GridGeometry::discMethod == DiscretizationMethods::box;
using GlobalPosition = typename Dune::FieldVector<typename GridView::ctype, GridView::dimensionworld>;
using CellVector = typename Dune::FieldVector<typename GridView::ctype, GridView::dimension>;
......
......@@ -74,7 +74,7 @@ class DarcyDarcyBoundaryCouplingManager
template<std::size_t i>
static constexpr bool isCCTpfa()
{ return GridGeometry<i>::discMethod == DiscretizationMethod::cctpfa; }
{ return GridGeometry<i>::discMethod == DiscretizationMethods::cctpfa; }
using CouplingStencil = std::vector<std::size_t>;
public:
......
......@@ -60,7 +60,7 @@ class DarcyDarcyBoundaryCouplingMapper
template<std::size_t i>
static constexpr bool isCCTpfa()
{ return GridGeometry<i>::discMethod == DiscretizationMethod::cctpfa; }
{ return GridGeometry<i>::discMethod == DiscretizationMethods::cctpfa; }
struct ScvfInfo
{
......
......@@ -62,10 +62,10 @@ public:
const auto& stokesFvGridGeometry = couplingManager.problem(CouplingManager::stokesIdx).gridGeometry();
const auto& darcyFvGridGeometry = couplingManager.problem(CouplingManager::darcyIdx).gridGeometry();
static_assert(std::decay_t<decltype(stokesFvGridGeometry)>::discMethod == DiscretizationMethod::staggered,
static_assert(std::decay_t<decltype(stokesFvGridGeometry)>::discMethod == DiscretizationMethods::staggered,
"The free flow domain must use the staggered discretization");
static_assert(std::decay_t<decltype(darcyFvGridGeometry)>::discMethod == DiscretizationMethod::cctpfa,
static_assert(std::decay_t<decltype(darcyFvGridGeometry)>::discMethod == DiscretizationMethods::cctpfa,
"The Darcy domain must use the CCTpfa discretization");
isCoupledDarcyScvf_.resize(darcyFvGridGeometry.numScvf(), false);
......
......@@ -37,8 +37,8 @@ namespace Dumux {
* for cell-centered schemes
*/
template<bool isImplicit, class CouplingManager, class GridGeometryI, class GridGeometryJ, std::size_t i, std::size_t j,
typename std::enable_if_t<( (GridGeometryI::discMethod == DiscretizationMethod::cctpfa)
|| (GridGeometryI::discMethod == DiscretizationMethod::ccmpfa) ), int> = 0>
typename std::enable_if_t<( (GridGeometryI::discMethod == DiscretizationMethods::cctpfa)
|| (GridGeometryI::discMethod == DiscretizationMethods::ccmpfa) ), int> = 0>
Dune::MatrixIndexSet getCouplingJacobianPattern(const CouplingManager& couplingManager,
Dune::index_constant<i> domainI,
const GridGeometryI& gridGeometryI,
......@@ -75,7 +75,7 @@ Dune::MatrixIndexSet getCouplingJacobianPattern(const CouplingManager& couplingM
* for the box scheme
*/
template<bool isImplicit, class CouplingManager, class GridGeometryI, class GridGeometryJ, std::size_t i, std::size_t j,
typename std::enable_if_t<(GridGeometryI::discMethod == DiscretizationMethod::box), int> = 0>
typename std::enable_if_t<(GridGeometryI::discMethod == DiscretizationMethods::box), int> = 0>
Dune::MatrixIndexSet getCouplingJacobianPattern(const CouplingManager& couplingManager,
Dune::index_constant<i> domainI,
const GridGeometryI& gridGeometryI,
......@@ -116,7 +116,7 @@ Dune::MatrixIndexSet getCouplingJacobianPattern(const CouplingManager& couplingM
* for the staggered scheme (degrees of freedom on cell centers)
*/
template<bool isImplicit, class CouplingManager, class GridGeometryI, class GridGeometryJ, std::size_t i, std::size_t j,
typename std::enable_if_t<(GridGeometryI::discMethod == DiscretizationMethod::staggered &&
typename std::enable_if_t<(GridGeometryI::discMethod == DiscretizationMethods::staggered &&
GridGeometryI::isCellCenter()), int> = 0>
Dune::MatrixIndexSet getCouplingJacobianPattern(const CouplingManager& couplingManager,
Dune::index_constant<i> domainI,
......@@ -142,7 +142,7 @@ Dune::MatrixIndexSet getCouplingJacobianPattern(const CouplingManager& couplingM
* for the staggered scheme (degrees of freedom on faces)
*/
template<bool isImplicit, class CouplingManager, class GridGeometryI, class GridGeometryJ, std::size_t i, std::size_t j,
typename std::enable_if_t<(GridGeometryI::discMethod == DiscretizationMethod::staggered &&
typename std::enable_if_t<(GridGeometryI::discMethod == DiscretizationMethods::staggered &&
GridGeometryI::isFace()), int> = 0>
Dune::MatrixIndexSet getCouplingJacobianPattern(const CouplingManager& couplingManager,
Dune::index_constant<i> domainI,
......@@ -175,7 +175,7 @@ Dune::MatrixIndexSet getCouplingJacobianPattern(const CouplingManager& couplingM
* for the staggered scheme (degrees of freedom on cell centers)
*/
template<bool isImplicit, class CouplingManager, class GridGeometryI, class GridGeometryJ, std::size_t i, std::size_t j,
typename std::enable_if_t<(GridGeometryI::discMethod == DiscretizationMethod::fcstaggered), int> = 0>
typename std::enable_if_t<(GridGeometryI::discMethod == DiscretizationMethods::fcstaggered), int> = 0>
Dune::MatrixIndexSet getCouplingJacobianPattern(const CouplingManager& couplingManager,
Dune::index_constant<i> domainI,
const GridGeometryI& gridGeometryI,
......
......@@ -87,7 +87,7 @@ class Embedded1d3dCouplingManager<MDTraits, Embedded1d3dCouplingMode::Average>
template<std::size_t id>
static constexpr bool isBox()
{ return GridGeometry<id>::discMethod == DiscretizationMethod::box; }
{ return GridGeometry<id>::discMethod == DiscretizationMethods::box; }
public:
......
......@@ -85,7 +85,7 @@ class Embedded1d3dCouplingManager<MDTraits, Embedded1d3dCouplingMode::Kernel>
template<std::size_t id>
static constexpr bool isBox()
{ return GridGeometry<id>::discMethod == DiscretizationMethod::box; }
{ return GridGeometry<id>::discMethod == DiscretizationMethods::box; }
static_assert(!isBox<bulkIdx>() && !isBox<lowDimIdx>(), "The kernel coupling method is only implemented for the tpfa method");
static_assert(Dune::Capabilities::isCartesian<typename GridView<bulkIdx>::Grid>::v, "The kernel coupling method is only implemented for structured grids");
......
......@@ -355,7 +355,7 @@ class Embedded1d3dCouplingManager<MDTraits, Embedded1d3dCouplingMode::Projection
template<std::size_t id>
static constexpr bool isBox()
{ return GridGeometry<id>::discMethod == DiscretizationMethod::box; }
{ return GridGeometry<id>::discMethod == DiscretizationMethods::box; }
using GlobalPosition = typename Element<bulkIdx>::Geometry::GlobalCoordinate;
......
......@@ -86,7 +86,7 @@ class Embedded1d3dCouplingManager<MDTraits, Embedded1d3dCouplingMode::Surface>
template<std::size_t id>
static constexpr bool isBox()
{ return GridGeometry<id>::discMethod == DiscretizationMethod::box; }
{ return GridGeometry<id>::discMethod == DiscretizationMethods::box; }
enum {
bulkDim = GridView<bulkIdx>::dimension,
......
Markdown is supported
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