Commit a90cca24 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#875 ParameterAtDof: finalize Doxygen comments.

parent 08444e9e
......@@ -21,29 +21,27 @@ namespace HappyHeart
/*!
* \brief Convenient alias for a parameter defined at dof.
* \brief Traits class that provide the type for a parameter defined at dof.
*
* Type of said Parameter is:
*
* \code
* using type = ParameterAtDof<TypeT, NfeltSpace>::type;
* \endcode
*
* Its expected constructor should follow the prototype:
*
* \code
* ParameterAtDof(const GeometricMeshRegion& mesh,
* const FEltSpace& felt_space,
* const FEltSpace& felt_space, // one such line for each \a NfeltSpace
* const Unknown& unknown,
* const GlobalVector& global_vector);
* \endcode
*
* where:
* - mesh Geometric mesh region considered. It is actually unused for this kind Parameter, but required nonetheless
* to conform to generic parameter interface.
* - felt_space Finite element space that covers the area upon which the parameter should be
* defined.
* - unknown A scalar or vectorial unknown that acts a bit as a strawman: dofs are defined only
* in relationship to an unknown, so you must create one if none fulfill your purposes (for instance
* if you deal with a vectorial unknown and need a scalar Dof field, you must create another unknown
* only for ther Parameter). To save space, it's better if this unknown is in its own numbering subset,
* but this is not mandatory.
* - global_vector The vector which includes the actual values at the dofs. The values
* at dofs may evolve should this vector change.
* \copydetails doxygen_hide_at_dof_impl_constructor_args
*
* \copydetails doxygen_hide_at_dof_policy_tparam
*
*/
template
......@@ -54,20 +52,23 @@ namespace HappyHeart
struct ParameterAtDof
{
private:
/*!
* \brief Alias which the proper prototype for \a ParameterInstance.
*
* \a ParameterNS::Policy::AtDof does not work directly, as there are 2 template arguments whereas
* template template argument of \a ParameterInstance expects only one.
*/
template<ParameterNS::Type TypeTT>
using intermediate_policy_type = ParameterNS::Policy::AtDofImpl<TypeTT, NfeltSpace>;
using intermediate_policy_type = ParameterNS::Policy::AtDof<TypeTT, NfeltSpace>;
public:
//! Alias which provides the parameter type.
using type = Private::ParameterInstance<TypeT, intermediate_policy_type>;
};
//
// template<ParameterNS::Type TypeT>
// using ParameterAtDof_2FEltSpace = Private::ParameterInstance<TypeT, ParameterNS::Policy::AtDof_2FEltSpace>;
//
} // namespace HappyHeart
......
......@@ -59,6 +59,16 @@ namespace HappyHeart
{
/*!
* \class doxygen_hide_at_dof_policy_tparam
*
* \tparam TypeT \a ParameterNS::Type might be scalar or vectorial (matrix is forbidden at the moment).
* \tparam NfeltSpace If 1, only one \a FEltSpace is expected; of any dimension.
* If 2, two are expected: one that deals with \a LocalFEltSpace the same dimension of the mesh, the other
* for this dimension minus 1. 3 is possible as well, going up to dimension minus 2.
*/
/*!
* \brief Parameter policy when the parameter is expressed at dofs.
*
......@@ -67,23 +77,25 @@ namespace HappyHeart
* \internal <b><tt>[internal]</tt></b> Also at the moment values are always fetched from the global vector;
* it's safer but might be less efficient if the global vector is actually never modified.
*
* \tparam TypeT \a ParameterNS::Type might be scalar or vectorial (matrix is forbidden at the moment).
* \tparam Ndim If 1, only one \a FEltSpace is expected; of any dimension.
* If 2, two are expected: one that deals with \a LocalFEltSpace the same dimension of the mesh, the other
* for this dimension minus 1. 3 is possible as well, going up to dimension minus 2.
* \copydetails doxygen_hide_at_dof_policy_tparam
*
* \attention This policy can't be used directly within ParameterInstance: ParameterInstance expects
* only one template argument, whereas here two are displayed. You should look at \a ParameterAtDof
* struct to see how to work around this issue (and you shouldn't anyway have to use current policy directly:
* that'sthe whole point of \a ParameterAtDof...).
*/
template
<
ParameterNS::Type TypeT,
unsigned int Ndim = 1
unsigned int NfeltSpace = 1
>
class AtDofImpl
class AtDof
{
public:
//! Alias to self.
using self = AtDofImpl<TypeT, Ndim>;
using self = AtDof<TypeT, NfeltSpace>;
private:
......@@ -119,9 +131,6 @@ namespace HappyHeart
* \param[in] global_vector The vector which includes the actual values at the dofs. The values
* at dofs may evolve should this vector change.
*
* \todo #700 Introduce a policy here so that constant values in time may be addressed with more
* efficiency (currently values at quadrature points are recomputed each time a value is required
* there).
*/
......@@ -136,7 +145,7 @@ namespace HappyHeart
* defined. This finite element space should cover the underlying \a NumberingSubset of \a global_vector.
*
*/
explicit AtDofImpl(const GeometricMeshRegion& mesh,
explicit AtDof(const GeometricMeshRegion& mesh,
const FEltSpace& felt_space,
const Unknown& unknown,
const GlobalVector& global_vector);
......@@ -156,7 +165,7 @@ namespace HappyHeart
* (e.g. finite element space that cover borders on a 2D mesh).
*
*/
explicit AtDofImpl(const GeometricMeshRegion& mesh,
explicit AtDof(const GeometricMeshRegion& mesh,
const FEltSpace& felt_space_dim,
const FEltSpace& felt_space_dim_minus_1,
const Unknown& unknown,
......@@ -164,19 +173,19 @@ namespace HappyHeart
//! Destructor.
~AtDofImpl() = default;
~AtDof() = default;
//! Copy constructor.
AtDofImpl(const AtDofImpl&) = delete;
AtDof(const AtDof&) = delete;
//! Move constructor.
AtDofImpl(AtDofImpl&&) = delete;
AtDof(AtDof&&) = delete;
//! Copy affectation.
AtDofImpl& operator=(const AtDofImpl&) = delete;
AtDof& operator=(const AtDof&) = delete;
//! Move affectation.
AtDofImpl& operator=(AtDofImpl&&) = delete;
AtDof& operator=(AtDof&&) = delete;
///@}
......@@ -233,7 +242,7 @@ namespace HappyHeart
* \brief Finite element space to which the Parameter belongs to.
*
*/
Private::AtDofNS::FEltSpaceStorage<Ndim> felt_space_storage_;
Private::AtDofNS::FEltSpaceStorage<NfeltSpace> felt_space_storage_;
/*!
* \brief Unknown used to enumerate the dofs considered by the parameter.
......@@ -259,17 +268,6 @@ namespace HappyHeart
};
// template<ParameterNS::Type TypeT, unsigned int NfeltSpace>
// using AtDof = AtDofImpl<TypeT, NfeltSpace>;
template<ParameterNS::Type TypeT>
using AtDof = AtDofImpl<TypeT, 1>;
template<ParameterNS::Type TypeT>
using AtDof_2FEltSpace = AtDofImpl<TypeT, 2>;
} //namespace Policy
......
......@@ -2,7 +2,7 @@
//! \file
//
//
// AtDofImpl.hxx
// AtDof.hxx
// HappyHeart
//
// Created by Sebastien Gilles on 02/10/15.
......@@ -30,7 +30,7 @@ namespace HappyHeart
ParameterNS::Type TypeT,
unsigned int Ndim
>
AtDofImpl<TypeT, Ndim>::AtDofImpl(const GeometricMeshRegion& mesh,
AtDof<TypeT, Ndim>::AtDof(const GeometricMeshRegion& mesh,
const FEltSpace& felt_space,
const Unknown& unknown,
const GlobalVector& global_vector)
......@@ -65,11 +65,11 @@ namespace HappyHeart
ParameterNS::Type TypeT,
unsigned int Ndim
>
AtDofImpl<TypeT, Ndim>::AtDofImpl(const GeometricMeshRegion& mesh,
const FEltSpace& felt_space_dim,
const FEltSpace& felt_space_dim_minus_1,
const Unknown& unknown,
const GlobalVector& global_vector)
AtDof<TypeT, Ndim>::AtDof(const GeometricMeshRegion& mesh,
const FEltSpace& felt_space_dim,
const FEltSpace& felt_space_dim_minus_1,
const Unknown& unknown,
const GlobalVector& global_vector)
: felt_space_storage_(felt_space_dim, felt_space_dim_minus_1),
unknown_(unknown),
global_vector_(global_vector)
......@@ -102,7 +102,7 @@ namespace HappyHeart
ParameterNS::Type TypeT,
unsigned int Ndim
>
typename AtDofImpl<TypeT, Ndim>::return_type AtDofImpl<TypeT, Ndim>
typename AtDof<TypeT, Ndim>::return_type AtDof<TypeT, Ndim>
::GetValueFromPolicy(const QuadraturePoint& quad_pt,
const GeometricElt& geom_elt) const
{
......@@ -146,9 +146,9 @@ namespace HappyHeart
ParameterNS::Type TypeT,
unsigned int Ndim
>
void AtDofImpl<TypeT, Ndim>::WriteFromPolicy(std::ostream& out) const
void AtDof<TypeT, Ndim>::WriteFromPolicy(std::ostream& out) const
{
out << "AtDofImpl<TypeT, Ndim>::WriteFromPolicy() is not activated at the moment; you can however ask instead "
out << "AtDof<TypeT, Ndim>::WriteFromPolicy() is not activated at the moment; you can however ask instead "
<< "for GetGlobalVector() and then use one of its method to see its content." << std::endl;
}
......@@ -158,8 +158,8 @@ namespace HappyHeart
ParameterNS::Type TypeT,
unsigned int Ndim
>
[[noreturn]] typename AtDofImpl<TypeT, Ndim>::return_type
AtDofImpl<TypeT, Ndim>::GetConstantValueFromPolicy() const
[[noreturn]] typename AtDof<TypeT, Ndim>::return_type
AtDof<TypeT, Ndim>::GetConstantValueFromPolicy() const
{
assert(false && "Should yield IsConstant() = false!");
exit(-1);
......@@ -171,7 +171,7 @@ namespace HappyHeart
ParameterNS::Type TypeT,
unsigned int Ndim
>
inline bool AtDofImpl<TypeT, Ndim>::IsConstant() const noexcept
inline bool AtDof<TypeT, Ndim>::IsConstant() const noexcept
{
return false;
}
......@@ -182,7 +182,7 @@ namespace HappyHeart
ParameterNS::Type TypeT,
unsigned int Ndim
>
inline const GlobalVector& AtDofImpl<TypeT, Ndim>::GetGlobalVector() const noexcept
inline const GlobalVector& AtDof<TypeT, Ndim>::GetGlobalVector() const noexcept
{
return global_vector_;
}
......@@ -193,7 +193,7 @@ namespace HappyHeart
ParameterNS::Type TypeT,
unsigned int Ndim
>
inline const Unknown& AtDofImpl<TypeT, Ndim>::GetUnknown() const noexcept
inline const Unknown& AtDof<TypeT, Ndim>::GetUnknown() const noexcept
{
return unknown_;
}
......@@ -204,7 +204,7 @@ namespace HappyHeart
ParameterNS::Type TypeT,
unsigned int Ndim
>
inline const FEltSpace& AtDofImpl<TypeT, Ndim>::GetFEltSpace(const GeometricElt& geom_elt) const noexcept
inline const FEltSpace& AtDof<TypeT, Ndim>::GetFEltSpace(const GeometricElt& geom_elt) const noexcept
{
return felt_space_storage_.GetFEltSpace(geom_elt);
}
......
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