Skip to content
Snippets Groups Projects
Commit cd8646f2 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Start writing of simplicial Gauss-Lengendre quadrature formulae

Only sets 1d formulae which is trivially set as the tensorial ones
parent b24a9ed4
No related branches found
No related tags found
1 merge request!124Add files for high order integration with quadratures
......@@ -2,5 +2,6 @@
add_library(
PugsAnalysis
SimplicialGaussLegendreQuadrature.cpp
TensorialGaussLegendreQuadrature.cpp
TensorialGaussLobattoQuadrature.cpp)
#include <analysis/SimplicialGaussLegendreQuadrature.hpp>
#include <analysis/TensorialGaussLegendreQuadrature.hpp>
#include <utils/Exceptions.hpp>
template <>
void
SimplicialGaussLegendreQuadrature<1>::_buildPointAndWeightLists()
{
TensorialGaussLegendreQuadrature<1> gauss(m_order);
m_point_list = gauss.pointList();
m_weight_list = gauss.weightList();
}
template <>
void
SimplicialGaussLegendreQuadrature<2>::_buildPointAndWeightLists()
{
throw NotImplementedError("gauss legendre quadrature on 2d simplex");
}
template <>
void
SimplicialGaussLegendreQuadrature<3>::_buildPointAndWeightLists()
{
throw NotImplementedError("gauss legendre quadrature on 3d simplex");
}
#ifndef SIMPLICIAL_GAUSS_LEGENDRE_QUADRATURE_HPP
#define SIMPLICIAL_GAUSS_LEGENDRE_QUADRATURE_HPP
#include <analysis/QuadratureFormula.hpp>
/**
* Defines Gauss Legendre quadrature on the reference simplex element
* - in 1d, the segment \f$]-1,1[\f$
* - in 2d, the triangle defined by \f$(-1,-1)\f$, \f$(1,-1)\f$ and \f$(-1,1)\f$
* - in 3d, the tetrahedron joining \f$(-1,-1-1)\f$, \f$(1,-1,-1)\f$, \f$(-1,1,-1)\f$ and \f$(-1,1-,1)\f$
*
* \note formulae are extracted from High-order Finite Element Method [2004 - Chapman & Hall]
*/
template <size_t Dimension>
class SimplicialGaussLegendreQuadrature final : public QuadratureForumla<Dimension>
{
private:
void _buildPointAndWeightLists();
public:
SimplicialGaussLegendreQuadrature(SimplicialGaussLegendreQuadrature&&) = default;
SimplicialGaussLegendreQuadrature(const SimplicialGaussLegendreQuadrature&) = default;
explicit SimplicialGaussLegendreQuadrature(const size_t order) : QuadratureForumla<Dimension>(order)
{
this->_buildPointAndWeightLists();
}
SimplicialGaussLegendreQuadrature() = delete;
~SimplicialGaussLegendreQuadrature() = default;
};
#endif // SIMPLICIAL_GAUSS_LEGENDRE_QUADRATURE_HPP
......@@ -99,6 +99,7 @@ add_executable (unit_tests
test_PugsUtils.cpp
test_Q1Transformation.cpp
test_RevisionInfo.cpp
test_SimplicialGaussLegendreQuadrature.cpp
test_SmallArray.cpp
test_SmallVector.cpp
test_SymbolTable.cpp
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment