Commit 1cca82a3 authored by Dennis Gläser's avatar Dennis Gläser
Browse files

move element boundary types to discretization folder

parent cdff8cc3
......@@ -23,40 +23,29 @@
#ifndef DUMUX_BOX_ELEMENT_BOUNDARY_TYPES_HH
#define DUMUX_BOX_ELEMENT_BOUNDARY_TYPES_HH
#include <dumux/common/valgrind.hh>
#include <dumux/common/properties.hh>
namespace Dumux
{
/*!
* \ingroup BoxModel
* \ingroup ImplicitBoundaryTypes
* \brief This class stores an array of BoundaryTypes objects
*/
template<class TypeTag>
class BoxElementBoundaryTypes : public std::vector<typename GET_PROP_TYPE(TypeTag, BoundaryTypes) >
class BoxElementBoundaryTypes
{
typedef typename GET_PROP_TYPE(TypeTag, BoundaryTypes) BoundaryTypes;
typedef std::vector<BoundaryTypes> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, Problem) Problem;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, FVElementGeometry) FVElementGeometry;
using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
using Element = typename GridView::template Codim<0>::Entity;
using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVElementGeometry);
using SubControlVolume = typename GET_PROP_TYPE(TypeTag, SubControlVolume);
using LocalIndexType = typename SubControlVolume::Traits::LocalIndexType;
enum { dim = GridView::dimension };
typedef typename GridView::template Codim<0>::Entity Element;
public:
/*!
* \brief Copy constructor.
*
* Copying a the boundary types of an element should be explicitly
* requested
*/
explicit BoxElementBoundaryTypes(const BoxElementBoundaryTypes &v)
: ParentType(v)
{}
/*!
* \brief Default constructor.
*/
......@@ -79,26 +68,24 @@ public:
const Element &element,
const FVElementGeometry &fvGeometry)
{
int numVertices = element.subEntities(dim);
this->resize(numVertices);
vertexBCTypes_.resize( element.subEntities(dim) );
hasDirichlet_ = false;
hasNeumann_ = false;
hasOutflow_ = false;
for (auto&& scv : scvs(fvGeometry))
for (const auto& scv : scvs(fvGeometry))
{
int scvIdxLocal = scv.indexInElement();
(*this)[scvIdxLocal].reset();
vertexBCTypes_[scvIdxLocal].reset();
if (fvGeometry.fvGridGeometry().dofOnBoundary(scv.dofIndex()))
{
(*this)[scvIdxLocal] = problem.boundaryTypes(element, scv);
vertexBCTypes_[scvIdxLocal] = problem.boundaryTypes(element, scv);
hasDirichlet_ = hasDirichlet_ || (*this)[scvIdxLocal].hasDirichlet();
hasNeumann_ = hasNeumann_ || (*this)[scvIdxLocal].hasNeumann();
hasOutflow_ = hasOutflow_ || (*this)[scvIdxLocal].hasOutflow();
hasDirichlet_ = hasDirichlet_ || vertexBCTypes_[scvIdxLocal].hasDirichlet();
hasNeumann_ = hasNeumann_ || vertexBCTypes_[scvIdxLocal].hasNeumann();
hasOutflow_ = hasOutflow_ || vertexBCTypes_[scvIdxLocal].hasOutflow();
}
}
}
......@@ -138,7 +125,18 @@ public:
bool hasOutflow() const
{ return hasOutflow_; }
/*
* \brief Access operator
* \return BoundaryTypes
*/
const BoundaryTypes& operator[] (LocalIndexType i) const
{
assert(i < vertexBCTypes_.size());
return vertexBCTypes_[i];
}
protected:
std::vector< BoundaryTypes > vertexBCTypes_;
bool hasDirichlet_;
bool hasNeumann_;
bool hasOutflow_;
......
......@@ -32,15 +32,15 @@
#include <dumux/common/properties.hh>
#include <dumux/common/boundaryflag.hh>
#include <dumux/assembly/boxlocalresidual.hh>
#include <dumux/discretization/methods.hh>
#include <dumux/discretization/fvproperties.hh>
#include <dumux/implicit/box/elementboundarytypes.hh>
#include <dumux/assembly/boxlocalresidual.hh>
#include <dumux/discretization/box/subcontrolvolume.hh>
#include <dumux/discretization/box/subcontrolvolumeface.hh>
#include <dumux/discretization/box/elementsolution.hh>
#include <dumux/discretization/box/elementboundarytypes.hh>
#include <dumux/discretization/box/globalfluxvariablescache.hh>
#include <dumux/discretization/box/elementfluxvariablescache.hh>
#include <dumux/discretization/box/globalvolumevariables.hh>
......
......@@ -23,15 +23,17 @@
#ifndef DUMUX_CC_ELEMENT_BOUNDARY_TYPES_HH
#define DUMUX_CC_ELEMENT_BOUNDARY_TYPES_HH
#include <dumux/common/valgrind.hh>
#include <dumux/common/properties.hh>
namespace Dumux
{
/*!
* \ingroup CCModel
* \ingroup ImplicitBoundaryTypes
* \brief This class stores an array of BoundaryTypes objects
* \brief This class exists only for compatibility purposes with the
* box scheme. The cell-centered schemes and the box scheme use
* a common base local residual, which passes an ElementBoundaryTypes
* object to the implemented interfaces.
*/
template<class TypeTag>
class CCElementBoundaryTypes
......@@ -49,6 +51,7 @@ public:
* \param problem The problem object which needs to be simulated
* \param element The DUNE Codim<0> entity for which the boundary
* types should be collected
* \param fvGeometry The element finite volume geometry
*/
void update(const Problem &problem,
const Element &element,
......
......@@ -32,15 +32,15 @@
#include <dumux/common/properties.hh>
#include <dumux/assembly/cclocalresidual.hh>
#include <dumux/discretization/methods.hh>
#include <dumux/discretization/fvproperties.hh>
#include <dumux/implicit/cellcentered/elementboundarytypes.hh>
#include <dumux/assembly/cclocalresidual.hh>
#include <dumux/discretization/cellcentered/globalvolumevariables.hh>
#include <dumux/discretization/cellcentered/subcontrolvolume.hh>
#include <dumux/discretization/cellcentered/elementsolution.hh>
#include <dumux/discretization/cellcentered/elementboundarytypes.hh>
#include <dumux/discretization/cellcentered/mpfa/methods.hh>
#include <dumux/discretization/cellcentered/mpfa/connectivitymap.hh>
......
......@@ -34,15 +34,15 @@
#include <dumux/common/properties.hh>
#include <dumux/common/boundaryflag.hh>
#include <dumux/assembly/cclocalresidual.hh>
#include <dumux/discretization/methods.hh>
#include <dumux/discretization/fvproperties.hh>
#include <dumux/discretization/cellcentered/globalvolumevariables.hh>
#include <dumux/discretization/cellcentered/subcontrolvolume.hh>
#include <dumux/implicit/cellcentered/elementboundarytypes.hh>
#include <dumux/assembly/cclocalresidual.hh>
#include <dumux/discretization/cellcentered/elementboundarytypes.hh>
#include <dumux/discretization/cellcentered/connectivitymap.hh>
#include <dumux/discretization/cellcentered/elementsolution.hh>
#include <dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh>
......
add_subdirectory(box)
add_subdirectory(cellcentered)
install(FILES
assembler.hh
localjacobian.hh
localresidual.hh
model.hh
problem.hh
properties.hh
propertydefaults.hh
volumevariables.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/implicit)
#install headers
install(FILES
intersectiontovertexbc.hh
elementboundarytypes.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/implicit/box)
#install headers
install(FILES
elementboundarytypes.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/implicit/cellcentered)
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