Commit 75b900fa authored by Santiago Ospina's avatar Santiago Ospina
Browse files

Documentation for all new finite elements.


Signed-off-by: Santiago Ospina De Los Ríos's avatarSantiago Ospina <santiago.ospina@iup.uni-heidelberg.de>
parent 2a4bd16d
......@@ -56,8 +56,9 @@ public:
}
private:
//! The vector of local keys.
//! The size.
std::size_t _s;
//! The vector of local keys.
std::vector<Dune::LocalKey> li;
};
......
......@@ -9,13 +9,30 @@
namespace Dune{
namespace Dorie{
template<unsigned int dim, class D, class R,class SF=R, class CF=SF>
/*-------------------------------------------------------------------------*//**
* @brief Discontinuous Galerkin Raviart thomas for simplices
* @f$\mathcal{RT}_k^{dg}\f$.
* @details This class is equivalent to
* Dune::RaviartThomasSimplexLocalFiniteElement but with local keys
* corresponding to discontinuous galerkin methods, that is, all
* shape functions are associated to entities of codimension 0.
* @author Santiago Ospina De Los Ríos
* @date 2018
* @ingroup FiniteElement
* @see Dune::Dorie::DGLocalCoefficients
*
* @tparam dim World dimension.
* @tparam DF Domain field.
* @tparam RF Range field.
* @tparam SF Storage field for basis matrix.
* @tparam CF Compute field for basis matrix.
*/
template<unsigned int dim, class DF, class RF,class SF=RF, class CF=SF>
class RaviartThomasSimplexDGLocalFiniteElement
: public Dune::RaviartThomasSimplexLocalFiniteElement<dim,D,R,SF,CF>
: public Dune::RaviartThomasSimplexLocalFiniteElement<dim,DF,RF,SF,CF>
{
using LocalCoefficients = Dune::Dorie::DGLocalCoefficients;
using Base = Dune::RaviartThomasSimplexLocalFiniteElement<dim,D,R,SF,CF>;
using Base = Dune::RaviartThomasSimplexLocalFiniteElement<dim,DF,RF,SF,CF>;
public:
using Traits = Dune::LocalFiniteElementTraits<
......@@ -23,25 +40,50 @@ public:
LocalCoefficients,
typename Base::Traits::LocalInterpolationType>;
/** \todo Please doc me */
RaviartThomasSimplexDGLocalFiniteElement(const Dune::GeometryType &gt, unsigned int k)
: Base(gt, k), local_coefficients((dim == 2) ? (k+1)*(k+3) : (k+1)*(k+2)*(k+4)/2)
/*-----------------------------------------------------------------------*//**
* @brief Constructor of the class.
*
* @param[in] gt Geometry type (only simplices).
* @param[in] k Order of the Raviart Thomas finite element.
*/
RaviartThomasSimplexDGLocalFiniteElement(
const Dune::GeometryType &gt,
unsigned int k
) : Base(gt, k)
, local_coefficients((dim == 2) ? (k+1)*(k+3) : (k+1)*(k+2)*(k+4)/2)
{
// TODO assert dim 2 and 3 and gt ==simplex
assert(gt.isSimplex());
}
/** \todo Please doc me !
/*-----------------------------------------------------------------------*//**
* @brief The local basis for this finite element.
* @see Dune::RaviartThomasSimplexLocalFiniteElement.
*
* @return The local basis.
*/
const typename Traits::LocalBasisType& localBasis () const
{
return Base::localBasis();
}
/*-----------------------------------------------------------------------*//**
* @brief The local coefficients for this finite element.
* @see Dune::Dorie::DGLocalCoefficients
*
* @return The local coefficients.
*/
const typename Traits::LocalCoefficientsType& localCoefficients () const
{
return local_coefficients;
}
/*-----------------------------------------------------------------------*//**
* @brief The local interpolation for this finite element.
* @see Dune::RaviartThomasSimplexLocalFiniteElement.
*
* @return The local interpolation.
*/
const typename Traits::LocalInterpolationType& localInterpolation () const
{
return Base::localInterpolation();
......
......@@ -8,6 +8,30 @@
namespace Dune{
namespace Dorie{
/**
* @brief Finite element map for discontinuous galerkin raviart thomas
* elements
* @f$\mathcal{RT}_k^{dg}\f$ in simplicies.
* @details This class implements a dune-pdelab finite element map
* Dune::Dorie::RaviartThomasSimplexDGLocalFiniteElement
*
* Available elements:
* <table> <tr> <th colspan="2">Order</th> <th>0</th> <th>1</th>
* <th>2</th> <th>3</th> </tr> <tr> <td>2D</td> <td>Simplex</td>
* <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr>
* <td>3D</td> <td>Simplex</td> <td>✓</td> <td>✓</td> <td>✓</td>
* <td>✓</td> </tr> </table>
*
* @author Santiago Ospina De Los Ríos
* @date 2018
* @ingroup FluxReconstruction
* @ingroup FiniteElement
*
* @tparam GV { description }
* @tparam DF { description }
* @tparam RF { description }
* @tparam k { description }
*/
template<class GV, class DF, class RF, std::size_t k>
class RaviartThomasSimplexDGLocalFiniteElementMap
: public Dune::PDELab::SimpleLocalFiniteElementMap<
......
......@@ -8,6 +8,22 @@
namespace Dune{
namespace Dorie{
/*-------------------------------------------------------------------------*//**
* @brief Raviart thomas finite element map selector. It siwtches between
* dune-pdelab implementation and dorie/dune-localfunctions
* implementation
*
* @author Santiago Ospina De Los Ríos
* @date 2018
*
* @tparam GV Grid view.
* @tparam DF Domain field.
* @tparam RF Range field.
* @tparam k Order.
* @tparam gt Geometry type.
* @tparam <unnamed> Never instantiate this argument! Implementation
* detail: Curiously recurring template pattern.
*/
template<class GV, class DF, class RF, std::size_t k,
GeometryType::BasicType gt, class = void>
struct RaviartThomasLocalFiniteElementMapBaseSelector
......@@ -21,6 +37,7 @@ struct RaviartThomasLocalFiniteElementMapBaseSelector<
std::enable_if_t<(GV::dimension>2)>
>
{
// We have to use dg here because the original elements are not oriented!
using type = RaviartThomasSimplexDGLocalFiniteElementMap<GV,DF,RF,k>;
};
......@@ -30,32 +47,47 @@ struct RaviartThomasLocalFiniteElementMapBaseSelector<
std::enable_if_t<(GV::dimension==2 && k>1)>
>
{
// We have to use dg here because the original elements are not oriented!
using type = RaviartThomasSimplexDGLocalFiniteElementMap<GV,DF,RF,k>;
};
/*-------------------------------------------------------------------------*//**
* @brief Finite element map for raviart thomas elements
* @f$\mathcal{RT}_k\f$.
* @f$\mathcal{RT}_k^{(dg)}\f$.
* @details This class is equivalent to
* Dune::PDELab::RaviartThomasLocalFiniteElementMap with elements
* for simplices in 3D. A big difference with the dune-pdelab map is
* that these extra elements are not oriented, which make them to be
* not conforming in normal direction. In other words, they cannot
* be used for usual finite element approximations. Nevertheless
* they are still useful for flux reconstruction since we prescribe
* the continuity by using the numerical fluxes solved by the dG/FV
* methods
* Dune::PDELab::RaviartThomasLocalFiniteElementMap plus elements
* for simplices in 3D (see
* Dune::Dorie::RaviartThomasSimplexDGLocalFiniteElementMap). A big
* difference with the dune-pdelab map is that these extra elements
* are not oriented, which make them to be not conforming in normal
* direction. In other words, they cannot be used for usual finite
* element approximations. Nevertheless they are still useful for
* flux reconstruction since we prescribe the continuity by using
* the numerical fluxes solved by the dG/FV methods.
*
* Available elements:
* @todo list of Available elements
* Available elements: <table> <tr> <th colspan="2">Order</th>
* <th>0</th> <th>1</th> <th>2</th> <th>3</th> </tr> <tr> <td
* rowspan="2"><br>2D</td> <td>Simplex</td> <td>✓</td> <td>✓</td>
* <td>✓</td> <td>✓ <SUP>&dagger;</SUP></td> </tr> <tr>
* <td>Cube</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✗</td> </tr>
* <tr> <td rowspan="2"><br>3D</td> <td>Simplex</td> <td>✓
* <SUP>&dagger;</SUP></td> <td>✓ <SUP>&dagger;</SUP></td> <td>✓
* <SUP>&dagger;</SUP></td> <td>✓ <SUP>&dagger;</SUP></td> </tr>
* <tr> <td>Cube</td> <td>✓</td> <td>✓</td> <td>✗</td> <td>✗</td>
* </tr> </table>
*
* &dagger;: Implemented with DG local coefficients (see
* Dune::Dorie::RaviartThomasSimplexDGLocalFiniteElement and
* Dune::Dorie::DGLocalCoefficients).
*
* @warning This map should not be used to solve finite element problems. For
* that purpose use the
* Dune::PDELab::RaviartThomasLocalFiniteElementMap class directly.
*
*
* @author Santiago Ospina De Los Ríos
*
* @date 2018
* @ingroup FluxReconstruction
* @ingroup FiniteElement
*
* @tparam GV The Gird view.
* @tparam DF The domain field.
......@@ -83,6 +115,12 @@ class RaviartThomasLocalFiniteElementMap<GV,DF,RF,k,Dune::GeometryType::simplex>
GV,DF,RF,k,Dune::GeometryType::simplex
>::type;
public:
/*-----------------------------------------------------------------------*//**
* @brief Constructor of the finite element map.
*
* @param[in] gv The grid view.
*/
RaviartThomasLocalFiniteElementMap(const GV& gv) : Base(gv) {}
};
......
......@@ -28,8 +28,6 @@ namespace Dorie{
* @author Santiago Ospina De Los Ríos implemented it in DORiE out of source
* files sent by Marian Piatkowski.
* @date 2018
* @ingroup FiniteElement
* @ingroup FluxReconstruction
* @see Dune::Dorie::RaviartThomasVolumeLocalFiniteElement.
*
* @tparam DF The domain field.
......
......@@ -15,16 +15,14 @@ namespace Dorie{
/*-------------------------------------------------------------------------*//**
* @brief Class for local coefficients of the volume raviart thomas finite
* element |f$\mathcal{RT}_v\f$.
* element @f$\mathcal{RT}_k^{vol}\f$.
* @details This class is used to reconstruct fluxes from local operators
* that solve fluxes in the residual vector. In particular, since
* the volume part is always associated to the codimension 0, all
* the local keys are the same.
* the local keys are the same. Equivalent to DGLocalCoefficients.
*
* @author Santiago Ospina De Los Ríos
* @date 2018
* @ingroup FiniteElement
* @ingroup FluxReconstruction
* @see Dune::Dorie::RaviartThomasVolumeLocalFiniteElement.
*
* @tparam DF The domain field.
......
#ifndef DUNE_DORIE_RAVIART_THOMAS_VOLUME_HH
#define DUNE_DORIE_RAVIART_THOMAS_VOLUME_HH
#ifndef DUNE_DORIE_RAVIART_THOMAS_VOLUME_LOCAL_FINITE_ELEMENT_HH
#define DUNE_DORIE_RAVIART_THOMAS_VOLUME_LOCAL_FINITE_ELEMENT_HH
#include <dune/geometry/type.hh>
......@@ -103,8 +103,8 @@ public:
* @brief The geometry type for which this finite element is implemented.
*
* @todo Fix the deprecated BasicGeometryType: This depends on the
* decitions that the dune community make about this type. Right
* now there is not an easy hay to replace it.
* decision that the dune community make about this type. Right
* now there is not an easy way to replace it.
*
* @return The geometry type.
*/
......@@ -127,4 +127,4 @@ private:
} // namespace Dorie
} // namespace Dune
#endif // DUNE_DORIE_RAVIART_THOMAS_VOLUME_HH
\ No newline at end of file
#endif // DUNE_DORIE_RAVIART_THOMAS_VOLUME_LOCAL_FINITE_ELEMENT_HH
\ No newline at end of file
......@@ -18,8 +18,6 @@ namespace Dorie{
*
* @author Santiago Ospina De Los Ríos
* @date 2018
* @ingroup FiniteElement
* @ingroup FluxReconstruction
* @see Dune::Dorie::RaviartThomasVolumeLocalFiniteElement.
*/
class RaviartThomasVolumeLocalInterpolation
......
......@@ -27,6 +27,7 @@ namespace Dorie{
* <td>✓</td> <td>✓</td> <td>✗</td> </tr> </table>
*
* @author Santiago Ospina De Los Ríos
* @date 2018
* @ingroup FluxReconstruction
* @see Dune::Dorie::RaviartThomasVolumeLocalFiniteElement.
*
......
......@@ -28,9 +28,9 @@ namespace Dorie{
* Available elements:
*
* <table> <tr> <th colspan="2">Order</th> <th>0</th> <th>1</th>
* <th>2</th> <th>3</th> </tr> <tr> <td><br>2D</td> <td>Simplex</td>
* <th>2</th> <th>3</th> </tr> <tr> <td>2D</td> <td>Simplex</td>
* <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr>
* <td><br>3D</td> <td>Simplex</td> <td>✓</td> <td>✓</td> <td>✓</td>
* <td>3D</td> <td>Simplex</td> <td>✓</td> <td>✓</td> <td>✓</td>
* <td>✓</td> </tr> </table>
*
* @warning This finite element map does not work for the usual finite
......@@ -41,7 +41,9 @@ namespace Dorie{
* Dune::PDELab::LocalFunctionSpace.
*
* @author Santiago Ospina De Los Ríos
* @date 2018
* @ingroup FluxReconstruction
* @ingroup FiniteElement
* @see Dune::Dorie::SkeletonQkFiniteElementMap.
* @see Dune::Dorie::SkeletonFiniteElementMap.
*
......@@ -153,9 +155,9 @@ public:
* Available elements:
*
* <table> <tr> <th colspan="2">Order</th> <th>0</th> <th>1</th>
* <th>2</th> <th>3</th> </tr> <tr> <td><br>2D</td> <td>Cube</td>
* <th>2</th> <th>3</th> </tr> <tr> <td>2D</td> <td>Cube</td>
* <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr>
* <td><br>3D</td> <td>Cube</td> <td>✓</td> <td>✓</td> <td>✓</td>
* <td>3D</td> <td>Cube</td> <td>✓</td> <td>✓</td> <td>✓</td>
* <td>✓</td> </tr> </table>
*
* @warning This finite element map does not work for the usual finite
......@@ -166,7 +168,9 @@ public:
* Dune::PDELab::LocalFunctionSpace.
*
* @author Santiago Ospina De Los Ríos
* @date 2018
* @ingroup FluxReconstruction
* @ingroup FiniteElement
* @see Dune::Dorie::SkeletonPkFiniteElementMap.
* @see Dune::Dorie::SkeletonFiniteElementMap.
*
......@@ -274,10 +278,10 @@ public:
* Available elements:
*
* <table> <tr> <th colspan="2">Order</th> <th>0</th> <th>1</th>
* <th>2</th> <th>3</th> </tr> <tr> <td rowspan="2"><br>2D</td>
* <th>2</th> <th>3</th> </tr> <tr> <td rowspan="2">2D</td>
* <td>Simplex</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td>
* </tr> <tr> <td>Cube</td> <td>✓</td> <td>✓</td> <td>✓</td>
* <td>✓</td> </tr> <tr> <td rowspan="2"><br>3D</td>
* <td>✓</td> </tr> <tr> <td rowspan="2">3D</td>
* <td>Simplex</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td>
* </tr> <tr> <td>Cube</td> <td>✓</td> <td>✓</td> <td>✓</td>
* <td>✓</td> </tr> </table>
......@@ -290,8 +294,9 @@ public:
* Dune::PDELab::LocalFunctionSpace.
*
* @author Santiago Ospina De Los Ríos
*
* @date 2018
* @ingroup FluxReconstruction
* @ingroup FiniteElement
* @see Dune::Dorie::SkeletonQkFiniteElementMap.
* @see Dune::Dorie::SkeletonPkFiniteElementMap.
*
......
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