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
Open
1 change: 1 addition & 0 deletions kratos/geometries/geometry_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down
9 changes: 6 additions & 3 deletions kratos/geometries/hexahedra_3d_8.h
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +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 < 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 All @@ -1467,7 +1468,8 @@ template<class TPointType> class Hexahedra3D8 : public Geometry<TPointType>
Hexahedra3D8<TPointType>::CalculateShapeFunctionsIntegrationPointsValues( GeometryData::IntegrationMethod::GI_GAUSS_4 ),
Hexahedra3D8<TPointType>::CalculateShapeFunctionsIntegrationPointsValues( GeometryData::IntegrationMethod::GI_GAUSS_5 ),
Hexahedra3D8<TPointType>::CalculateShapeFunctionsIntegrationPointsValues( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_1 ),
Hexahedra3D8<TPointType>::CalculateShapeFunctionsIntegrationPointsValues( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_2 )
Hexahedra3D8<TPointType>::CalculateShapeFunctionsIntegrationPointsValues( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_2 ),
Hexahedra3D8<TPointType>::CalculateShapeFunctionsIntegrationPointsValues( GeometryData::IntegrationMethod::GI_LOBATTO_1 )
}
};
return shape_functions_values;
Expand All @@ -1488,7 +1490,8 @@ template<class TPointType> class Hexahedra3D8 : public Geometry<TPointType>
Hexahedra3D8<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_GAUSS_4 ),
Hexahedra3D8<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_GAUSS_5 ),
Hexahedra3D8<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_1 ),
Hexahedra3D8<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_2 )
Hexahedra3D8<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_2 ),
Hexahedra3D8<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_LOBATTO_1 )
}
};
return shape_functions_local_gradients;
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
12 changes: 9 additions & 3 deletions kratos/geometries/quadrilateral_2d_4.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
{
Expand Down Expand Up @@ -1053,6 +1054,8 @@ template<class TPointType> class Quadrilateral2D4
Quadrature < QuadrilateralCollocationIntegrationPoints4,
2, IntegrationPoint<3> >::GenerateIntegrationPoints(),
Quadrature < QuadrilateralCollocationIntegrationPoints5,
2, IntegrationPoint<3> >::GenerateIntegrationPoints(),
Quadrature < QuadrilateralGaussLobattoIntegrationPoints1,
2, IntegrationPoint<3> >::GenerateIntegrationPoints()
}
};
Expand Down Expand Up @@ -1086,7 +1089,9 @@ template<class TPointType> class Quadrilateral2D4
Quadrilateral2D4<TPointType>::CalculateShapeFunctionsIntegrationPointsValues(
GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_4 ),
Quadrilateral2D4<TPointType>::CalculateShapeFunctionsIntegrationPointsValues(
GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_5 )
GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_5 ),
Quadrilateral2D4<TPointType>::CalculateShapeFunctionsIntegrationPointsValues(
GeometryData::IntegrationMethod::GI_LOBATTO_1 )
}
};
return shape_functions_values;
Expand All @@ -1111,6 +1116,7 @@ template<class TPointType> class Quadrilateral2D4
Quadrilateral2D4<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_3 ),
Quadrilateral2D4<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_4 ),
Quadrilateral2D4<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_5 ),
Quadrilateral2D4<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_LOBATTO_1 )
}
};
return shape_functions_local_gradients;
Expand Down
15 changes: 11 additions & 4 deletions kratos/geometries/tetrahedra_3d_4.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"

