Commit c23bee5e authored by Andreas Lauser's avatar Andreas Lauser
Browse files

boxmodels/common: doxygen documentation update, remove some fragments

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@4508 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 3e65261d
......@@ -59,14 +59,18 @@ class BoxElementBoundaryTypes : public std::vector<typename GET_PROP_TYPE(TypeTa
typedef typename GridView::IntersectionIterator IntersectionIterator;
public:
// copying a the boundary types of an element should be explicitly
// requested
/*!
* \brief Copy constructor.
*
* Copying a the boundary types of an element should be explicitly
* requested
*/
explicit BoxElementBoundaryTypes(const BoxElementBoundaryTypes &v)
: ParentType(v)
{}
/*!
* \brief The constructor.
* \brief Default constructor.
*/
BoxElementBoundaryTypes()
{
......@@ -76,6 +80,11 @@ public:
/*!
* \brief Update the boundary types for all vertices of an element.
*
* \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 fvElemGeom The element's finite volume geometry
*/
void update(const Problem &problem,
const Element &element,
......@@ -101,14 +110,15 @@ public:
};
/*!
* \brief Returns whether the element has a Dirichlet value.
* \brief Returns whether the element has a vertex which contains
* a Dirichlet value.
*/
bool hasDirichlet() const
{ return hasDirichlet_; }
/*!
* \brief Returns whether the element potentially has a Neumann
* boundary segment.
* \brief Returns whether the element potentially features a
* Neumann boundary segment. .
*/
bool hasNeumann() const
{ return hasNeumann_; }
......
......@@ -30,7 +30,8 @@ namespace Dumux
/*!
* \ingroup BoxModel
*
* \brief This class stores an array of VolumeVariables objects
* \brief This class stores an array of VolumeVariables objects, one
* volume variables object for each of the element's vertices
*/
template<class TypeTag>
class BoxElementVolumeVariables : public std::vector<typename GET_PROP_TYPE(TypeTag, PTAG(VolumeVariables)) >
......@@ -50,6 +51,7 @@ class BoxElementVolumeVariables : public std::vector<typename GET_PROP_TYPE(Type
typedef typename GridView::IntersectionIterator IntersectionIterator;
enum { dim = GridView::dimension };
enum { numEq = GET_PROP_VALUE(TypeTag, PTAG(NumEq)) };
public:
/*!
......@@ -57,8 +59,14 @@ public:
*/
BoxElementVolumeVariables()
{ }
/*!
* \todo please doc me
* \brief Construct the volume variables for all of vertices of an element.
*
* \param problem The problem which needs to be simulated.
* \param element The DUNE Codim<0> entity for which the volume variables ought to be calculated
* \param fvElemGeom The finite volume geometry of the element
* \param oldSol Tells whether the model's previous or current solution should be used.
*/
void update(const Problem &problem,
const Element &element,
......@@ -86,33 +94,41 @@ public:
}
};
//overloaded update function
//possible to give solution vector
template<typename SolVectorType>
void update(const Problem &problem,
const Element &element,
const FVElementGeometry &fvElemGeom,
const SolVectorType& elementSolVector,
const int numEq)
/*!
* \brief Construct the volume variables for all of vertices of an
* element given a solution vector computed by PDELab.
*
* \tparam ElemSolVectorType The container type which stores the
* primary variables of the element
* using _local_ indices
*
* \param problem The problem which needs to be simulated.
* \param element The DUNE Codim<0> entity for which the volume variables ought to be calculated
* \param fvElemGeom The finite volume geometry of the element
* \param elementSolVector The local solution for the element using PDELab ordering
*/
template<typename ElemSolVectorType>
void updatePDELab(const Problem &problem,
const Element &element,
const FVElementGeometry &fvElemGeom,
const ElemSolVectorType& elementSolVector)
{
int n = element.template count<dim>();
this->resize(n);
for (int vertexIdx = 0; vertexIdx < n; vertexIdx++)
{
int n = element.template count<dim>();
this->resize(n);
for (int vertexIdx= 0; vertexIdx < n; vertexIdx++)
{
PrimaryVariables solI(0);
for (int eqnIdx=0; eqnIdx<numEq; eqnIdx++)
{
solI[eqnIdx] = elementSolVector[vertexIdx+eqnIdx*n];
}
(*this)[vertexIdx].update(solI,
PrimaryVariables solI(0);
for (int eqnIdx=0; eqnIdx<numEq; eqnIdx++)
solI[eqnIdx] = elementSolVector[vertexIdx + eqnIdx*n];
(*this)[vertexIdx].update(solI,
problem,
element,
fvElemGeom,
vertexIdx,
false);
}
};
}
};
};
} // namespace Dumux
......
......@@ -16,7 +16,8 @@
/*!
* \file
*
* \brief Element-wise geometric data for the box method
* \brief Represents the finite volume geometry of a single element in
* the box scheme.
*/
#ifndef DUMUX_BOX_FV_ELEMENTGEOMETRY_HH
#define DUMUX_BOX_FV_ELEMENTGEOMETRY_HH
......@@ -43,8 +44,9 @@ NEW_PROP_TAG(Scalar);
// specialize member functions of template classes because of some
// weird reason I didn't really get...
/** \todo Please doc me! */
/*!
* \internal
*/
template <typename BoxFVElementGeometry, int dim>
class _BoxFVElemGeomHelper
{
......@@ -55,7 +57,9 @@ public:
};
};
/*! \internal */
/*!
* \internal
*/
template <typename BoxFVElementGeometry>
class _BoxFVElemGeomHelper<BoxFVElementGeometry, 1>
{
......@@ -69,8 +73,9 @@ public:
}
};
/** \todo Please doc me! */
/*!
* \internal
*/
template <typename BoxFVElementGeometry>
class _BoxFVElemGeomHelper<BoxFVElementGeometry, 2>
{
......@@ -105,8 +110,9 @@ public:
}
};
/** \todo Please doc me! */
/*!
* \internal
*/
template <typename BoxFVElementGeometry>
class _BoxFVElemGeomHelper<BoxFVElementGeometry, 3>
{
......@@ -283,8 +289,22 @@ public:
// END HACK
/////////////////////
/** \todo Please doc me! */
/*!
* \brief Represents the finite volume geometry of a single element in
* the box scheme.
*
* The box scheme is a vertex centered finite volume approach. This
* means that each vertex corrosponds to a control volume which
* intersects each of the vertex' neighboring elements. If only
* looking at a single element of the primary grid (which is what this
* class does), the element is subdivided into multiple fragments of
* control volumes called sub-control volumes. Each of the element's
* vertices corrosponds to exactly one sub-control volume in this
* scenario.
*
* For the box methods the sub-control volumes are constructed by
* connecting the element's center with each edge of the element.
*/
template<class TypeTag>
class BoxFVElementGeometry
{
......
......@@ -21,7 +21,7 @@
*****************************************************************************/
/*!
* \file
* \brief Caculates the jacobian of models based on the box scheme element-wise.
* \brief Caculates the Jacobian of the local residual for box models
*/
#ifndef DUMUX_BOX_LOCAL_JACOBIAN_HH
#define DUMUX_BOX_LOCAL_JACOBIAN_HH
......@@ -34,10 +34,7 @@ namespace Dumux
{
/*!
* \ingroup BoxModel
* \brief Element-wise caculation of the jacobian matrix for models
* based on the box scheme .
*
* \todo Please doc me more!
* \brief Caculates the Jacobian of the local residual for box models
*/
template<class TypeTag>
class BoxLocalJacobian
......@@ -96,12 +93,17 @@ private:
public:
BoxLocalJacobian()
{
Valgrind::SetUndefined(problemPtr_);
notReassembled = 0;
}
{ Valgrind::SetUndefined(problemPtr_); }
/*!
* \brief Initialize the local Jacobian object.
*
* At this point we can assume that everything has been allocated,
* although some objects may not yet be completely initialized.
*
* \param prob The problem which we want to simulate.
*/
void init(Problem &prob)
{
problemPtr_ = &prob;
......@@ -110,10 +112,11 @@ public:
A_.setSize(2<<dim, 2<<dim);
}
int notReassembled;
/*!
* \brief Assemble the linear system of equations for the
* verts of a element, given a local solution 'localU'.
* \brief Assemble an element's local Jacobian matrix of the
* defect.
*
* \param element The DUNE Codim<0> entity which we look at.
*/
void assemble(const Element &element)
{
......@@ -124,7 +127,6 @@ public:
int elemColor = jacAsm_().elementColor(element);
if (elemColor == Green) {
++notReassembled;
// Green elements don't need to be reassembled
return;
}
......@@ -182,8 +184,13 @@ public:
{ return localResidual_; }
/*!
* \brief Returns the jacobian of the equations at vertex i to the
* \brief Returns the Jacobian of the equations at vertex i to the
* primary variables at vertex j.
*
* \param i The local vertex (or sub-contol volume) index on which
* the equations are defined
* \param j The local vertex (or sub-contol volume) index which holds
* primary variables
*/
const MatrixBlock &mat(int i, int j) const
{ return A_[i][j]; }
......
......@@ -105,6 +105,9 @@ public:
/*!
* \brief Compute the local residual, i.e. the deviation of the
* equations from zero.
*
* \param element The DUNE Codim<0> entity for which the residual
* ought to be calculated
*/
void eval(const Element &element)
{
......@@ -137,6 +140,9 @@ public:
*
* This can be used to figure out how much of each conservation
* quantity is inside the element.
*
* \param element The DUNE Codim<0> entity for which the storage
* term ought to be calculated
*/
void evalStorage(const Element &element)
{
......@@ -160,6 +166,11 @@ public:
/*!
* \brief Compute the flux term for the current solution.
*
* \param element The DUNE Codim<0> entity for which the residual
* ought to be calculated
* \param curVolVars The volume averaged variables for all
* sub-contol volumes of the element
*/
void evalFluxes(const Element &element,
const ElementVolumeVariables &curVolVars)
......@@ -184,6 +195,14 @@ public:
/*!
* \brief Compute the local residual, i.e. the deviation of the
* equations from zero.
*
* \param element The DUNE Codim<0> entity for which the residual
* ought to be calculated
* \param fvGeom The finite-volume geometry of the element
* \param curVolVars The volume averaged variables for all
* sub-contol volumes of the element
* \param bcTypes The types of the boundary conditions for all
* vertices of the element
*/
void eval(const Element &element,
const FVElementGeometry &fvGeom,
......@@ -235,6 +254,9 @@ public:
/*!
* \brief Returns the local residual for a given sub-control
* volume of the element.
*
* \param scvIdx The local index of the sub-control volume
* (i.e. the element's local vertex index)
*/
const PrimaryVariables &residual(int scvIdx) const
{ return residual_[scvIdx]; }
......@@ -242,6 +264,9 @@ public:
/*!
* \brief Returns the local residual for a given sub-control
* volume of the element - as a reference!
*
* \param scvIdx The local index of the sub-control volume
* (i.e. the element's local vertex index)
*/
PrimaryVariables& residualReference(int scvIdx)
{ return residual_[scvIdx]; }
......@@ -253,6 +278,9 @@ protected:
const Implementation &asImp_() const
{ return *static_cast<const Implementation*>(this); }
/*!
* \brief Evaluate all boundary conditions on the current element.
*/
void evalBoundary_()
{
if (bcTypes_().hasNeumann())
......@@ -260,7 +288,11 @@ protected:
if (bcTypes_().hasDirichlet())
asImp_().evalDirichlet_();
}
// set the values of the Dirichlet control volumes
/*!
* \brief Set the values of the Dirichlet boundary control volumes
* of the current element.
*/
void evalDirichlet_()
{
PrimaryVariables tmp;
......@@ -284,7 +316,10 @@ protected:
};
}
// evaluate the neumann boundary segments
/*!
* \brief Add all Neumann boundary conditions to the local
* residual.
*/
void evalNeumann_()
{
Dune::GeometryType geoType = elem_().geometry().type();
......@@ -323,7 +358,10 @@ protected:
}
}
// handle Neumann boundary conditions for a single sub-control volume face
/*!
* \brief Add Neumann boundary conditions for a single sub-control
* volume face to the local residual.
*/
void evalNeumannSegment_(const IntersectionIterator &isIt,
int scvIdx,
int boundaryFaceIdx)
......@@ -346,6 +384,10 @@ protected:
}
}
/*!
* \brief Add the flux terms to the local residual of all
* sub-control volumes of the current element.
*/
void evalFluxes_()
{
// calculate the mass flux over the faces and subtract
......@@ -369,6 +411,10 @@ protected:
}
}
/*!
* \brief Set the local residual to the storage terms of all
* sub-control volumes of the current element.
*/
void evalStorage_()
{
// calculate the amount of conservation each quantity inside
......@@ -380,6 +426,11 @@ protected:
}
}
/*!
* \brief Add the change in the storage terms and the source term
* to the local residual of all sub-control volumes of the
* current element.
*/
void evalVolumeTerms_()
{
// evaluate the volume terms (storage + source terms)
......@@ -437,51 +488,95 @@ protected:
*/
const VertexMapper &vertexMapper_() const
{ return problem_().vertexMapper(); };
/*!
* \brief Returns a reference to the grid view.
*/
const GridView &gridView_() const
{ return problem_().gridView(); }
/*!
* \brief Returns a reference to the current element.
*/
const Element &elem_() const
{
Valgrind::CheckDefined(elemPtr_);
return *elemPtr_;
}
/*!
* \brief Returns a reference to the current element's finite
* volume geometry.
*/
const FVElementGeometry &fvElemGeom_() const
{
Valgrind::CheckDefined(fvElemGeomPtr_);
return *fvElemGeomPtr_;
}
/*!
* \brief Returns a reference to the primary variables of the i'th
* sub-control volume of the current element.
*/
const PrimaryVariables &curPrimaryVars_(int i) const
{
return curVolVars_(i).primaryVars();
}
/*!
* \brief Returns a reference to the current volume variables of
* all sub-control volumes of the current element.
*/
const ElementVolumeVariables &curVolVars_() const
{
Valgrind::CheckDefined(curVolVarsPtr_);
return *curVolVarsPtr_;
}
/*!
* \brief Returns a reference to the volume variables of the i-th
* sub-control volume of the current element.
*/
const VolumeVariables &curVolVars_(int i) const
{
return curVolVars_()[i];
}
/*!
* \brief Returns a reference to the previous time step's volume
* variables of all sub-control volumes of the current
* element.
*/
const ElementVolumeVariables &prevVolVars_() const
{
Valgrind::CheckDefined(prevVolVarsPtr_);
return *prevVolVarsPtr_;
}
/*!
* \brief Returns a reference to the previous time step's volume
* variables of the i-th sub-control volume of the current
* element.
*/
const VolumeVariables &prevVolVars_(int i) const
{
return prevVolVars_()[i];
}
/*!
* \brief Returns a reference to the boundary types of all
* sub-control volumes of the current element.
*/
const ElementBoundaryTypes &bcTypes_() const
{
Valgrind::CheckDefined(bcTypesPtr_);
return *bcTypesPtr_;
}
/*!
* \brief Returns a reference to the boundary types of the i-th
* sub-control volume of the current element.
*/
const BoundaryTypes &bcTypes_(int i) const
{
return bcTypes_()[i];
......
......@@ -110,6 +110,9 @@ public:
/*!
* \brief Apply the initial conditions to the model.
*
* \param prob The object representing the problem which needs to
* be simulated.
*/
void init(Problem &prob)
{
......@@ -136,6 +139,9 @@ public:
/*!
* \brief Compute the global residual for an arbitrary solution
* vector.
*
* \param dest Stores the result
* \param u The solution for which the residual ought to be calculated
*/
Scalar globalResidual(SolutionVector &dest,
const SolutionVector &u)
......@@ -150,6 +156,8 @@ public:
/*!
* \brief Compute the global residual for the current solution
* vector.
*
* \param dest Stores the result
*/
Scalar globalResidual(SolutionVector &dest)
{
......@@ -178,7 +186,10 @@ public:
}
/*!
* \brief Compute the total storage of all conservation quantities.
* \brief Compute the integral over the domain of the storage
* terms of all conservation quantities.
*
* \param dest Stores the result
*/
void globalStorage(PrimaryVariables &dest)
{
......@@ -197,7 +208,10 @@ public:
}
/*!
* \brief Returns the volume of a given control volume.
* \brief Returns the volume [m^3] of a given control volume.
*
* \param globalIdx The global index of the control volume's
* associated vertex
*/
Scalar boxVolume(int globalIdx) const
{ return boxVolume_[globalIdx][0]; }
......@@ -206,30 +220,13 @@ public:
* \brief Reference to the current solution as a block vector.
*/
const SolutionVector &curSol() const
{
return uCur_;
if (enablePartialReassemble &&
jacobianAssembler().inJacobianAssemble())
{
return jacobianAssembler().evalPoint();
}
return uCur_;
}
{ return uCur_; }
/*!
* \brief Reference to the current solution as a block vector.
*/
SolutionVector &curSol()
{
return uCur_;
if (enablePartialReassemble &&
jacobianAssembler().inJacobianAssemble())
{
return jacobianAssembler().evalPoint();
}
return uCur_;
}
{ return uCur_; }
/*!