// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
* See the file COPYING for full copying permissions. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see . *
*****************************************************************************/
/*!
* \file
* \ingroup PoreNetworkDiscretization
* \brief Base class for a sub control volume face
*/
#ifndef DUMUX_DISCRETIZATION_PNM_SUBCONTROLVOLUMEFACE_HH
#define DUMUX_DISCRETIZATION_PNM_SUBCONTROLVOLUMEFACE_HH
#include
#include
namespace Dumux::PoreNetwork {
/*!
* \ingroup PoreNetworkDiscretization
* \brief Default traits class
* \tparam GV the type of the grid view
*/
template
struct PNMDefaultScvfGeometryTraits
{
using Grid = typename GridView::Grid;
static constexpr int dim = Grid::dimension;
static constexpr int dimWorld = Grid::dimensionworld;
using GridIndexType = typename IndexTraits::GridIndex;
using LocalIndexType = typename IndexTraits::LocalIndex;
using Scalar = typename Grid::ctype;
using GlobalPosition = Dune::FieldVector;
using CornerStorage = std::array, 1>;
};
/*!
* \ingroup PoreNetworkDiscretization
* \brief Class for a sub control volume face for porenetworks
* \tparam GV the type of the grid view
* \tparam T the scvf geometry traits
*/
template >
class PNMSubControlVolumeFace
: public Dumux::SubControlVolumeFaceBase, T>
{
using ThisType = PNMSubControlVolumeFace;
using ParentType = Dumux::SubControlVolumeFaceBase;
using GridIndexType = typename T::GridIndexType;
using LocalIndexType = typename T::LocalIndexType;
using Scalar = typename T::Scalar;
public:
//! export the type used for global coordinates
using GlobalPosition = typename T::GlobalPosition;
//! state the traits public and thus export all types
using Traits = T;
//! The default constructor
PNMSubControlVolumeFace() = default;
//! Constructor for inner scvfs
PNMSubControlVolumeFace(const GlobalPosition& center,
const GlobalPosition& unitOuterNormal,
const Scalar& area,
GridIndexType scvfIndex,
std::array&& scvIndices)
: center_(center),
unitOuterNormal_(unitOuterNormal),
area_(area),
scvfIndex_(scvfIndex),
scvIndices_(std::move(scvIndices))
{}
//! The center of the sub control volume face
const GlobalPosition& center() const
{ return center_; }
//! The integration point for flux evaluations in global coordinates
const GlobalPosition& ipGlobal() const
{ return center_; }
//! The area of the sub control volume face
Scalar area() const
{ return area_; }
//! We assume to always have a pore body and not a pore throat at the boundary
bool boundary() const
{ return false; }
//! The unit outer normal of the sub control volume face
const GlobalPosition& unitOuterNormal() const
{ return unitOuterNormal_; }
//! Index of the inside sub control volume for spatial param evaluation
LocalIndexType insideScvIdx() const
{ return scvIndices_[0]; }
//! Index of the outside sub control volume for spatial param evaluation
// This results in undefined behaviour if boundary is true
LocalIndexType outsideScvIdx() const
{ return scvIndices_[1]; }
//! The local index of this sub control volume face
GridIndexType index() const
{ return scvfIndex_; }
private:
GlobalPosition center_;
GlobalPosition unitOuterNormal_;
Scalar area_;
GridIndexType scvfIndex_;
std::array scvIndices_;
};
} // end namespace Dumux::PoreNetwork
#endif