Expand Down Expand Up @@ -1857,6 +1858,8 @@ template<class TPointType> class Tetrahedra3D4 : public Geometry<TPointType>
3, IntegrationPoint<3> >::GenerateIntegrationPoints(),
Quadrature<TetrahedronGaussLegendreIntegrationPoints5,
3, IntegrationPoint<3> >::GenerateIntegrationPoints(),
Quadrature<TetrahedronGaussLobattoIntegrationPoints1,
3, IntegrationPoint<3> >::GenerateIntegrationPoints()
}
};
return integration_points;
Expand All @@ -1876,7 +1879,9 @@ template<class TPointType> class Tetrahedra3D4 : public Geometry<TPointType>
Tetrahedra3D4<TPointType>::CalculateShapeFunctionsIntegrationPointsValues(
GeometryData::IntegrationMethod::GI_GAUSS_4),
Tetrahedra3D4<TPointType>::CalculateShapeFunctionsIntegrationPointsValues(
GeometryData::IntegrationMethod::GI_GAUSS_5)
GeometryData::IntegrationMethod::GI_GAUSS_5),
Tetrahedra3D4<TPointType>::CalculateShapeFunctionsIntegrationPointsValues(
GeometryData::IntegrationMethod::GI_LOBATTO_1)
}
};
return shape_functions_values;
Expand All @@ -1897,7 +1902,9 @@ template<class TPointType> class Tetrahedra3D4 : public Geometry<TPointType>
Tetrahedra3D4<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients(
GeometryData::IntegrationMethod::GI_GAUSS_4),
Tetrahedra3D4<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients(
GeometryData::IntegrationMethod::GI_GAUSS_5)
GeometryData::IntegrationMethod::GI_GAUSS_5),
Tetrahedra3D4<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients(
GeometryData::IntegrationMethod::GI_LOBATTO_1)
}
};
return shape_functions_local_gradients;
Expand Down
16 changes: 9 additions & 7 deletions kratos/geometries/triangle_2d_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -1549,7 +1549,8 @@ template<class TPointType> class Triangle2D3
Quadrature<TriangleCollocationIntegrationPoints2, 2, IntegrationPoint<3> >::GenerateIntegrationPoints(),
Quadrature<TriangleCollocationIntegrationPoints3, 2, IntegrationPoint<3> >::GenerateIntegrationPoints(),
Quadrature<TriangleCollocationIntegrationPoints4, 2, IntegrationPoint<3> >::GenerateIntegrationPoints(),
Quadrature<TriangleCollocationIntegrationPoints5, 2, IntegrationPoint<3> >::GenerateIntegrationPoints()
Quadrature<TriangleCollocationIntegrationPoints5, 2, IntegrationPoint<3> >::GenerateIntegrationPoints(),
Quadrature<TriangleGaussLobattoIntegrationPoints1, 2, IntegrationPoint<3> >::GenerateIntegrationPoints()
}
};
return integration_points;
Expand Down Expand Up @@ -1583,6 +1584,8 @@ template<class TPointType> class Triangle2D3
GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_4 ),
Triangle2D3<TPointType>::CalculateShapeFunctionsIntegrationPointsValues(
GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_5 ),
Triangle2D3<TPointType>::CalculateShapeFunctionsIntegrationPointsValues(
GeometryData::IntegrationMethod::GI_LOBATTO_1 )
}
};
return shape_functions_values;
Expand All @@ -1607,6 +1610,7 @@ template<class TPointType> class Triangle2D3
Triangle2D3<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_3 ),
Triangle2D3<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_4 ),
Triangle2D3<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_EXTENDED_GAUSS_5 ),
Triangle2D3<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::IntegrationMethod::GI_LOBATTO_1 )
}
};
return shape_functions_local_gradients;
Expand Down Expand Up @@ -2267,5 +2271,3 @@ template<class TPointType> const
GeometryDimension Triangle2D3<TPointType>::msGeometryDimension(2, 2);

}// namespace Kratos.

#endif // KRATOS_TRIANGLE_2D_3_H_INCLUDED defined
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
4 changes: 4 additions & 0 deletions kratos/integration/integration_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ namespace Kratos
mNumberOfIntegrationPointsPerSpanVector[DimensionIndex] = 5;
mQuadratureMethodVector[DimensionIndex] = QuadratureMethod::EXTENDED_GAUSS;
break;
case IntegrationMethod::GI_LOBATTO_1:
mNumberOfIntegrationPointsPerSpanVector[DimensionIndex] = 2;
rubenzorrilla marked this conversation as resolved.
Show resolved Hide resolved
mQuadratureMethodVector[DimensionIndex] = QuadratureMethod::LOBATTO;
break;
case IntegrationMethod::NumberOfIntegrationMethods:
mNumberOfIntegrationPointsPerSpanVector[DimensionIndex] = 0;
mQuadratureMethodVector[DimensionIndex] = QuadratureMethod::Default;
Expand Down
6 changes: 5 additions & 1 deletion kratos/integration/integration_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class KRATOS_API(KRATOS_CORE) IntegrationInfo : public Flags
Default,
GAUSS,
EXTENDED_GAUSS,
LOBATTO,
GRID
};

Expand Down Expand Up @@ -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) {
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

}
Loading
Loading