Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CORE] Adding new Lobatto quadratures to linear geometries #12918

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions kratos/geometries/hexahedra_3d_8.h
Original file line number Diff line number Diff line change
Expand Up @@ -1450,8 +1450,8 @@ template<class TPointType> class Hexahedra3D8 : public Geometry<TPointType>
Quadrature < HexahedronGaussLegendreIntegrationPoints4, 3, IntegrationPoint<3> >::GenerateIntegrationPoints(),
Quadrature < HexahedronGaussLegendreIntegrationPoints5, 3, IntegrationPoint<3> >::GenerateIntegrationPoints(),
Quadrature < HexahedronGaussLobattoIntegrationPoints1, 3, IntegrationPoint<3> >::GenerateIntegrationPoints(),
Quadrature < HexahedronGaussLobattoIntegrationPoints2, 3, IntegrationPoint<3> >::GenerateIntegrationPoints(),
Quadrature < HexahedronGaussLobattoIntegrationPoints2, 3, IntegrationPoint<3> >::GenerateIntegrationPoints()
Quadrature < HexahedronGaussLobattoIntegrationPoints1, 3, IntegrationPoint<3> >::GenerateIntegrationPoints(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Quadrature < HexahedronGaussLobattoIntegrationPoints1, 3, IntegrationPoint<3> >::GenerateIntegrationPoints(),

Why repeated?

Quadrature < HexahedronGaussLobattoIntegrationPoints1, 3, IntegrationPoint<3> >::GenerateIntegrationPoints()
}
};
return integration_points;
Expand Down
4 changes: 2 additions & 2 deletions kratos/geometries/hexahedra_interface_3d_8.h
Original file line number Diff line number Diff line change
Expand Up @@ -1766,9 +1766,9 @@ template<class TPointType> class HexahedraInterface3D8 : public Geometry<TPointT
IntegrationPointsContainerType integration_points =
{
{
Quadrature < HexahedronGaussLobattoIntegrationPoints1,
Quadrature < HexahedronGaussLobattoIntegrationPoints0,
3, IntegrationPoint<3> >::GenerateIntegrationPoints(),
Quadrature < HexahedronGaussLobattoIntegrationPoints2,
Quadrature < HexahedronGaussLobattoIntegrationPoints1,
3, IntegrationPoint<3> >::GenerateIntegrationPoints(),
IntegrationPointsArrayType(),
IntegrationPointsArrayType()
Expand Down
2 changes: 1 addition & 1 deletion kratos/geometries/quadrilateral_2d_4.h
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ template<class TPointType> class Quadrilateral2D4
2, IntegrationPoint<3> >::GenerateIntegrationPoints(),
Quadrature < QuadrilateralCollocationIntegrationPoints5,
2, IntegrationPoint<3> >::GenerateIntegrationPoints(),
Quadrature < QuadrilateralGaussLobattoIntegrationPoints2,
Quadrature < QuadrilateralGaussLobattoIntegrationPoints1,
2, IntegrationPoint<3> >::GenerateIntegrationPoints()
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ namespace Kratos
{

//TODO
class HexahedronGaussLobattoIntegrationPoints1
class HexahedronGaussLobattoIntegrationPoints0
{
public:
KRATOS_CLASS_POINTER_DEFINITION(HexahedronGaussLobattoIntegrationPoints1);
KRATOS_CLASS_POINTER_DEFINITION(HexahedronGaussLobattoIntegrationPoints0);
typedef std::size_t SizeType;

static const unsigned int Dimension = 3;
Expand Down Expand Up @@ -61,17 +61,15 @@ class HexahedronGaussLobattoIntegrationPoints1
std::string Info() const
{
std::stringstream buffer;
buffer << "Hexahedron Gauss-Lobatto quadrature 1 ";
buffer << "Hexahedron Gauss-Lobatto quadrature 0 ";
return buffer.str();
}
}; // Class HexahedronGaussLobattoIntegrationPoints0


}; // Class HexahedronGaussLobattoIntegrationPoints1

class HexahedronGaussLobattoIntegrationPoints2
class HexahedronGaussLobattoIntegrationPoints1
{
public:
KRATOS_CLASS_POINTER_DEFINITION(HexahedronGaussLobattoIntegrationPoints2);
KRATOS_CLASS_POINTER_DEFINITION(HexahedronGaussLobattoIntegrationPoints1);
typedef std::size_t SizeType;

static const unsigned int Dimension = 3;
Expand Down Expand Up @@ -105,12 +103,10 @@ class HexahedronGaussLobattoIntegrationPoints2
std::string Info() const
{
std::stringstream buffer;
buffer << "Hexahedron Gauss-Lobatto quadrature 2 ";
buffer << "Hexahedron Gauss-Lobatto quadrature 1 ";
return buffer.str();
}


}; // Class HexahedronGaussLobattoIntegrationPoints2
}; // Class HexahedronGaussLobattoIntegrationPoints1



Expand Down
10 changes: 5 additions & 5 deletions kratos/integration/integration_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,19 @@ class KRATOS_API(KRATOS_CORE) IntegrationInfo : public Flags
if (ThisQuadratureMethod == QuadratureMethod::GAUSS) {
return IntegrationMethod::GI_GAUSS_1;
}
else {
else if (ThisQuadratureMethod == QuadratureMethod::EXTENDED_GAUSS) {
return IntegrationMethod::GI_EXTENDED_GAUSS_1;
}
else {
return IntegrationMethod::GI_LOBATTO_1;
}
break;
case 2:
if (ThisQuadratureMethod == QuadratureMethod::GAUSS) {
return IntegrationMethod::GI_GAUSS_2;
}
else if (ThisQuadratureMethod == QuadratureMethod::EXTENDED_GAUSS) {
return IntegrationMethod::GI_EXTENDED_GAUSS_2;
}
else {
return IntegrationMethod::GI_LOBATTO_1;
return IntegrationMethod::GI_EXTENDED_GAUSS_2;
}
break;
case 3:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@
// Project includes
#include "integration/quadrature.h"

// TO BE COMPLETED: Only the needed ones have been implemented

namespace Kratos
{

class QuadrilateralGaussLobattoIntegrationPoints1
class QuadrilateralGaussLobattoIntegrationPoints0
{
public:
KRATOS_CLASS_POINTER_DEFINITION(QuadrilateralGaussLobattoIntegrationPoints1);
KRATOS_CLASS_POINTER_DEFINITION(QuadrilateralGaussLobattoIntegrationPoints0);
typedef std::size_t SizeType;

static const unsigned int Dimension = 2;
Expand All @@ -56,16 +54,16 @@ namespace Kratos
std::string Info() const
{
std::stringstream buffer;
buffer << "Quadrilateral Gauss-Lobatto integration 1 ";
buffer << "Quadrilateral Gauss-Lobatto integration 0 ";
return buffer.str();
}

}; // Class QuadrilateralGaussLobattoIntegrationPoints1
}; // Class QuadrilateralGaussLobattoIntegrationPoints0

class QuadrilateralGaussLobattoIntegrationPoints2
class QuadrilateralGaussLobattoIntegrationPoints1
{
public:
KRATOS_CLASS_POINTER_DEFINITION(QuadrilateralGaussLobattoIntegrationPoints2);
KRATOS_CLASS_POINTER_DEFINITION(QuadrilateralGaussLobattoIntegrationPoints1);
typedef std::size_t SizeType;

static const unsigned int Dimension = 2;
Expand Down Expand Up @@ -94,16 +92,16 @@ namespace Kratos
std::string Info() const
{
std::stringstream buffer;
buffer << "Quadrilateral Gauss-Lobatto integration 2 ";
buffer << "Quadrilateral Gauss-Lobatto integration 1 ";
return buffer.str();
}

}; // Class QuadrilateralGaussLobattoIntegrationPoints2
}; // Class QuadrilateralGaussLobattoIntegrationPoints1

class QuadrilateralGaussLobattoIntegrationPoints3
class QuadrilateralGaussLobattoIntegrationPoints2
{
public:
KRATOS_CLASS_POINTER_DEFINITION(QuadrilateralGaussLobattoIntegrationPoints3);
KRATOS_CLASS_POINTER_DEFINITION(QuadrilateralGaussLobattoIntegrationPoints2);
typedef std::size_t SizeType;

static const unsigned int Dimension = 2;
Expand Down Expand Up @@ -146,10 +144,10 @@ namespace Kratos
std::string Info() const
{
std::stringstream buffer;
buffer << "Quadrilateral Gauss-Lobatto integration 3 ";
buffer << "Quadrilateral Gauss-Lobatto integration 2 ";
return buffer.str();
}

}; // Class QuadrilateralGaussLobattoIntegrationPoints3
}; // Class QuadrilateralGaussLobattoIntegrationPoints2

}
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ KRATOS_TEST_CASE_IN_SUITE(GaussLobattoQuadrilateralQuadraturesTest, KratosCoreFa
// In This test we evaluate the Gauss-Lobatto quadratures for integrating
// f = (x+y) and g = (x+y)^2 over a [-1, 1] quadrilateral

const auto& r_lobatto_1 = QuadrilateralGaussLobattoIntegrationPoints1();
const auto& r_lobatto_2 = QuadrilateralGaussLobattoIntegrationPoints2();
const auto& r_lobatto_3 = QuadrilateralGaussLobattoIntegrationPoints3();
const auto& r_lobatto_1 = QuadrilateralGaussLobattoIntegrationPoints0();
const auto& r_lobatto_2 = QuadrilateralGaussLobattoIntegrationPoints1();
const auto& r_lobatto_3 = QuadrilateralGaussLobattoIntegrationPoints2();

// Analytical results, reference
const double integral_f = 0.0;
Expand Down Expand Up @@ -84,7 +84,7 @@ KRATOS_TEST_CASE_IN_SUITE(GaussLobattoHexaQuadraturesTest, KratosCoreFastSuite)
// In This test we evaluate the Gauss-Lobatto quadratures for integrating
// f = (x+y+z+5) over a [-1, 1] hexa

const auto& r_lobatto = HexahedronGaussLobattoIntegrationPoints2();
const auto& r_lobatto = HexahedronGaussLobattoIntegrationPoints1();

// Analytical results, reference
const double integral_f = 40.0;
Expand Down
Loading