diff --git a/kratos/geometries/geometry_data.h b/kratos/geometries/geometry_data.h index dd0b5782742..6624d7103b2 100644 --- a/kratos/geometries/geometry_data.h +++ b/kratos/geometries/geometry_data.h @@ -83,6 +83,7 @@ class GeometryData GI_EXTENDED_GAUSS_3, GI_EXTENDED_GAUSS_4, GI_EXTENDED_GAUSS_5, + GI_LOBATTO_1, NumberOfIntegrationMethods // Note that this entry needs to be always the last to be used as integration methods counter }; diff --git a/kratos/geometries/hexahedra_3d_8.h b/kratos/geometries/hexahedra_3d_8.h index edc8c86391b..cbd3505c809 100644 --- a/kratos/geometries/hexahedra_3d_8.h +++ b/kratos/geometries/hexahedra_3d_8.h @@ -1449,8 +1449,7 @@ template class Hexahedra3D8 : public Geometry Quadrature < HexahedronGaussLegendreIntegrationPoints3, 3, IntegrationPoint<3> >::GenerateIntegrationPoints(), 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 < HexahedronGaussLobattoIntegrationPoints1, 3, IntegrationPoint<3> >::GenerateIntegrationPoints() } }; return integration_points; @@ -1466,8 +1465,7 @@ template class Hexahedra3D8 : public Geometry Hexahedra3D8::CalculateShapeFunctionsIntegrationPointsValues( GeometryData::IntegrationMethod::GI_GAUSS_3 ), Hexahedra3D8::CalculateShapeFunctionsIntegrationPointsValues( GeometryData::IntegrationMethod::GI_GAUSS_4 ), Hexahedra3D8::CalculateShapeFunctionsIntegrationPointsValues( GeometryData::IntegrationMethod::GI_GAUSS_5 ), - Hexahedra3D8::CalculateShapeFunctionsIntegrationPointsValues( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_1 ), - Hexahedra3D8::CalculateShapeFunctionsIntegrationPointsValues( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_2 ) + Hexahedra3D8::CalculateShapeFunctionsIntegrationPointsValues( GeometryData::IntegrationMethod::GI_LOBATTO_1 ) } }; return shape_functions_values; @@ -1488,7 +1486,8 @@ template class Hexahedra3D8 : public Geometry Hexahedra3D8::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_GAUSS_4 ), Hexahedra3D8::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_GAUSS_5 ), Hexahedra3D8::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_1 ), - Hexahedra3D8::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_2 ) + Hexahedra3D8::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_2 ), + Hexahedra3D8::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_LOBATTO_1 ) } }; return shape_functions_local_gradients; diff --git a/kratos/geometries/hexahedra_interface_3d_8.h b/kratos/geometries/hexahedra_interface_3d_8.h index aaadab166fc..1bbb84a0a03 100644 --- a/kratos/geometries/hexahedra_interface_3d_8.h +++ b/kratos/geometries/hexahedra_interface_3d_8.h @@ -1766,9 +1766,9 @@ template class HexahedraInterface3D8 : public Geometry >::GenerateIntegrationPoints(), - Quadrature < HexahedronGaussLobattoIntegrationPoints2, + Quadrature < HexahedronGaussLobattoIntegrationPoints1, 3, IntegrationPoint<3> >::GenerateIntegrationPoints(), IntegrationPointsArrayType(), IntegrationPointsArrayType() diff --git a/kratos/geometries/quadrilateral_2d_4.h b/kratos/geometries/quadrilateral_2d_4.h index cfd9a1ba4d7..5fc08b3ccd5 100644 --- a/kratos/geometries/quadrilateral_2d_4.h +++ b/kratos/geometries/quadrilateral_2d_4.h @@ -4,8 +4,8 @@ // _|\_\_| \__,_|\__|\___/ ____/ // Multi-Physics // -// License: BSD License -// Kratos default license: kratos/license.txt +// License: BSD License +// Kratos default license: kratos/license.txt // // Main authors: Riccardo Rossi // Janosch Stascheit @@ -26,6 +26,7 @@ #include "utilities/integration_utilities.h" #include "integration/quadrilateral_gauss_legendre_integration_points.h" #include "integration/quadrilateral_collocation_integration_points.h" +#include "integration/quadrilateral_gauss_lobatto_integration_points.h" namespace Kratos { @@ -1053,6 +1054,8 @@ template class Quadrilateral2D4 Quadrature < QuadrilateralCollocationIntegrationPoints4, 2, IntegrationPoint<3> >::GenerateIntegrationPoints(), Quadrature < QuadrilateralCollocationIntegrationPoints5, + 2, IntegrationPoint<3> >::GenerateIntegrationPoints(), + Quadrature < QuadrilateralGaussLobattoIntegrationPoints1, 2, IntegrationPoint<3> >::GenerateIntegrationPoints() } }; @@ -1086,7 +1089,9 @@ template class Quadrilateral2D4 Quadrilateral2D4::CalculateShapeFunctionsIntegrationPointsValues( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_4 ), Quadrilateral2D4::CalculateShapeFunctionsIntegrationPointsValues( - GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_5 ) + GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_5 ), + Quadrilateral2D4::CalculateShapeFunctionsIntegrationPointsValues( + GeometryData::IntegrationMethod::GI_LOBATTO_1 ) } }; return shape_functions_values; @@ -1111,6 +1116,7 @@ template class Quadrilateral2D4 Quadrilateral2D4::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_3 ), Quadrilateral2D4::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_4 ), Quadrilateral2D4::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_5 ), + Quadrilateral2D4::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_LOBATTO_1 ) } }; return shape_functions_local_gradients; diff --git a/kratos/geometries/quadrilateral_interface_2d_4.h b/kratos/geometries/quadrilateral_interface_2d_4.h index 9817956e923..06abfcbd6cb 100644 --- a/kratos/geometries/quadrilateral_interface_2d_4.h +++ b/kratos/geometries/quadrilateral_interface_2d_4.h @@ -1301,9 +1301,9 @@ template class QuadrilateralInterface2D4 IntegrationPointsContainerType integration_points = { { - Quadrature < QuadrilateralGaussLobattoIntegrationPoints1, + Quadrature < QuadrilateralGaussLobattoIntegrationPoints0, 2, IntegrationPoint<3> >::GenerateIntegrationPoints(), - Quadrature < QuadrilateralGaussLobattoIntegrationPoints2, + Quadrature < QuadrilateralGaussLobattoIntegrationPoints1, 2, IntegrationPoint<3> >::GenerateIntegrationPoints(), IntegrationPointsArrayType(), IntegrationPointsArrayType() diff --git a/kratos/geometries/tetrahedra_3d_4.h b/kratos/geometries/tetrahedra_3d_4.h index dcad8408b4e..f779c64ea7e 100644 --- a/kratos/geometries/tetrahedra_3d_4.h +++ b/kratos/geometries/tetrahedra_3d_4.h @@ -4,8 +4,8 @@ // _|\_\_| \__,_|\__|\___/ ____/ // Multi-Physics // -// License: BSD License -// Kratos default license: kratos/license.txt +// License: BSD License +// Kratos default license: kratos/license.txt // // Main authors: Riccardo Rossi // Janosch Stascheit @@ -23,6 +23,7 @@ // Project includes #include "geometries/triangle_3d_3.h" #include "integration/tetrahedron_gauss_legendre_integration_points.h" +#include "integration/tetrahedron_gauss_lobatto_integration_points.h" #include "geometries/plane.h" #include "utilities/geometry_utilities.h" @@ -1857,6 +1858,8 @@ template class Tetrahedra3D4 : public Geometry 3, IntegrationPoint<3> >::GenerateIntegrationPoints(), Quadrature >::GenerateIntegrationPoints(), + Quadrature >::GenerateIntegrationPoints() } }; return integration_points; @@ -1876,7 +1879,9 @@ template class Tetrahedra3D4 : public Geometry Tetrahedra3D4::CalculateShapeFunctionsIntegrationPointsValues( GeometryData::IntegrationMethod::GI_GAUSS_4), Tetrahedra3D4::CalculateShapeFunctionsIntegrationPointsValues( - GeometryData::IntegrationMethod::GI_GAUSS_5) + GeometryData::IntegrationMethod::GI_GAUSS_5), + Tetrahedra3D4::CalculateShapeFunctionsIntegrationPointsValues( + GeometryData::IntegrationMethod::GI_LOBATTO_1) } }; return shape_functions_values; @@ -1897,7 +1902,9 @@ template class Tetrahedra3D4 : public Geometry Tetrahedra3D4::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_GAUSS_4), Tetrahedra3D4::CalculateShapeFunctionsIntegrationPointsLocalGradients( - GeometryData::IntegrationMethod::GI_GAUSS_5) + GeometryData::IntegrationMethod::GI_GAUSS_5), + Tetrahedra3D4::CalculateShapeFunctionsIntegrationPointsLocalGradients( + GeometryData::IntegrationMethod::GI_LOBATTO_1) } }; return shape_functions_local_gradients; diff --git a/kratos/geometries/triangle_2d_3.h b/kratos/geometries/triangle_2d_3.h index e4841163c16..0b18ab82aeb 100644 --- a/kratos/geometries/triangle_2d_3.h +++ b/kratos/geometries/triangle_2d_3.h @@ -4,8 +4,8 @@ // _|\_\_| \__,_|\__|\___/ ____/ // Multi-Physics // -// License: BSD License -// Kratos default license: kratos/license.txt +// License: BSD License +// Kratos default license: kratos/license.txt // // Main authors: Riccardo Rossi // Janosch Stascheit @@ -14,8 +14,7 @@ // Josep Maria Carbonell // -#if !defined(KRATOS_TRIANGLE_2D_3_H_INCLUDED ) -#define KRATOS_TRIANGLE_2D_3_H_INCLUDED +#pragma once // System includes @@ -26,6 +25,7 @@ #include "geometries/line_2d_2.h" #include "integration/triangle_gauss_legendre_integration_points.h" #include "integration/triangle_collocation_integration_points.h" +#include "integration/triangle_gauss_lobatto_integration_points.h" #include "utilities/intersection_utilities.h" namespace Kratos @@ -1549,7 +1549,8 @@ template class Triangle2D3 Quadrature >::GenerateIntegrationPoints(), Quadrature >::GenerateIntegrationPoints(), Quadrature >::GenerateIntegrationPoints(), - Quadrature >::GenerateIntegrationPoints() + Quadrature >::GenerateIntegrationPoints(), + Quadrature >::GenerateIntegrationPoints() } }; return integration_points; @@ -1583,6 +1584,8 @@ template class Triangle2D3 GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_4 ), Triangle2D3::CalculateShapeFunctionsIntegrationPointsValues( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_5 ), + Triangle2D3::CalculateShapeFunctionsIntegrationPointsValues( + GeometryData::IntegrationMethod::GI_LOBATTO_1 ) } }; return shape_functions_values; @@ -1607,6 +1610,7 @@ template class Triangle2D3 Triangle2D3::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_3 ), Triangle2D3::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_4 ), Triangle2D3::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_5 ), + Triangle2D3::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_LOBATTO_1 ) } }; return shape_functions_local_gradients; @@ -2267,5 +2271,3 @@ template const GeometryDimension Triangle2D3::msGeometryDimension(2, 2); }// namespace Kratos. - -#endif // KRATOS_TRIANGLE_2D_3_H_INCLUDED defined diff --git a/kratos/integration/hexahedron_gauss_lobatto_integration_points.h b/kratos/integration/hexahedron_gauss_lobatto_integration_points.h index b9a11431cb5..7b4e59e4268 100644 --- a/kratos/integration/hexahedron_gauss_lobatto_integration_points.h +++ b/kratos/integration/hexahedron_gauss_lobatto_integration_points.h @@ -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; @@ -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; @@ -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 diff --git a/kratos/integration/integration_info.cpp b/kratos/integration/integration_info.cpp index 833ab5ccd72..ab962b76637 100644 --- a/kratos/integration/integration_info.cpp +++ b/kratos/integration/integration_info.cpp @@ -110,6 +110,10 @@ namespace Kratos mNumberOfIntegrationPointsPerSpanVector[DimensionIndex] = 5; mQuadratureMethodVector[DimensionIndex] = QuadratureMethod::EXTENDED_GAUSS; break; + case IntegrationMethod::GI_LOBATTO_1: + mNumberOfIntegrationPointsPerSpanVector[DimensionIndex] = 2; + mQuadratureMethodVector[DimensionIndex] = QuadratureMethod::LOBATTO; + break; case IntegrationMethod::NumberOfIntegrationMethods: mNumberOfIntegrationPointsPerSpanVector[DimensionIndex] = 0; mQuadratureMethodVector[DimensionIndex] = QuadratureMethod::Default; diff --git a/kratos/integration/integration_info.h b/kratos/integration/integration_info.h index 0b93d113573..acc9a883ec8 100644 --- a/kratos/integration/integration_info.h +++ b/kratos/integration/integration_info.h @@ -61,6 +61,7 @@ class KRATOS_API(KRATOS_CORE) IntegrationInfo : public Flags Default, GAUSS, EXTENDED_GAUSS, + LOBATTO, GRID }; @@ -127,9 +128,12 @@ 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) { diff --git a/kratos/integration/quadrilateral_gauss_lobatto_integration_points.h b/kratos/integration/quadrilateral_gauss_lobatto_integration_points.h index 96e038d0681..526b10ab5c6 100644 --- a/kratos/integration/quadrilateral_gauss_lobatto_integration_points.h +++ b/kratos/integration/quadrilateral_gauss_lobatto_integration_points.h @@ -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; @@ -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; @@ -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; @@ -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 } diff --git a/kratos/integration/tetrahedron_gauss_lobatto_integration_points.h b/kratos/integration/tetrahedron_gauss_lobatto_integration_points.h new file mode 100644 index 00000000000..dd88beaa3c7 --- /dev/null +++ b/kratos/integration/tetrahedron_gauss_lobatto_integration_points.h @@ -0,0 +1,77 @@ +// | / | +// ' / __| _` | __| _ \ __| +// . \ | ( | | ( |\__ ` +// _|\_\_| \__,_|\__|\___/ ____/ +// Multi-Physics +// +// License: BSD License +// Kratos default license: kratos/license.txt +// +// Main authors: Alejandro Cornejo +// +// + +#pragma once + +// System includes + +// External includes + +// Project includes +#include "integration/quadrature.h" + +namespace Kratos +{ + +class TetrahedronGaussLobattoIntegrationPoints1 +{ +public: + KRATOS_CLASS_POINTER_DEFINITION(TetrahedronGaussLobattoIntegrationPoints1); + typedef std::size_t SizeType; + + static const unsigned int Dimension = 3; + + typedef IntegrationPoint<2> IntegrationPointType; + + typedef std::array IntegrationPointsArrayType; + + typedef IntegrationPointType::PointType PointType; + + static SizeType IntegrationPointsNumber() + { + return 4; + } + + static const IntegrationPointsArrayType& IntegrationPoints() + { + const double one_over_twenty_four = 1.0 / 24.0; + static const IntegrationPointsArrayType s_integration_points{{ + IntegrationPointType( 0.0, 0.0 , 0.0, one_over_twenty_four ), + IntegrationPointType( 1.0, 0.0 , 0.0, one_over_twenty_four ), + IntegrationPointType( 0.0, 1.0 , 0.0, one_over_twenty_four ), + IntegrationPointType( 0.0, 0.0 , 1.0, one_over_twenty_four ) + }}; + return s_integration_points; + } + + std::string Info() const + { + std::stringstream buffer; + buffer << "Tetrahedron Gauss-Lobatto quadrature 1 (4 points, degree of precision = 1)"; + return buffer.str(); + } +}; // Class TetrahedronGaussLobattoIntegrationPoints1 + +///@name Type Definitions +///@{ + + +///@} +///@name Input and output +///@{ + + +///@} + + +} // namespace Kratos. diff --git a/kratos/tests/cpp_tests/geometries/test_geometry.cpp b/kratos/tests/cpp_tests/geometries/test_geometry.cpp index 53024231df3..750591c5195 100644 --- a/kratos/tests/cpp_tests/geometries/test_geometry.cpp +++ b/kratos/tests/cpp_tests/geometries/test_geometry.cpp @@ -4,8 +4,8 @@ // _|\_\_| \__,_|\__|\___/ ____/ // Multi-Physics // -// License: BSD License -// Kratos default license: kratos/license.txt +// License: BSD License +// Kratos default license: kratos/license.txt // // Main authors: Carlos A. Roig // Vicente Mataix Ferrandiz @@ -60,6 +60,8 @@ namespace Testing { return "GI_EXTENDED_GAUSS_4"; case GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_5 : return "GI_EXTENDED_GAUSS_5"; + case GeometryData::IntegrationMethod::GI_LOBATTO_1 : + return "GI_LOBATTO_1"; case GeometryData::IntegrationMethod::NumberOfIntegrationMethods : return "NumberOfIntegrationMethods"; }; diff --git a/kratos/tests/cpp_tests/geometries/test_geometry.h b/kratos/tests/cpp_tests/geometries/test_geometry.h index 6b52278ba8f..009d3f94a22 100644 --- a/kratos/tests/cpp_tests/geometries/test_geometry.h +++ b/kratos/tests/cpp_tests/geometries/test_geometry.h @@ -4,8 +4,8 @@ // _|\_\_| \__,_|\__|\___/ ____/ // Multi-Physics // -// License: BSD License -// Kratos default license: kratos/license.txt +// License: BSD License +// Kratos default license: kratos/license.txt // // Main authors: Carlos A. Roig // Vicente Mataix Ferrandiz diff --git a/kratos/tests/cpp_tests/integration/test_integration_quadratures.cpp b/kratos/tests/cpp_tests/integration/test_integration_quadratures.cpp index 55aee9545e7..af7e87b0d18 100644 --- a/kratos/tests/cpp_tests/integration/test_integration_quadratures.cpp +++ b/kratos/tests/cpp_tests/integration/test_integration_quadratures.cpp @@ -19,6 +19,7 @@ #include "integration/quadrilateral_gauss_lobatto_integration_points.h" #include "integration/hexahedron_gauss_lobatto_integration_points.h" #include "integration/triangle_gauss_lobatto_integration_points.h" +#include "integration/tetrahedron_gauss_lobatto_integration_points.h" namespace Kratos::Testing { @@ -29,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; @@ -83,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; @@ -130,4 +131,26 @@ KRATOS_TEST_CASE_IN_SUITE(GaussLobattoTriangleQuadraturesTest, KratosCoreFastSui KRATOS_CHECK_NEAR(quadrature_integral_f, integral_f, 1.0E-6); } +KRATOS_TEST_CASE_IN_SUITE(GaussLobattoTetrahedronQuadraturesTest, KratosCoreFastSuite) +{ + + // In This test we evaluate the Gauss-Lobatto quadrature for integrating + // f = 1.0 over an isoparametric tetrahedron + + const auto& r_lobatto_1 = TetrahedronGaussLobattoIntegrationPoints1(); + + // Analytical result, reference + const double integral_f = 1.0 / 6.0; + + double quadrature_integral_f = 0.0; + + // Integral for f with Lobatto 1 + for (IndexType IP = 0; IP < r_lobatto_1.IntegrationPoints().size(); ++IP) { + const double w = r_lobatto_1.IntegrationPoints()[IP].Weight(); + quadrature_integral_f += w; + } + + KRATOS_CHECK_NEAR(quadrature_integral_f, integral_f, 1.0E-6); +} + } // namespace Kratos::Testing \ No newline at end of file diff --git a/kratos/utilities/geometry_tester.cpp b/kratos/utilities/geometry_tester.cpp index ea0eaa2d51c..97c13b15264 100644 --- a/kratos/utilities/geometry_tester.cpp +++ b/kratos/utilities/geometry_tester.cpp @@ -1144,6 +1144,8 @@ std::string GeometryTesterUtility::GetIntegrationName( return std::string("GI_EXTENDED_GAUSS_4"); case GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_5 : return std::string("GI_EXTENDED_GAUSS_5"); + case GeometryData::IntegrationMethod::GI_LOBATTO_1 : + return std::string("GI_LOBATTO_1"); case GeometryData::IntegrationMethod::NumberOfIntegrationMethods : return std::string("NumberOfIntegrationMethods"); };