[Transport] Document code

parent 220e6de5
......@@ -16,6 +16,15 @@
namespace Dune{
namespace Dorie{
/**
* @brief Converts PDELab grid function to match a dune-function.
* @note This adapter differs from the one provided in PDELab in that this
* one has the current interface of dune-grid to write vtk files.
* The main difference using this adapter is that it allows to write
* more than 3 components.
*
* @tparam GF PDELab grid function type.
*/
template<class GF>
class VTKGridFunctionAdapter
{
......@@ -26,20 +35,38 @@ class VTKGridFunctionAdapter
using Domain = typename GF::Traits::DomainType;
public:
/**
* @brief Constructs the object
*
* @param[in] gf pointer to a constant grid function
*/
VTKGridFunctionAdapter(std::shared_ptr<const GF> gf)
: _gf(gf)
{}
/**
* @brief Binds an entity to the grid function
*
* @param[in] e Entity
*/
void bind(const Entity& e)
{
_entity = &e;
}
/**
* @brief Unbinds the previously binded entity
*/
void unbind()
{
_entity = nullptr;
}
/**
* @brief Evaluates the grid function at a given coordinate
*
* @param[in] x Local coordinate with respect to the last binded entity
*/
Range operator()(const Domain& x) const
{
Range y;
......@@ -118,9 +145,9 @@ public:
}
/*-----------------------------------------------------------------------*//**
* @brief Clear all the attached VTKFunctions. (Necessary for each
* iteration if VTKFunctions are managed internaly with pointers
* instead of references)
* @brief Clear all the attached VTKFunctions.
* @details This is necessary for each iteration if VTKFunctions are
* managed internaly with pointers instead of references
*/
void clear()
{
......
......@@ -19,14 +19,17 @@ namespace Dorie{
/*-------------------------------------------------------------------------*//**
* @brief Interface and default reader for parameterization factories
*
* @tparam Param { description }
* @tparam Param The parameter type to build
*/
template<class Param>
struct ParameterizationFactory
{
virtual ~ParameterizationFactory() = default;
/**
* @brief Parameterization selector
* @details Given a type_node in yaml, it selects a -polymorphic-
* parameter.
*
* @param[in] type_node YAML node describing the type of parameterization to
* choose from.
......@@ -41,11 +44,15 @@ struct ParameterizationFactory
/**
* @brief Parameterization reader
* @details It reads parameterizations and its parameters. For each volume,
* it assings a index to a parameterization (choosen by the
* parameterization selector) and later filled with the paramaters
* in the yaml file.
*
* @param[in] param_file YAML node with information about the type and the
* parameters.
* @param[in] param_file YAML node with information about type and
* parameters
* @param[in] param_name Name of the parameterization.
* @param[in] log Logger.
* @param[in] log Logger
*
* @return (Unsorted) Map with parameterizations for each material.
*/
......
......@@ -22,6 +22,11 @@
namespace Dune {
namespace Dorie {
/**
* @brief Factory of richards parameters
*
* @tparam Traits The base traits
*/
template<class Traits>
struct RichardsParameterizationFactory
: public ParameterizationFactory<Dorie::Parameterization::Richards<Traits>>
......
......@@ -374,9 +374,14 @@ public:
auto g = _boundary->g(entity_f,center_position_f,_time);
// Convert input to total solute if needed
if (_dirichlet_mode == DirichletMode::TotalSolute)
g /=water_content_i; // FIXME
if (_dirichlet_mode == DirichletMode::TotalSolute)
{
if (Dune::FloatCmp::gt(water_content_i,0.))
g /=water_content_i;
else
g = 0.
}
// Compute the effective hydrodynamic dispersion
auto hydr_disp_i = hydr_disp_func_i(water_flux,water_content_i);
......
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