From 805eefcb6750ed54b44cb5edba895ece78d67237 Mon Sep 17 00:00:00 2001 From: Dmitri Naumov <dmitri.naumov@ufz.de> Date: Fri, 23 Feb 2018 14:17:38 +0100 Subject: [PATCH] [NL] Integration: Rename Gauss to GaussLegendre. --- .../Fem/Integration/GaussIntegrationPolicy.h | 107 ----------------- .../GaussLegendreIntegrationPolicy.h | 108 ++++++++++++++++++ ...rism.h => IntegrationGaussLegendrePrism.h} | 41 ++++--- ...id.h => IntegrationGaussLegendrePyramid.h} | 47 ++++---- ...=> IntegrationGaussLegendreRegular-impl.h} | 42 ++++--- ...ar.h => IntegrationGaussLegendreRegular.h} | 40 +++---- ...ussTet.h => IntegrationGaussLegendreTet.h} | 47 ++++---- ...ussTri.h => IntegrationGaussLegendreTri.h} | 51 +++++---- NumLib/Fem/Integration/IntegrationPoint.h | 6 +- .../HydroMechanics/LocalDataInitializer.h | 4 +- .../LocalAssembler/LocalDataInitializer.h | 4 +- .../LocalAssembler/LocalDataInitializer.h | 4 +- .../SmallDeformation/LocalDataInitializer.h | 4 +- ProcessLib/Utils/LocalDataInitializer.h | 4 +- 14 files changed, 262 insertions(+), 247 deletions(-) delete mode 100644 NumLib/Fem/Integration/GaussIntegrationPolicy.h create mode 100644 NumLib/Fem/Integration/GaussLegendreIntegrationPolicy.h rename NumLib/Fem/Integration/{IntegrationGaussPrism.h => IntegrationGaussLegendrePrism.h} (69%) rename NumLib/Fem/Integration/{IntegrationGaussPyramid.h => IntegrationGaussLegendrePyramid.h} (63%) rename NumLib/Fem/Integration/{IntegrationGaussRegular-impl.h => IntegrationGaussLegendreRegular-impl.h} (58%) rename NumLib/Fem/Integration/{IntegrationGaussRegular.h => IntegrationGaussLegendreRegular.h} (71%) rename NumLib/Fem/Integration/{IntegrationGaussTet.h => IntegrationGaussLegendreTet.h} (64%) rename NumLib/Fem/Integration/{IntegrationGaussTri.h => IntegrationGaussLegendreTri.h} (65%) diff --git a/NumLib/Fem/Integration/GaussIntegrationPolicy.h b/NumLib/Fem/Integration/GaussIntegrationPolicy.h deleted file mode 100644 index fdbeaddee33..00000000000 --- a/NumLib/Fem/Integration/GaussIntegrationPolicy.h +++ /dev/null @@ -1,107 +0,0 @@ -/** - * \copyright - * Copyright (c) 2012-2018, OpenGeoSys Community (http://www.opengeosys.org) - * Distributed under a Modified BSD License. - * See accompanying file LICENSE.txt or - * http://www.opengeosys.org/project/license - * - */ - -#pragma once - -#include "MeshLib/Elements/Point.h" -#include "MeshLib/Elements/Tri.h" -#include "MeshLib/Elements/Tet.h" -#include "MeshLib/Elements/Prism.h" -#include "MeshLib/Elements/Pyramid.h" - -#include "NumLib/Fem/Integration/IntegrationGaussRegular.h" -#include "NumLib/Fem/Integration/IntegrationGaussTri.h" -#include "NumLib/Fem/Integration/IntegrationGaussTet.h" -#include "NumLib/Fem/Integration/IntegrationGaussPrism.h" -#include "NumLib/Fem/Integration/IntegrationGaussPyramid.h" -#include "NumLib/Fem/Integration/IntegrationPoint.h" - -namespace NumLib -{ - -/// An integration policy providing an integration method suitable for the given -/// mesh element. -/// Gauss-Legendre integration method is used. The default implementation is -/// choosing the regular-element integration, for other elements a -/// specialization must be provided, as for example for triangles -/// (\see GaussIntegrationPolicy<MeshLib::Tri>). -/// The integration method depends on the dimension of the element and correctly -/// chosen number and placement of the integration points within the element. -template <typename MeshElement_> -struct GaussIntegrationPolicy -{ - using MeshElement = MeshElement_; - using IntegrationMethod = - NumLib::IntegrationGaussRegular<MeshElement::dimension>; -}; - -template<> -struct GaussIntegrationPolicy<MeshLib::Point> -{ - using MeshElement = MeshLib::Point; - using IntegrationMethod = NumLib::IntegrationPoint; -}; - -template<> -struct GaussIntegrationPolicy<MeshLib::Tri> -{ - using MeshElement = MeshLib::Tri; - using IntegrationMethod = NumLib::IntegrationGaussTri; -}; - -template<> -struct GaussIntegrationPolicy<MeshLib::Tri6> -{ - using MeshElement = MeshLib::Tri6; - using IntegrationMethod = NumLib::IntegrationGaussTri; -}; - -template<> -struct GaussIntegrationPolicy<MeshLib::Tet> -{ - using MeshElement = MeshLib::Tri; - using IntegrationMethod = NumLib::IntegrationGaussTet; -}; - -template<> -struct GaussIntegrationPolicy<MeshLib::Tet10> -{ - using MeshElement = MeshLib::Tet10; - using IntegrationMethod = NumLib::IntegrationGaussTet; -}; - -template<> -struct GaussIntegrationPolicy<MeshLib::Prism> -{ - using MeshElement = MeshLib::Prism; - using IntegrationMethod = NumLib::IntegrationGaussPrism; -}; - -template<> -struct GaussIntegrationPolicy<MeshLib::Prism15> -{ - using MeshElement = MeshLib::Prism15; - using IntegrationMethod = NumLib::IntegrationGaussPrism; -}; - -template<> -struct GaussIntegrationPolicy<MeshLib::Pyramid> -{ - using MeshElement = MeshLib::Pyramid; - using IntegrationMethod = NumLib::IntegrationGaussPyramid; -}; - -template<> -struct GaussIntegrationPolicy<MeshLib::Pyramid13> -{ - using MeshElement = MeshLib::Pyramid13; - using IntegrationMethod = NumLib::IntegrationGaussPyramid; -}; - -} // namespace NumLib diff --git a/NumLib/Fem/Integration/GaussLegendreIntegrationPolicy.h b/NumLib/Fem/Integration/GaussLegendreIntegrationPolicy.h new file mode 100644 index 00000000000..ab2555a1372 --- /dev/null +++ b/NumLib/Fem/Integration/GaussLegendreIntegrationPolicy.h @@ -0,0 +1,108 @@ +/** + * \file + * + * \copyright + * Copyright (c) 2012-2018, OpenGeoSys Community (http://www.opengeosys.org) + * Distributed under a Modified BSD License. + * See accompanying file LICENSE.txt or + * http://www.opengeosys.org/project/license + * + */ + +#pragma once + +#include "MeshLib/Elements/Point.h" +#include "MeshLib/Elements/Prism.h" +#include "MeshLib/Elements/Pyramid.h" +#include "MeshLib/Elements/Tet.h" +#include "MeshLib/Elements/Tri.h" + +#include "NumLib/Fem/Integration/IntegrationGaussLegendrePrism.h" +#include "NumLib/Fem/Integration/IntegrationGaussLegendrePyramid.h" +#include "NumLib/Fem/Integration/IntegrationGaussLegendreRegular.h" +#include "NumLib/Fem/Integration/IntegrationGaussLegendreTet.h" +#include "NumLib/Fem/Integration/IntegrationGaussLegendreTri.h" +#include "NumLib/Fem/Integration/IntegrationPoint.h" + +namespace NumLib +{ +/// An integration policy providing an integration method suitable for the given +/// mesh element. +/// Gauss-Legendre integration method is used. The default implementation is +/// choosing the regular-element integration, for other elements a +/// specialization must be provided, as for example for triangles +/// (\see GaussLegendreIntegrationPolicy<MeshLib::Tri>). +/// The integration method depends on the dimension of the element and correctly +/// chosen number and placement of the integration points within the element. +template <typename MeshElement_> +struct GaussLegendreIntegrationPolicy +{ + using MeshElement = MeshElement_; + using IntegrationMethod = + NumLib::IntegrationGaussLegendreRegular<MeshElement::dimension>; +}; + +template <> +struct GaussLegendreIntegrationPolicy<MeshLib::Point> +{ + using MeshElement = MeshLib::Point; + using IntegrationMethod = NumLib::IntegrationPoint; +}; + +template <> +struct GaussLegendreIntegrationPolicy<MeshLib::Tri> +{ + using MeshElement = MeshLib::Tri; + using IntegrationMethod = NumLib::IntegrationGaussLegendreTri; +}; + +template <> +struct GaussLegendreIntegrationPolicy<MeshLib::Tri6> +{ + using MeshElement = MeshLib::Tri6; + using IntegrationMethod = NumLib::IntegrationGaussLegendreTri; +}; + +template <> +struct GaussLegendreIntegrationPolicy<MeshLib::Tet> +{ + using MeshElement = MeshLib::Tri; + using IntegrationMethod = NumLib::IntegrationGaussLegendreTet; +}; + +template <> +struct GaussLegendreIntegrationPolicy<MeshLib::Tet10> +{ + using MeshElement = MeshLib::Tet10; + using IntegrationMethod = NumLib::IntegrationGaussLegendreTet; +}; + +template <> +struct GaussLegendreIntegrationPolicy<MeshLib::Prism> +{ + using MeshElement = MeshLib::Prism; + using IntegrationMethod = NumLib::IntegrationGaussLegendrePrism; +}; + +template <> +struct GaussLegendreIntegrationPolicy<MeshLib::Prism15> +{ + using MeshElement = MeshLib::Prism15; + using IntegrationMethod = NumLib::IntegrationGaussLegendrePrism; +}; + +template <> +struct GaussLegendreIntegrationPolicy<MeshLib::Pyramid> +{ + using MeshElement = MeshLib::Pyramid; + using IntegrationMethod = NumLib::IntegrationGaussLegendrePyramid; +}; + +template <> +struct GaussLegendreIntegrationPolicy<MeshLib::Pyramid13> +{ + using MeshElement = MeshLib::Pyramid13; + using IntegrationMethod = NumLib::IntegrationGaussLegendrePyramid; +}; + +} // namespace NumLib diff --git a/NumLib/Fem/Integration/IntegrationGaussPrism.h b/NumLib/Fem/Integration/IntegrationGaussLegendrePrism.h similarity index 69% rename from NumLib/Fem/Integration/IntegrationGaussPrism.h rename to NumLib/Fem/Integration/IntegrationGaussLegendrePrism.h index 6e97ee22ac1..91adffc6ba6 100644 --- a/NumLib/Fem/Integration/IntegrationGaussPrism.h +++ b/NumLib/Fem/Integration/IntegrationGaussLegendrePrism.h @@ -1,4 +1,6 @@ /** + * \file + * * \copyright * Copyright (c) 2012-2018, OpenGeoSys Community (http://www.opengeosys.org) * Distributed under a Modified BSD License. @@ -9,17 +11,16 @@ #pragma once -#include "MathLib/TemplateWeightedPoint.h" #include "MathLib/Integration/GaussLegendre.h" #include "MathLib/Integration/GaussLegendreTri.h" +#include "MathLib/TemplateWeightedPoint.h" namespace NumLib { - /** - * \brief Gauss quadrature rule for prisms + * \brief Gauss-Legendre quadrature rule for prisms */ -class IntegrationGaussPrism +class IntegrationGaussLegendrePrism { using WeightedPoint = MathLib::TemplateWeightedPoint<double, double, 3>; @@ -29,8 +30,8 @@ public: * * @param order integration order (default 2) */ - explicit IntegrationGaussPrism(unsigned order = 2) - : _order(2), _n_sampl_pt(0) + explicit IntegrationGaussLegendrePrism(unsigned order = 2) + : _order(2), _n_sampl_pt(0) { this->setIntegrationOrder(order); } @@ -38,25 +39,24 @@ public: /// Change the integration order. void setIntegrationOrder(unsigned /*order*/) { - _order = 2; // fixed + _order = 2; // fixed _n_sampl_pt = getNumberOfPoints(_order); } /// return current integration order. - unsigned getIntegrationOrder() const {return _order;} + unsigned getIntegrationOrder() const { return _order; } /// return the number of sampling points - unsigned getNumberOfPoints() const {return _n_sampl_pt;} + unsigned getNumberOfPoints() const { return _n_sampl_pt; } - /// \copydoc IntegrationGaussRegular::getWeightedPoint(unsigned) const + /// \copydoc NumLib::IntegrationGaussLegendreRegular::getWeightedPoint(unsigned) const WeightedPoint getWeightedPoint(unsigned igp) const { return getWeightedPoint(getIntegrationOrder(), igp); } - /// \copydoc IntegrationGaussRegular::getWeightedPoint(unsigned, unsigned) - static WeightedPoint - getWeightedPoint(unsigned order, unsigned igp) + /// \copydoc NumLib::IntegrationGaussLegendreRegular::getWeightedPoint(unsigned, unsigned) + static WeightedPoint getWeightedPoint(unsigned order, unsigned igp) { (void)order; const unsigned gp_r = igp % 3; @@ -65,28 +65,27 @@ public: rst[0] = MathLib::GaussLegendreTri<2>::X[gp_r][0]; rst[1] = MathLib::GaussLegendreTri<2>::X[gp_r][1]; rst[2] = MathLib::GaussLegendre<2>::X[gp_t]; - double w = MathLib::GaussLegendreTri<2>::W[gp_r] * 0.5 * MathLib::GaussLegendre<2>::W[gp_t]; + double w = MathLib::GaussLegendreTri<2>::W[gp_r] * 0.5 * + MathLib::GaussLegendre<2>::W[gp_t]; return WeightedPoint(rst, w); } template <typename Method> - static WeightedPoint - getWeightedPoint(unsigned igp) + static WeightedPoint getWeightedPoint(unsigned igp) { return WeightedPoint(Method::X[igp], Method::W[igp]); } - /** * get the number of integration points * * @param order the number of integration points * @return the number of points */ - static unsigned - getNumberOfPoints(unsigned order) + static unsigned getNumberOfPoints(unsigned order) { - if (order==2) return 6; + if (order == 2) + return 6; return 0; } @@ -95,4 +94,4 @@ private: unsigned _n_sampl_pt; }; -} +} // namespace NumLib diff --git a/NumLib/Fem/Integration/IntegrationGaussPyramid.h b/NumLib/Fem/Integration/IntegrationGaussLegendrePyramid.h similarity index 63% rename from NumLib/Fem/Integration/IntegrationGaussPyramid.h rename to NumLib/Fem/Integration/IntegrationGaussLegendrePyramid.h index ad737e50b38..27872ef73c0 100644 --- a/NumLib/Fem/Integration/IntegrationGaussPyramid.h +++ b/NumLib/Fem/Integration/IntegrationGaussLegendrePyramid.h @@ -1,4 +1,6 @@ /** + * \file + * * \copyright * Copyright (c) 2012-2018, OpenGeoSys Community (http://www.opengeosys.org) * Distributed under a Modified BSD License. @@ -9,16 +11,15 @@ #pragma once -#include "MathLib/TemplateWeightedPoint.h" #include "MathLib/Integration/GaussLegendrePyramid.h" +#include "MathLib/TemplateWeightedPoint.h" namespace NumLib { - /** - * \brief Gauss quadrature rule for pyramid + * \brief Gauss-Legendre quadrature rule for pyramid */ -class IntegrationGaussPyramid +class IntegrationGaussLegendrePyramid { using WeightedPoint = MathLib::TemplateWeightedPoint<double, double, 3>; @@ -28,8 +29,8 @@ public: * * @param order integration order (default 2) */ - explicit IntegrationGaussPyramid(unsigned order = 2) - : _order(order), _n_sampl_pt(0) + explicit IntegrationGaussLegendrePyramid(unsigned order = 2) + : _order(order), _n_sampl_pt(0) { this->setIntegrationOrder(order); } @@ -42,10 +43,10 @@ public: } /// return current integration order. - unsigned getIntegrationOrder() const {return _order;} + unsigned getIntegrationOrder() const { return _order; } /// return the number of sampling points - unsigned getNumberOfPoints() const {return _n_sampl_pt;} + unsigned getNumberOfPoints() const { return _n_sampl_pt; } /** * get coordinates of a integration point @@ -65,40 +66,42 @@ public: * @param igp the sampling point id * @return weight */ - static WeightedPoint - getWeightedPoint(unsigned order, unsigned igp) + static WeightedPoint getWeightedPoint(unsigned order, unsigned igp) { switch (order) { - case 1: return getWeightedPoint<MathLib::GaussLegendrePyramid<1> >(igp); - case 2: return getWeightedPoint<MathLib::GaussLegendrePyramid<2> >(igp); - case 3: return getWeightedPoint<MathLib::GaussLegendrePyramid<3> >(igp); + case 1: + return getWeightedPoint<MathLib::GaussLegendrePyramid<1>>(igp); + case 2: + return getWeightedPoint<MathLib::GaussLegendrePyramid<2>>(igp); + case 3: + return getWeightedPoint<MathLib::GaussLegendrePyramid<3>>(igp); } return WeightedPoint(std::array<double, 3>(), 0); } template <typename Method> - static WeightedPoint - getWeightedPoint(unsigned igp) + static WeightedPoint getWeightedPoint(unsigned igp) { return WeightedPoint(Method::X[igp], Method::W[igp]); } - /** * get the number of integration points * * @param order the number of integration points * @return the number of points */ - static unsigned - getNumberOfPoints(unsigned order) + static unsigned getNumberOfPoints(unsigned order) { switch (order) { - case 1: return MathLib::GaussLegendrePyramid<1>::NPoints; - case 2: return MathLib::GaussLegendrePyramid<2>::NPoints; - case 3: return MathLib::GaussLegendrePyramid<3>::NPoints; + case 1: + return MathLib::GaussLegendrePyramid<1>::NPoints; + case 2: + return MathLib::GaussLegendrePyramid<2>::NPoints; + case 3: + return MathLib::GaussLegendrePyramid<3>::NPoints; } return 0; } @@ -108,4 +111,4 @@ private: unsigned _n_sampl_pt; }; -} +} // namespace NumLib diff --git a/NumLib/Fem/Integration/IntegrationGaussRegular-impl.h b/NumLib/Fem/Integration/IntegrationGaussLegendreRegular-impl.h similarity index 58% rename from NumLib/Fem/Integration/IntegrationGaussRegular-impl.h rename to NumLib/Fem/Integration/IntegrationGaussLegendreRegular-impl.h index 46e310cb2ee..43404027078 100644 --- a/NumLib/Fem/Integration/IntegrationGaussRegular-impl.h +++ b/NumLib/Fem/Integration/IntegrationGaussLegendreRegular-impl.h @@ -1,4 +1,5 @@ /** + * \file * \author Norihiro Watanabe * \date 2013-08-13 * @@ -14,10 +15,10 @@ namespace NumLib { - template <> inline std::array<unsigned, 1> -IntegrationGaussRegular<1>::getPositionIndices(unsigned /*order*/, unsigned igp) +IntegrationGaussLegendreRegular<1>::getPositionIndices(unsigned /*order*/, + unsigned igp) { std::array<unsigned, 1> result; result[0] = igp; @@ -26,9 +27,10 @@ IntegrationGaussRegular<1>::getPositionIndices(unsigned /*order*/, unsigned igp) template <> inline std::array<unsigned, 2> -IntegrationGaussRegular<2>::getPositionIndices(unsigned order, unsigned igp) +IntegrationGaussLegendreRegular<2>::getPositionIndices(unsigned order, + unsigned igp) { - assert(igp < order*order); + assert(igp < order * order); std::array<unsigned, 2> result; result[0] = igp / order; result[1] = igp % order; @@ -37,9 +39,10 @@ IntegrationGaussRegular<2>::getPositionIndices(unsigned order, unsigned igp) template <> inline std::array<unsigned, 3> -IntegrationGaussRegular<3>::getPositionIndices(unsigned order, unsigned igp) +IntegrationGaussLegendreRegular<3>::getPositionIndices(unsigned order, + unsigned igp) { - assert(igp < order*order*order); + assert(igp < order * order * order); unsigned const gp_r = igp / (order * order); unsigned const gp_s = igp % (order * order); std::array<unsigned, 3> result; @@ -51,27 +54,32 @@ IntegrationGaussRegular<3>::getPositionIndices(unsigned order, unsigned igp) template <unsigned N_DIM> inline MathLib::TemplateWeightedPoint<double, double, N_DIM> -IntegrationGaussRegular<N_DIM>::getWeightedPoint(unsigned order, - unsigned igp) +IntegrationGaussLegendreRegular<N_DIM>::getWeightedPoint(unsigned order, + unsigned igp) { assert(igp < std::pow(order, N_DIM)); std::array<unsigned, N_DIM> const pos = getPositionIndices(order, igp); switch (order) { - case 1: return getWeightedPoint<MathLib::GaussLegendre<1>>(pos); - case 2: return getWeightedPoint<MathLib::GaussLegendre<2>>(pos); - case 3: return getWeightedPoint<MathLib::GaussLegendre<3>>(pos); - case 4: return getWeightedPoint<MathLib::GaussLegendre<4>>(pos); + case 1: + return getWeightedPoint<MathLib::GaussLegendre<1>>(pos); + case 2: + return getWeightedPoint<MathLib::GaussLegendre<2>>(pos); + case 3: + return getWeightedPoint<MathLib::GaussLegendre<3>>(pos); + case 4: + return getWeightedPoint<MathLib::GaussLegendre<4>>(pos); } - return MathLib::TemplateWeightedPoint<double, double, N_DIM>(std::array<double, N_DIM>(), 0); + return MathLib::TemplateWeightedPoint<double, double, N_DIM>( + std::array<double, N_DIM>(), 0); } template <unsigned N_DIM> template <typename Method> inline MathLib::TemplateWeightedPoint<double, double, N_DIM> -IntegrationGaussRegular<N_DIM>::getWeightedPoint( +IntegrationGaussLegendreRegular<N_DIM>::getWeightedPoint( std::array<unsigned, N_DIM> const& pos) { std::array<double, N_DIM> coords; @@ -82,7 +90,7 @@ IntegrationGaussRegular<N_DIM>::getWeightedPoint( weight *= Method::W[pos[d]]; } - return MathLib::TemplateWeightedPoint<double, double, N_DIM>(coords, weight); + return MathLib::TemplateWeightedPoint<double, double, N_DIM>(coords, + weight); } -} //namespace - +} // namespace NumLib diff --git a/NumLib/Fem/Integration/IntegrationGaussRegular.h b/NumLib/Fem/Integration/IntegrationGaussLegendreRegular.h similarity index 71% rename from NumLib/Fem/Integration/IntegrationGaussRegular.h rename to NumLib/Fem/Integration/IntegrationGaussLegendreRegular.h index ee3a014e2ff..35f587c9136 100644 --- a/NumLib/Fem/Integration/IntegrationGaussRegular.h +++ b/NumLib/Fem/Integration/IntegrationGaussLegendreRegular.h @@ -1,4 +1,5 @@ /** + * \file * \author Norihiro Watanabe * \date 2013-08-13 * @@ -12,32 +13,31 @@ #pragma once -#include <cmath> #include <array> +#include <cmath> #include "MathLib/Integration/GaussLegendre.h" #include "MathLib/TemplateWeightedPoint.h" - namespace NumLib { - -/// Gauss quadrature rule for regular shape elements: line, quad and hex. +/// Gauss-Legendre quadrature rule for regular shape elements: line, quad and +/// hex. /// /// \tparam N_DIM Spatial dimension template <unsigned N_DIM> -class IntegrationGaussRegular +class IntegrationGaussLegendreRegular { using WeightedPoint = typename MathLib::TemplateWeightedPoint<double, double, N_DIM>; public: - /// Create IntegrationGaussRegular of the given Gauss-Legendre integration - /// order. + /// Create IntegrationGaussLegendreRegular of the given Gauss-Legendre + /// integration order. /// /// @param order integration order (default 2) - explicit IntegrationGaussRegular(unsigned order = 2) - : _order(order), _n_sampl_pt(0) + explicit IntegrationGaussLegendreRegular(unsigned order = 2) + : _order(order), _n_sampl_pt(0) { this->setIntegrationOrder(order); } @@ -50,17 +50,16 @@ public: } /// return current integration order. - unsigned getIntegrationOrder() const {return _order;} + unsigned getIntegrationOrder() const { return _order; } /// return the number of sampling points - unsigned getNumberOfPoints() const {return _n_sampl_pt;} + unsigned getNumberOfPoints() const { return _n_sampl_pt; } /// Get coordinates of the integration point. /// /// @param igp The integration point index /// @return a weighted point - WeightedPoint - getWeightedPoint(unsigned igp) const + WeightedPoint getWeightedPoint(unsigned igp) const { return getWeightedPoint(getIntegrationOrder(), igp); } @@ -70,15 +69,15 @@ public: /// @param order The number of integration points /// @param igp The integration point index /// @return a tuple of position indexes - static std::array<unsigned, N_DIM> getPositionIndices(unsigned order, unsigned igp); + static std::array<unsigned, N_DIM> getPositionIndices(unsigned order, + unsigned igp); /// Get coordinates of the integration point. /// /// @param order The number of integration points /// @param igp The integration point index /// @return a weighted point - static WeightedPoint - getWeightedPoint(unsigned order, unsigned igp); + static WeightedPoint getWeightedPoint(unsigned order, unsigned igp); private: /// Computes weighted point using given integration method. @@ -86,15 +85,14 @@ private: /// \tparam Method Integration method to use. /// \param pos Point indices computed by getPositionIndices. template <typename Method> - static - WeightedPoint - getWeightedPoint(std::array<unsigned, N_DIM> const& pos); + static WeightedPoint getWeightedPoint( + std::array<unsigned, N_DIM> const& pos); private: unsigned _order; unsigned _n_sampl_pt; }; -} // NumLib +} // namespace NumLib -#include "IntegrationGaussRegular-impl.h" +#include "IntegrationGaussLegendreRegular-impl.h" diff --git a/NumLib/Fem/Integration/IntegrationGaussTet.h b/NumLib/Fem/Integration/IntegrationGaussLegendreTet.h similarity index 64% rename from NumLib/Fem/Integration/IntegrationGaussTet.h rename to NumLib/Fem/Integration/IntegrationGaussLegendreTet.h index 537f6d9940b..503bc3fc098 100644 --- a/NumLib/Fem/Integration/IntegrationGaussTet.h +++ b/NumLib/Fem/Integration/IntegrationGaussLegendreTet.h @@ -1,4 +1,6 @@ /** + * \file + * * \copyright * Copyright (c) 2012-2018, OpenGeoSys Community (http://www.opengeosys.org) * Distributed under a Modified BSD License. @@ -9,16 +11,15 @@ #pragma once -#include "MathLib/TemplateWeightedPoint.h" #include "MathLib/Integration/GaussLegendreTet.h" +#include "MathLib/TemplateWeightedPoint.h" namespace NumLib { - /** - * \brief Gauss quadrature rule for tetrahedrals + * \brief Gauss-Legendre quadrature rule for tetrahedrals */ -class IntegrationGaussTet +class IntegrationGaussLegendreTet { using WeightedPoint = MathLib::TemplateWeightedPoint<double, double, 3>; @@ -28,8 +29,8 @@ public: * * @param order integration order (default 2) */ - explicit IntegrationGaussTet(unsigned order = 2) - : _order(order), _n_sampl_pt(0) + explicit IntegrationGaussLegendreTet(unsigned order = 2) + : _order(order), _n_sampl_pt(0) { this->setIntegrationOrder(order); } @@ -42,10 +43,10 @@ public: } /// return current integration order. - unsigned getIntegrationOrder() const {return _order;} + unsigned getIntegrationOrder() const { return _order; } /// return the number of sampling points - unsigned getNumberOfPoints() const {return _n_sampl_pt;} + unsigned getNumberOfPoints() const { return _n_sampl_pt; } /** * get coordinates of a integration point @@ -65,40 +66,42 @@ public: * @param igp the sampling point id * @return weight */ - static WeightedPoint - getWeightedPoint(unsigned order, unsigned igp) + static WeightedPoint getWeightedPoint(unsigned order, unsigned igp) { switch (order) { - case 1: return getWeightedPoint<MathLib::GaussLegendreTet<1> >(igp); - case 2: return getWeightedPoint<MathLib::GaussLegendreTet<2> >(igp); - case 3: return getWeightedPoint<MathLib::GaussLegendreTet<3> >(igp); + case 1: + return getWeightedPoint<MathLib::GaussLegendreTet<1>>(igp); + case 2: + return getWeightedPoint<MathLib::GaussLegendreTet<2>>(igp); + case 3: + return getWeightedPoint<MathLib::GaussLegendreTet<3>>(igp); } return WeightedPoint(std::array<double, 3>(), 0); } template <typename Method> - static WeightedPoint - getWeightedPoint(unsigned igp) + static WeightedPoint getWeightedPoint(unsigned igp) { return WeightedPoint(Method::X[igp], Method::W[igp]); } - /** * get the number of integration points * * @param order the number of integration points * @return the number of points */ - static unsigned - getNumberOfPoints(unsigned order) + static unsigned getNumberOfPoints(unsigned order) { switch (order) { - case 1: return MathLib::GaussLegendreTet<1>::NPoints; - case 2: return MathLib::GaussLegendreTet<2>::NPoints; - case 3: return MathLib::GaussLegendreTet<3>::NPoints; + case 1: + return MathLib::GaussLegendreTet<1>::NPoints; + case 2: + return MathLib::GaussLegendreTet<2>::NPoints; + case 3: + return MathLib::GaussLegendreTet<3>::NPoints; } return 0; } @@ -108,4 +111,4 @@ private: unsigned _n_sampl_pt; }; -} +} // namespace NumLib diff --git a/NumLib/Fem/Integration/IntegrationGaussTri.h b/NumLib/Fem/Integration/IntegrationGaussLegendreTri.h similarity index 65% rename from NumLib/Fem/Integration/IntegrationGaussTri.h rename to NumLib/Fem/Integration/IntegrationGaussLegendreTri.h index 687663440b5..4a69f54af2e 100644 --- a/NumLib/Fem/Integration/IntegrationGaussTri.h +++ b/NumLib/Fem/Integration/IntegrationGaussLegendreTri.h @@ -14,19 +14,18 @@ #pragma once -#include "MathLib/TemplateWeightedPoint.h" #include "MathLib/Integration/GaussLegendreTri.h" +#include "MathLib/TemplateWeightedPoint.h" namespace NumLib { - /** - * \brief Gauss quadrature rule for triangles + * \brief Gauss-Legendre quadrature rule for triangles * - * Gauss quadrature rule for triangles is originally given as + * Gauss-Legendre quadrature rule for triangles is originally given as * \f[ - * \int F(x,y) dx dy = \int F(x(r, s), y(r, s)) j(r,s) dr ds \approx \frac{1}{2} \sum_i ( F(x(r_i, s_i), y(r_i, s_i)) w_i ) - * \f] + * \int F(x,y) dx dy = \int F(x(r, s), y(r, s)) j(r,s) dr ds \approx + * \frac{1}{2} \sum_i ( F(x(r_i, s_i), y(r_i, s_i)) w_i ) \f] * * To make it consistent with other elements, we rewrite the above formula as * \f[ @@ -34,7 +33,7 @@ namespace NumLib * \f] * by defining the new weight \f$ w'=\frac{1}{2} w \f$. */ -class IntegrationGaussTri +class IntegrationGaussLegendreTri { using WeightedPoint = MathLib::TemplateWeightedPoint<double, double, 2>; @@ -44,8 +43,8 @@ public: * * @param order integration order (default 2) */ - explicit IntegrationGaussTri(unsigned order = 2) - : _order(order), _n_sampl_pt(0) + explicit IntegrationGaussLegendreTri(unsigned order = 2) + : _order(order), _n_sampl_pt(0) { this->setIntegrationOrder(order); } @@ -58,10 +57,10 @@ public: } /// return current integration order. - unsigned getIntegrationOrder() const {return _order;} + unsigned getIntegrationOrder() const { return _order; } /// return the number of sampling points - unsigned getNumberOfPoints() const {return _n_sampl_pt;} + unsigned getNumberOfPoints() const { return _n_sampl_pt; } /** * get coordinates of a integration point @@ -81,40 +80,42 @@ public: * @param igp the sampling point id * @return weight */ - static WeightedPoint - getWeightedPoint(unsigned order, unsigned igp) + static WeightedPoint getWeightedPoint(unsigned order, unsigned igp) { switch (order) { - case 1: return getWeightedPoint<MathLib::GaussLegendreTri<1> >(igp); - case 2: return getWeightedPoint<MathLib::GaussLegendreTri<2> >(igp); - case 3: return getWeightedPoint<MathLib::GaussLegendreTri<3> >(igp); + case 1: + return getWeightedPoint<MathLib::GaussLegendreTri<1>>(igp); + case 2: + return getWeightedPoint<MathLib::GaussLegendreTri<2>>(igp); + case 3: + return getWeightedPoint<MathLib::GaussLegendreTri<3>>(igp); } return WeightedPoint(std::array<double, 2>(), 0); } template <typename Method> - static WeightedPoint - getWeightedPoint(unsigned igp) + static WeightedPoint getWeightedPoint(unsigned igp) { return WeightedPoint(Method::X[igp], 0.5 * Method::W[igp]); } - /** * get the number of integration points * * @param order the number of integration points * @return the number of points */ - static unsigned - getNumberOfPoints(unsigned order) + static unsigned getNumberOfPoints(unsigned order) { switch (order) { - case 1: return MathLib::GaussLegendreTri<1>::NPoints; - case 2: return MathLib::GaussLegendreTri<2>::NPoints; - case 3: return MathLib::GaussLegendreTri<3>::NPoints; + case 1: + return MathLib::GaussLegendreTri<1>::NPoints; + case 2: + return MathLib::GaussLegendreTri<2>::NPoints; + case 3: + return MathLib::GaussLegendreTri<3>::NPoints; } return 0; } @@ -124,4 +125,4 @@ private: unsigned _n_sampl_pt; }; -} +} // namespace NumLib diff --git a/NumLib/Fem/Integration/IntegrationPoint.h b/NumLib/Fem/Integration/IntegrationPoint.h index d8a5f859a12..bb51381cb44 100644 --- a/NumLib/Fem/Integration/IntegrationPoint.h +++ b/NumLib/Fem/Integration/IntegrationPoint.h @@ -1,4 +1,6 @@ /** + * \file + * * \copyright * Copyright (c) 2012-2018, OpenGeoSys Community (http://www.opengeosys.org) * Distributed under a Modified BSD License. @@ -44,13 +46,13 @@ public: return 1; } - /// \copydoc IntegrationGaussRegular::getWeightedPoint(unsigned) const + /// \copydoc IntegrationGaussLegendreRegular::getWeightedPoint(unsigned) const WeightedPoint getWeightedPoint(unsigned igp) const { return getWeightedPoint(getIntegrationOrder(), igp); } - /// \copydoc IntegrationGaussRegular::getWeightedPoint(unsigned, unsigned) + /// \copydoc IntegrationGaussLegendreRegular::getWeightedPoint(unsigned, unsigned) static WeightedPoint getWeightedPoint(unsigned order, unsigned igp) { (void)order; diff --git a/ProcessLib/HydroMechanics/LocalDataInitializer.h b/ProcessLib/HydroMechanics/LocalDataInitializer.h index 67a57283aad..c7bb00ca2bb 100644 --- a/ProcessLib/HydroMechanics/LocalDataInitializer.h +++ b/ProcessLib/HydroMechanics/LocalDataInitializer.h @@ -19,7 +19,7 @@ #include "MeshLib/Elements/Elements.h" #include "NumLib/DOF/LocalToGlobalIndexMap.h" #include "NumLib/Fem/FiniteElement/LowerDimShapeTable.h" -#include "NumLib/Fem/Integration/GaussIntegrationPolicy.h" +#include "NumLib/Fem/Integration/GaussLegendreIntegrationPolicy.h" #ifndef OGS_MAX_ELEMENT_DIM static_assert(false, "The macro OGS_MAX_ELEMENT_DIM is undefined."); @@ -218,7 +218,7 @@ private: ConstructorArgs&&...)>; template <typename ShapeFunctionDisplacement> - using IntegrationMethod = typename NumLib::GaussIntegrationPolicy< + using IntegrationMethod = typename NumLib::GaussLegendreIntegrationPolicy< typename ShapeFunctionDisplacement::MeshElement>::IntegrationMethod; template <typename ShapeFunctionDisplacement, diff --git a/ProcessLib/LIE/HydroMechanics/LocalAssembler/LocalDataInitializer.h b/ProcessLib/LIE/HydroMechanics/LocalAssembler/LocalDataInitializer.h index 4deddbddd95..dbc43b629de 100644 --- a/ProcessLib/LIE/HydroMechanics/LocalAssembler/LocalDataInitializer.h +++ b/ProcessLib/LIE/HydroMechanics/LocalAssembler/LocalDataInitializer.h @@ -19,7 +19,7 @@ #include "MeshLib/Elements/Elements.h" #include "NumLib/DOF/LocalToGlobalIndexMap.h" #include "NumLib/Fem/FiniteElement/LowerDimShapeTable.h" -#include "NumLib/Fem/Integration/GaussIntegrationPolicy.h" +#include "NumLib/Fem/Integration/GaussLegendreIntegrationPolicy.h" #ifndef OGS_MAX_ELEMENT_DIM static_assert(false, "The macro OGS_MAX_ELEMENT_DIM is undefined."); @@ -263,7 +263,7 @@ private: ConstructorArgs&&...)>; template <typename ShapeFunctionDisplacement> - using IntegrationMethod = typename NumLib::GaussIntegrationPolicy< + using IntegrationMethod = typename NumLib::GaussLegendreIntegrationPolicy< typename ShapeFunctionDisplacement::MeshElement>::IntegrationMethod; template <typename ShapeFunctionDisplacement, diff --git a/ProcessLib/LIE/SmallDeformation/LocalAssembler/LocalDataInitializer.h b/ProcessLib/LIE/SmallDeformation/LocalAssembler/LocalDataInitializer.h index 30698869ae4..02cb8948a2f 100644 --- a/ProcessLib/LIE/SmallDeformation/LocalAssembler/LocalDataInitializer.h +++ b/ProcessLib/LIE/SmallDeformation/LocalAssembler/LocalDataInitializer.h @@ -18,7 +18,7 @@ #include "MeshLib/Elements/Elements.h" #include "NumLib/DOF/LocalToGlobalIndexMap.h" -#include "NumLib/Fem/Integration/GaussIntegrationPolicy.h" +#include "NumLib/Fem/Integration/GaussLegendreIntegrationPolicy.h" #ifndef OGS_MAX_ELEMENT_DIM static_assert(false, "The macro OGS_MAX_ELEMENT_DIM is undefined."); @@ -303,7 +303,7 @@ private: ConstructorArgs&&...)>; template <typename ShapeFunction> - using IntegrationMethod = typename NumLib::GaussIntegrationPolicy< + using IntegrationMethod = typename NumLib::GaussLegendreIntegrationPolicy< typename ShapeFunction::MeshElement>::IntegrationMethod; template <typename ShapeFunction> diff --git a/ProcessLib/SmallDeformation/LocalDataInitializer.h b/ProcessLib/SmallDeformation/LocalDataInitializer.h index 5de0a2e3c92..a8138177742 100644 --- a/ProcessLib/SmallDeformation/LocalDataInitializer.h +++ b/ProcessLib/SmallDeformation/LocalDataInitializer.h @@ -18,7 +18,7 @@ #include "MeshLib/Elements/Elements.h" #include "NumLib/DOF/LocalToGlobalIndexMap.h" -#include "NumLib/Fem/Integration/GaussIntegrationPolicy.h" +#include "NumLib/Fem/Integration/GaussLegendreIntegrationPolicy.h" #ifndef OGS_MAX_ELEMENT_DIM static_assert(false, "The macro OGS_MAX_ELEMENT_DIM is undefined."); @@ -242,7 +242,7 @@ private: ConstructorArgs&&...)>; template <typename ShapeFunction> - using IntegrationMethod = typename NumLib::GaussIntegrationPolicy< + using IntegrationMethod = typename NumLib::GaussLegendreIntegrationPolicy< typename ShapeFunction::MeshElement>::IntegrationMethod; template <typename ShapeFunction> diff --git a/ProcessLib/Utils/LocalDataInitializer.h b/ProcessLib/Utils/LocalDataInitializer.h index 52505624954..83e04bfbce7 100644 --- a/ProcessLib/Utils/LocalDataInitializer.h +++ b/ProcessLib/Utils/LocalDataInitializer.h @@ -18,7 +18,7 @@ #include "MeshLib/Elements/Elements.h" #include "NumLib/DOF/LocalToGlobalIndexMap.h" -#include "NumLib/Fem/Integration/GaussIntegrationPolicy.h" +#include "NumLib/Fem/Integration/GaussLegendreIntegrationPolicy.h" #ifndef OGS_MAX_ELEMENT_DIM static_assert(false, "The macro OGS_MAX_ELEMENT_DIM is undefined."); @@ -333,7 +333,7 @@ private: ConstructorArgs&&...)>; template <typename ShapeFunction> - using IntegrationMethod = typename NumLib::GaussIntegrationPolicy< + using IntegrationMethod = typename NumLib::GaussLegendreIntegrationPolicy< typename ShapeFunction::MeshElement>::IntegrationMethod; template <typename ShapeFunction> -- GitLab