Commit 46f51bc7 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#9 - #882 QuadratureRules: rename namespaces and make sure the Doxygen documentation is nice.

parent b0ce14ca
......@@ -8823,7 +8823,7 @@
BEB6B67518DAF70700B9D6C5 /* Instantiation */,
BE9A01D21CB511BE00B637EB /* Crtp */,
BE4FC35918F2AE87007B6DED /* Exceptions */,
BEBA258419D94F6B00639C85 /* Private */,
BEBA258419D94F6B00639C85 /* Internal */,
);
path = QuadratureRules;
sourceTree = "<group>";
......@@ -8998,14 +8998,14 @@
path = GeometricElements;
sourceTree = "<group>";
};
BEBA258419D94F6B00639C85 /* Private */ = {
BEBA258419D94F6B00639C85 /* Internal */ = {
isa = PBXGroup;
children = (
BEBA258919D94FE600639C85 /* GaussQuadratureFormula.cpp */,
BEBA258519D94F6B00639C85 /* GaussQuadratureFormula.hpp */,
BEBA258619D94F6B00639C85 /* GaussQuadratureFormula.hxx */,
);
path = Private;
path = Internal;
sourceTree = "<group>";
};
BEBB31F5196D4C08004D6C7E /* HalfSum */ = {
......@@ -19,7 +19,17 @@
/// \namespace HappyHeart::ExceptionNS::Dof
/// \brief Namespace that enclose Dof-related exceptions.
/// \namespace HappyHeart::QuadratureNS
/// \brief Namespace that enclose quadrature points and rules.
/// \namespace HappyHeart::ExceptionNS::QuadratureRuleListNS
/// \brief Namespace that enclose quadrature rule list-related exceptions.
/// \namespace HappyHeart::Internal::GaussQuadratureNS
/// \brief Namespace that enclose helper formula used in Gauss quadrature rules.
///
/// At the moment it is not documented as these are third party functions barely adapted
/// I have very few knowledge of.
///@}
......
......@@ -8,8 +8,8 @@
// Copyright (c) 2013 Inria. All rights reserved.
//
#ifndef HAPPY_HEART_x_FINITE_ELEMENT_x_QUADRATURE_RULES_x_QUADRATURE_RULE_LIST_HPP_
# define HAPPY_HEART_x_FINITE_ELEMENT_x_QUADRATURE_RULES_x_QUADRATURE_RULE_LIST_HPP_
#ifndef HAPPY_HEART_x_FINITE_ELEMENT_x_QUADRATURE_RULES_x_CRTP_x_QUADRATURE_RULE_LIST_HPP_
# define HAPPY_HEART_x_FINITE_ELEMENT_x_QUADRATURE_RULES_x_CRTP_x_QUADRATURE_RULE_LIST_HPP_
# include <vector>
......@@ -64,4 +64,4 @@ namespace HappyHeart
# include "FiniteElement/QuadratureRules/Crtp/QuadratureRuleList.hxx"
#endif // HAPPY_HEART_x_FINITE_ELEMENT_x_QUADRATURE_RULES_x_QUADRATURE_RULE_LIST_HPP_
#endif // HAPPY_HEART_x_FINITE_ELEMENT_x_QUADRATURE_RULES_x_CRTP_x_QUADRATURE_RULE_LIST_HPP_
......@@ -8,8 +8,8 @@
// Copyright (c) 2013 Inria. All rights reserved.
//
#ifndef HAPPY_HEART_x_FINITE_ELEMENT_x_QUADRATURE_RULES_x_QUADRATURE_RULE_LIST_HXX_
# define HAPPY_HEART_x_FINITE_ELEMENT_x_QUADRATURE_RULES_x_QUADRATURE_RULE_LIST_HXX_
#ifndef HAPPY_HEART_x_FINITE_ELEMENT_x_QUADRATURE_RULES_x_CRTP_x_QUADRATURE_RULE_LIST_HXX_
# define HAPPY_HEART_x_FINITE_ELEMENT_x_QUADRATURE_RULES_x_CRTP_x_QUADRATURE_RULE_LIST_HXX_
namespace HappyHeart
......@@ -75,7 +75,7 @@ namespace HappyHeart
if (it == list.cend())
return *(list.crbegin());
//throw ExceptionNS::List::InvalidDegree(degree, MaximumDegreeOfExactness(), __FILE__, __LINE__);
//throw ExceptionNS::QuadratureRuleListNS::InvalidDegree(degree, MaximumDegreeOfExactness(), __FILE__, __LINE__);
return *it;
}
......@@ -91,4 +91,4 @@ namespace HappyHeart
} // namespace HappyHeart
#endif // HAPPY_HEART_x_FINITE_ELEMENT_x_QUADRATURE_RULES_x_QUADRATURE_RULE_LIST_HXX_
#endif // HAPPY_HEART_x_FINITE_ELEMENT_x_QUADRATURE_RULES_x_CRTP_x_QUADRATURE_RULE_LIST_HXX_
//! \file
//! \file
//
//
// geometric_elements_exceptions.cpp
......@@ -27,41 +27,34 @@ namespace HappyHeart
{
namespace Private
namespace ExceptionNS
{
namespace ExceptionNS
namespace QuadratureRuleListNS
{
namespace QuadratureRuleList
{
Exception::~Exception() = default;
Exception::Exception(const std::string& msg, const char* invoking_file, int invoking_line)
: HappyHeart::Exception(msg, invoking_file, invoking_line)
{ }
InvalidDegree::~InvalidDegree() = default;
InvalidDegree::InvalidDegree(unsigned int degree, unsigned int max_degree, const char* invoking_file, int invoking_line)
: Exception(InvalidDegreeMsg(degree, max_degree), invoking_file, invoking_line)
{ }
} // namespace QuadratureRuleList
Exception::~Exception() = default;
} // namespace ExceptionNS
Exception::Exception(const std::string& msg, const char* invoking_file, int invoking_line)
: HappyHeart::Exception(msg, invoking_file, invoking_line)
{ }
InvalidDegree::~InvalidDegree() = default;
InvalidDegree::InvalidDegree(unsigned int degree, unsigned int max_degree, const char* invoking_file, int invoking_line)
: Exception(InvalidDegreeMsg(degree, max_degree), invoking_file, invoking_line)
{ }
} // namespace QuadratureRuleListNS
} // namespace Private
} // namespace ExceptionNS
} // namespace HappyHeart
......
//! \file
//! \file
//
//
// geometric_elements_exceptions.h
......@@ -19,95 +19,88 @@ namespace HappyHeart
{
namespace Private
namespace ExceptionNS
{
namespace ExceptionNS
namespace QuadratureRuleListNS
{
namespace QuadratureRuleList
//! Generic GetQuadratureRule exception.
class Exception : public HappyHeart::Exception
{
public:
/*!
* \brief Constructor with simple message
*
* \param[in] msg Message
* \param[in] invoking_file File that invoked the function or class; usually __FILE__.
* \param[in] invoking_line File that invoked the function or class; usually __LINE__.
*/
explicit Exception(const std::string& msg, const char* invoking_file, int invoking_line);
//! Generic GetQuadratureRule exception.
class Exception : public HappyHeart::Exception
{
public:
/*!
* \brief Constructor with simple message
*
* \param[in] msg Message
* \param[in] invoking_file File that invoked the function or class; usually __FILE__.
* \param[in] invoking_line File that invoked the function or class; usually __LINE__.
*/
explicit Exception(const std::string& msg, const char* invoking_file, int invoking_line);
//! Destructor
virtual ~Exception();
//! Copy constructor.
Exception(const Exception&) = default;
//! Move constructor.
Exception(Exception&&) = default;
//! Copy affectation.
Exception& operator=(const Exception&) = default;
//! Move affectation.
Exception& operator=(Exception&&) = default;
};
//! Destructor
virtual ~Exception();
//! Copy constructor.
Exception(const Exception&) = default;
//! Move constructor.
Exception(Exception&&) = default;
//! Copy affectation.
Exception& operator=(const Exception&) = default;
//! Move affectation.
Exception& operator=(Exception&&) = default;
};
/*!
* \brief When no quadrature rule with the exact degree of exactness specified is available.
*/
class InvalidDegree final : public Exception
{
public:
/*!
* \brief When no quadrature rule with the exact degree of exactness specified is available.
* \brief Constructor with simple message
*
* \param[in] degree Degree of exactness required by the user.
* \param[in] max_degree Maximum degree of exactness required by the user.
* \param[in] invoking_file File that invoked the function or class; usually __FILE__.
* \param[in] invoking_line File that invoked the function or class; usually __LINE__.
*/
class InvalidDegree final : public Exception
{
public:
/*!
* \brief Constructor with simple message
*
* \param[in] degree Degree of exactness required by the user.
* \param[in] max_degree Maximum degree of exactness required by the user.
* \param[in] invoking_file File that invoked the function or class; usually __FILE__.
* \param[in] invoking_line File that invoked the function or class; usually __LINE__.
*/
explicit InvalidDegree(unsigned int degree, unsigned int max_degree, const char* invoking_file, int invoking_line);
//! Destructor
virtual ~InvalidDegree();
//! Copy constructor.
InvalidDegree(const InvalidDegree&) = default;
//! Move constructor.
InvalidDegree(InvalidDegree&&) = default;
//! Copy affectation.
InvalidDegree& operator=(const InvalidDegree&) = default;
//! Move affectation.
InvalidDegree& operator=(InvalidDegree&&) = default;
};
explicit InvalidDegree(unsigned int degree, unsigned int max_degree, const char* invoking_file, int invoking_line);
//! Destructor
virtual ~InvalidDegree();
//! Copy constructor.
InvalidDegree(const InvalidDegree&) = default;
//! Move constructor.
InvalidDegree(InvalidDegree&&) = default;
//! Copy affectation.
InvalidDegree& operator=(const InvalidDegree&) = default;
} // namespace QuadratureRuleList
//! Move affectation.
InvalidDegree& operator=(InvalidDegree&&) = default;
};
} // namespace ExceptionNS
} // namespace QuadratureRuleListNS
} // namespace Private
} // namespace ExceptionNS
} // namespace HappyHeart
......
......@@ -20,7 +20,7 @@
# include "Utilities/Numeric/Numeric.hpp"
# include "FiniteElement/QuadratureRules/EnumGaussQuadratureFormula.hpp"
# include "FiniteElement/QuadratureRules/Private/GaussQuadratureFormula.hpp"
# include "FiniteElement/QuadratureRules/Internal/GaussQuadratureFormula.hpp"
namespace HappyHeart
......
......@@ -58,13 +58,13 @@ namespace HappyHeart
switch (Nquadrature_point)
{
case 1:
Private::ComputeExactFormula<QuadratureFormulaT, 1u>::Perform(points, weights);
Internal::GaussQuadratureNS::ComputeExactFormula<QuadratureFormulaT, 1u>::Perform(points, weights);
return;
case 2:
Private::ComputeExactFormula<QuadratureFormulaT, 2u>::Perform(points, weights);
Internal::GaussQuadratureNS::ComputeExactFormula<QuadratureFormulaT, 2u>::Perform(points, weights);
return;
case 3:
Private::ComputeExactFormula<QuadratureFormulaT, 3u>::Perform(points, weights);
Internal::GaussQuadratureNS::ComputeExactFormula<QuadratureFormulaT, 3u>::Perform(points, weights);
return;
default:
break;
......@@ -77,7 +77,7 @@ namespace HappyHeart
double zero = 0.0;
double cz = zero;
Private::ComputeFourierCoef(Nquadrature_point, cz, coef, deriv_coef, second_deriv_coef);
Internal::GaussQuadratureNS::ComputeFourierCoef(Nquadrature_point, cz, coef, deriv_coef, second_deriv_coef);
double dtheta = zero;
if (QuadratureFormulaT == GaussFormula::Gauss_Lobatto && (Nparity_points==1))
......@@ -147,7 +147,7 @@ namespace HappyHeart
//
// newton iterations
//
Private::ComputeLegendrePolAndDerivative(Nquadrature_point, zero, cz, coef,deriv_coef,
Internal::GaussQuadratureNS::ComputeLegendrePolAndDerivative(Nquadrature_point, zero, cz, coef,deriv_coef,
second_deriv_coef,pb, dpb, ddpb);
if (QuadratureFormulaT == GaussFormula::Gauss_Lobatto)
......@@ -209,7 +209,7 @@ namespace HappyHeart
if ((QuadratureFormulaT == GaussFormula::Gauss) && (Nparity_points != 0))
{
theta[Nhalf - 1] = half_pi;
Private::ComputeLegendrePolAndDerivative(Nquadrature_point, half_pi, cz, coef,deriv_coef,
Internal::GaussQuadratureNS::ComputeLegendrePolAndDerivative(Nquadrature_point, half_pi, cz, coef,deriv_coef,
second_deriv_coef, pb, dpb, ddpb);
assert(!NumericNS::IsZero(dpb));
......@@ -220,7 +220,7 @@ namespace HappyHeart
if ((QuadratureFormulaT == GaussFormula::Gauss_Lobatto) && (Nparity_points == 0))
{
theta[Nhalf - 1] = half_pi;
Private::ComputeLegendrePolAndDerivative(Nquadrature_point, half_pi, cz, coef,deriv_coef,
Internal::GaussQuadratureNS::ComputeLegendrePolAndDerivative(Nquadrature_point, half_pi, cz, coef,deriv_coef,
second_deriv_coef,pb, dpb, ddpb);
assert(!NumericNS::IsZero(pb));
weights[Nhalf - 1] = 1. / NumericNS::Square(pb);
......@@ -239,7 +239,7 @@ namespace HappyHeart
theta[0] = 0.0;
Private::ComputeLegendrePolAndDerivative(Nquadrature_point, theta[0], cz, coef,deriv_coef,
Internal::GaussQuadratureNS::ComputeLegendrePolAndDerivative(Nquadrature_point, theta[0], cz, coef,deriv_coef,
second_deriv_coef, pb, dpb, ddpb);
// DISP(cz); DISP(pb);
......
......@@ -26,7 +26,7 @@ namespace HappyHeart
{
//! CRTP-defined class for the quadrature rules that concerns Hexahedrons.
//! CRTP-defined class for the quadrature rules that concern Hexahedrons.
struct Hexahedron : public Crtp::QuadratureRuleNS::List<Hexahedron>
{
......
......@@ -26,7 +26,7 @@ namespace HappyHeart
{
//! CRTP-defined class for the quadrature rules that concerns points.
//! CRTP-defined class for the quadrature rules that concern points.
struct Point : public Crtp::QuadratureRuleNS::List<Point>
{
......
......@@ -26,7 +26,7 @@ namespace HappyHeart
{
//! CRTP-defined class for the quadrature rules that concerns Quadrangles.
//! CRTP-defined class for the quadrature rules that concern Quadrangles.
struct Quadrangle : public Crtp::QuadratureRuleNS::List<Quadrangle>
{
......
......@@ -26,7 +26,7 @@ namespace HappyHeart
{
//! CRTP-defined class for the quadrature rules that concerns segments.
//! CRTP-defined class for the quadrature rules that concern segments.
struct Segment : public Crtp::QuadratureRuleNS::List<Segment>
{
......
......@@ -26,7 +26,7 @@ namespace HappyHeart
{
//! CRTP-defined class for the quadrature rules that concerns tetrahedrons.
//! CRTP-defined class for the quadrature rules that concern tetrahedrons.
struct Tetrahedron : public Crtp::QuadratureRuleNS::List<Tetrahedron>
{
......
......@@ -26,7 +26,7 @@ namespace HappyHeart
{
//! CRTP-defined class for the quadrature rules that concerns triangles.
//! CRTP-defined class for the quadrature rules that concern triangles.
struct Triangle : public Crtp::QuadratureRuleNS::List<Triangle>
{
......
......@@ -9,7 +9,7 @@
//
#include "Utilities/Numeric/Numeric.hpp"
#include "FiniteElement/QuadratureRules/Private/GaussQuadratureFormula.hpp"
#include "FiniteElement/QuadratureRules/Internal/GaussQuadratureFormula.hpp"
......@@ -17,14 +17,17 @@ namespace HappyHeart
{
namespace QuadratureNS
namespace Internal
{
namespace Private
namespace GaussQuadratureNS
{
using GaussFormula = QuadratureNS::GaussFormula;
void ComputeExactFormula<GaussFormula::Gauss_Lobatto, 1u>
::Perform(std::vector<double>& points, std::vector<double>& weights)
{
......@@ -219,10 +222,10 @@ namespace HappyHeart
}
} // namespace Private
} // namespace GaussQuadratureNS
} // namespace QuadratureNS
} // namespace Internal
} // namespace HappyHeart
......@@ -8,8 +8,8 @@
// Copyright (c) 2014 Inria. All rights reserved.
//
#ifndef HAPPY_HEART_x_FINITE_ELEMENT_x_QUADRATURE_RULES_x_PRIVATE_x_GAUSS_QUADRATURE_FORMULA_HPP_
# define HAPPY_HEART_x_FINITE_ELEMENT_x_QUADRATURE_RULES_x_PRIVATE_x_GAUSS_QUADRATURE_FORMULA_HPP_
#ifndef HAPPY_HEART_x_FINITE_ELEMENT_x_QUADRATURE_RULES_x_INTERNAL_x_GAUSS_QUADRATURE_FORMULA_HPP_
# define HAPPY_HEART_x_FINITE_ELEMENT_x_QUADRATURE_RULES_x_INTERNAL_x_GAUSS_QUADRATURE_FORMULA_HPP_
# include <memory>
# include <vector>
......@@ -23,11 +23,11 @@ namespace HappyHeart
{
namespace QuadratureNS
namespace Internal
{
namespace Private
namespace GaussQuadratureNS
{
......@@ -74,17 +74,17 @@ namespace HappyHeart
* \warning Only Gauss-Lobatto one has been checked; other one was taken from Ondomatic
* but not used at all.
* \tparam I Used to determine the number of quadrature points to use.
* In Gauss-Lobatto, I + 1 quadrature points are used.
* In Gauss-Lobatto, I + 1 7quadrature points are used.
* In Gauss, I quadrature points are used.
*
*/
template<GaussFormula QuadratureFormulaT, unsigned int I>
template<QuadratureNS::GaussFormula QuadratureFormulaT, unsigned int I>
struct ComputeExactFormula;
template<>
struct ComputeExactFormula<GaussFormula::Gauss_Lobatto, 1u>
struct ComputeExactFormula<QuadratureNS::GaussFormula::Gauss_Lobatto, 1u>
{
static void Perform(std::vector<double>& points, std::vector<double>& weights);
......@@ -93,7 +93,7 @@ namespace HappyHeart
template<>
struct ComputeExactFormula<GaussFormula::Gauss_Lobatto, 2u>
struct ComputeExactFormula<QuadratureNS::GaussFormula::Gauss_Lobatto, 2u>
{
static void Perform(std::vector<double>& points, std::vector<double>& weights);
......@@ -102,7 +102,7 @@ namespace HappyHeart
template<>
struct ComputeExactFormula<GaussFormula::Gauss_Lobatto, 3u>
struct ComputeExactFormula<QuadratureNS::GaussFormula::Gauss_Lobatto, 3u>
{
static void Perform(std::vector<double>& points, std::vector<double>& weights);
......@@ -112,7 +112,7 @@ namespace HappyHeart
template<>
struct ComputeExactFormula<GaussFormula::Gauss, 1u>
struct ComputeExactFormula<QuadratureNS::GaussFormula::Gauss, 1u>
{
static void Perform(std::vector<double>& points, std::vector<double>& weights);
......@@ -121,7 +121,7 @@ namespace HappyHeart
template<>
struct ComputeExactFormula<GaussFormula::Gauss, 2u>
struct ComputeExactFormula<QuadratureNS::GaussFormula::Gauss, 2u>
{
static void Perform(std::vector<double>& points, std::vector<double>& weights);
......@@ -130,7 +130,7 @@ namespace HappyHeart
template<>
struct ComputeExactFormula<GaussFormula::Gauss, 3u>
struct ComputeExactFormula<QuadratureNS::GaussFormula::Gauss, 3u>
{
static void Perform(std::vector<double>& points, std::vector<double>& weights);
......@@ -145,16 +145,16 @@ namespace HappyHeart