Skip to content

Commit

Permalink
Register two new elements and one new constitutive law (#12686)
Browse files Browse the repository at this point in the history
This PR registers two new U-Pw 2D line interface elements: one having 2+2 nodes, the other one having 3+3 nodes. It also registers a new incremental linear elastic interface law. Unit tests have been added to cover the effect of the element and constitutive law registrations.

Note that the chosen names for registration are still under discussion. They may be changed in the near future.
  • Loading branch information
avdg81 authored Sep 23, 2024
1 parent f6d4948 commit c8c7e8d
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ void KratosGeoMechanicsApplication::Register()
KRATOS_REGISTER_ELEMENT("UPwSmallStrainLinkInterfaceElement3D6N", mUPwSmallStrainLinkInterfaceElement3D6N)
KRATOS_REGISTER_ELEMENT("UPwSmallStrainLinkInterfaceElement3D8N", mUPwSmallStrainLinkInterfaceElement3D8N)

KRATOS_REGISTER_ELEMENT("Geo_UPwLineInterfacePlainStrainElement2Plus2N", mUPwLineInterfacePlaneStrainElement2Plus2N)
KRATOS_REGISTER_ELEMENT("Geo_UPwLineInterfacePlainStrainElement3Plus3N", mUPwLineInterfacePlaneStrainElement3Plus3N)

// Updated-Lagranian elements
KRATOS_REGISTER_ELEMENT("UPwUpdatedLagrangianElement2D3N", mUPwUpdatedLagrangianElement2D3N)
KRATOS_REGISTER_ELEMENT("UPwUpdatedLagrangianElement2D4N", mUPwUpdatedLagrangianElement2D4N)
Expand Down Expand Up @@ -367,6 +370,8 @@ void KratosGeoMechanicsApplication::Register()
KRATOS_REGISTER_CONSTITUTIVE_LAW("LinearElastic2DBeamLaw", mLinearElastic2DBeamLaw)
KRATOS_REGISTER_CONSTITUTIVE_LAW("TrussBackboneConstitutiveLaw", mTrussBackboneConstitutiveLaw)

KRATOS_REGISTER_CONSTITUTIVE_LAW("Geo_IncrementalLinearElasticInterfaceLaw", mIncrementalLinearElasticInterfaceLaw)

// Register Variables
KRATOS_REGISTER_VARIABLE(VELOCITY_COEFFICIENT)
KRATOS_REGISTER_VARIABLE(DT_PRESSURE_COEFFICIENT)
Expand Down
12 changes: 12 additions & 0 deletions applications/GeoMechanicsApplication/geo_mechanics_application.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#include "custom_conditions/thermal_point_flux_condition.h"

// Geometries
#include "custom_geometries/line_interface_geometry.h"
#include "geometries/hexahedra_3d_20.h"
#include "geometries/hexahedra_3d_27.h"
#include "geometries/hexahedra_3d_8.h"
Expand Down Expand Up @@ -88,6 +89,7 @@
#include "custom_elements/U_Pw_updated_lagrangian_FIC_element.hpp"
#include "custom_elements/U_Pw_updated_lagrangian_element.hpp"
#include "custom_elements/drained_U_Pw_small_strain_element.hpp"
#include "custom_elements/line_interface_element.h"
#include "custom_elements/small_strain_U_Pw_diff_order_element.hpp"
#include "custom_elements/steady_state_Pw_element.hpp"
#include "custom_elements/steady_state_Pw_interface_element.hpp"
Expand Down Expand Up @@ -118,6 +120,7 @@
#include "custom_constitutive/bilinear_cohesive_2D_law.hpp"
#include "custom_constitutive/bilinear_cohesive_3D_law.hpp"
#include "custom_constitutive/elastic_isotropic_K0_3d_law.h"
#include "custom_constitutive/incremental_linear_elastic_interface_law.h"
#include "custom_constitutive/linear_elastic_2D_beam_law.h"
#include "custom_constitutive/linear_elastic_2D_interface_law.h"
#include "custom_constitutive/linear_elastic_3D_interface_law.h"
Expand Down Expand Up @@ -556,6 +559,13 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) KratosGeoMechanicsApplication : publ
0, Kratos::make_shared<HexahedraInterface3D8<NodeType>>(Element::GeometryType::PointsArrayType(8)),
std::make_unique<ThreeDimensionalStressState>()};

const LineInterfaceElement mUPwLineInterfacePlaneStrainElement2Plus2N{
0, Kratos::make_shared<LineInterfaceGeometry<Line2D2<NodeType>>>(
Element::GeometryType::PointsArrayType(4))};
const LineInterfaceElement mUPwLineInterfacePlaneStrainElement3Plus3N{
0, Kratos::make_shared<LineInterfaceGeometry<Line2D3<NodeType>>>(
Element::GeometryType::PointsArrayType(6))};

// Updated-Lagrangian elements:
const UPwUpdatedLagrangianElement<2, 3> mUPwUpdatedLagrangianElement2D3N{
0, Kratos::make_shared<Triangle2D3<NodeType>>(Element::GeometryType::PointsArrayType(3)),
Expand Down Expand Up @@ -954,6 +964,8 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) KratosGeoMechanicsApplication : publ
const LinearElastic2DBeamLaw mLinearElastic2DBeamLaw;
const TrussBackboneConstitutiveLaw mTrussBackboneConstitutiveLaw;

const GeoIncrementalLinearElasticInterfaceLaw mIncrementalLinearElasticInterfaceLaw;

///@}

}; // Class KratosGeoMechanicsApplication
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
#include "geo_mechanics_application.h"
#include "geo_mechanics_fast_suite.h"

#include <string>

using namespace std::string_literals;

namespace Kratos::Testing
{

Expand Down Expand Up @@ -55,4 +59,33 @@ KRATOS_TEST_CASE_IN_SUITE(ThermalAnalysisVariablesExistAfterRegistration, Kratos
}
}

KRATOS_TEST_CASE_IN_SUITE(IncrementalLinearElasticConstitutiveLawIsAvailableAfterGeoAppRegistration, KratosGeoMechanicsFastSuiteWithoutKernel)
{
KratosGeoMechanicsApplication geo_app;
const auto constitutive_law_name = "Geo_IncrementalLinearElasticInterfaceLaw"s;

KRATOS_EXPECT_FALSE(KratosComponents<ConstitutiveLaw>::Has(constitutive_law_name))

geo_app.Register();

KRATOS_EXPECT_TRUE(KratosComponents<ConstitutiveLaw>::Has(constitutive_law_name))
}

KRATOS_TEST_CASE_IN_SUITE(LineInterfaceElementsAreAvailableAfterGeoAppRegistration, KratosGeoMechanicsFastSuiteWithoutKernel)
{
KratosGeoMechanicsApplication geo_app;
const auto element_type_names = std::vector<std::string>{"Geo_UPwLineInterfacePlainStrainElement2Plus2N",
"Geo_UPwLineInterfacePlainStrainElement3Plus3N"};

for (const auto& r_name : element_type_names) {
KRATOS_EXPECT_FALSE(KratosComponents<Element>::Has(r_name))
}

geo_app.Register();

for (const auto& r_name : element_type_names) {
KRATOS_EXPECT_TRUE(KratosComponents<Element>::Has(r_name))
}
}

} // namespace Kratos::Testing

0 comments on commit c8c7e8d

Please sign in to comment.