Commit 03a7d0f8 authored by Lukas Riedel's avatar Lukas Riedel

Remove unused BC implementations

parent 6bcbacc4
This diff is collapsed.
#ifndef DUNE_DORIE_TRANSPORT_BOUNDARY_HH
#define DUNE_DORIE_TRANSPORT_BOUNDARY_HH
#include <memory>
#include <dune/common/exceptions.hh>
#include <dune/common/parametertree.hh>
#include <dune/dorie/common/boundary_condition.hh>
namespace Dune{
namespace Dorie{
/**
* @brief Interior penalty type for dg methods
* @ingroup LocalOperators
*/
struct DirichletMode
{
enum Type { SoluteConcentration, //!< Solute concentration
TotalSolute, //!< Total solute
};
};
/*-------------------------------------------------------------------------*//**
* @brief Boundary type and condition value queries for solute.
* @details This class containts functions that return the type of boundary
* conditions and the values of the boundary condition parameters.
* Both types of queries can be time dependent.
* @author Dion Häfner
* @date 2016
* @ingroup TransportModel
* @see Same as Dune::Dorie::FlowBoundary.
*
* @todo Allow the user to decide wheter the solute in the boundary is
* total solute or concentration of solute.
*
* @tparam Traits The Dune::Dorie::BaseTraits that defines basic data
* types.
*/
template<typename Traits>
class SoluteBoundary
{
private:
typedef typename Traits::RangeField RF;
typedef typename Traits::Domain Domain;
typedef typename Traits::IntersectionDomain ID;
typedef typename Traits::Intersection Intersection;
enum {dim = Traits::dim};
//! Object for handling the BC data file and function queries
std::unique_ptr<BCReadoutInterface<Traits>> bcDataHandler;
public:
/*-----------------------------------------------------------------------*//**
* @brief Read BC file type and create data handling object
* @see Dune::Dorie::BCReadoutInterface
*
* @param[in] config The configuration parameter three.
* @throws Dune::IOError BC File Type not supported.
*/
SoluteBoundary(const Dune::ParameterTree& config)
{
std::string bcFileType = config.get<std::string>("boundary.fileType");
if(bcFileType == "rectangularGrid") {
bcDataHandler = std::make_unique<RectangularGrid<Traits>>(config);
}
else
DUNE_THROW(IOError,"unknown bcFileType specified!");
}
/*-----------------------------------------------------------------------*//**
* Return next time at which any boundary condition changes. Return -1.0 by
* default
*
* @param time Current time
*
* @return The next time stamp.
*/
RF getNextTimeStamp (const RF& time) const {
if(bcDataHandler)
return bcDataHandler->getNextTimeStamp(time);
return -1.0;
}
/*-----------------------------------------------------------------------*//**
* @brief Return Boundary Condition Type at certain position and time
*
* @param is Intersection enitity.
* @param x Position in local entity coordinates.
* @param time Time value.
*
* @return Boundary Condition type enumerator (BoundaryCondition::Type).
*/
BoundaryCondition::Type bc (const Intersection& is, const ID& x, const RF& time) const
{
const Domain xGlobal = is.geometry().global(x);
if(is.boundary()) {
return bcDataHandler->getBCtype(xGlobal, time);
}
return BoundaryCondition::Other; // unknown
}
/*-----------------------------------------------------------------------*//**
* @brief Dirichlet boundary condition at certain position and time
*
* @param is Intersection enitity
* @param x Position in local entity coordinates
* @param time Time value
*
* @return Value of matric head
*/
RF g (const Intersection& is, const ID& x, const RF& time) const
{
const Domain xGlobal = is.geometry().global(x);
if(is.boundary()) {
if(bcDataHandler)
return bcDataHandler->getDirichletValue(xGlobal, time);
}
return 0.0;
}
/*-----------------------------------------------------------------------*//**
* @brief Neumann boundary condition at certain position and time
*
* @param is Intersection enitity
* @param x Position in local entity coordinates
* @param time Time value
*
* @return Value of flux
*/
RF j (const Intersection& is, const ID& x, const RF& time) const
{
const Domain xGlobal = is.geometry().global(x);
if(is.boundary()) {
if(bcDataHandler)
return bcDataHandler->getNeumannValue(xGlobal, time);
}
return 0.0;
}
/*-----------------------------------------------------------------------*//**
* @brief Outflow boundary condition at certain position and time
*
* @param is Intersection enitity
* @param x Position in local entity coordinates
* @param time Time value
*
* @return Value of outflow
*/
RF o (const Intersection& is, const ID& x, const RF& time) const
{
const Domain xGlobal = is.geometry().global(x);
if(is.boundary()) {
if(bcDataHandler)
return bcDataHandler->getNeumannValue(xGlobal, time);
}
return 0.0;
}
};
}
}
#endif
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