Skip to content

Commit

Permalink
Constitutive law name variable
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenzorrilla authored Mar 7, 2024
1 parent 7d26158 commit cef1dce
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ namespace Kratos::Testing
KRATOS_TEST_CASE_IN_SUITE(TotalLagrangianMixedVolumetricStrainElementBonetPatch, KratosStructuralMechanicsFastSuite)
{
// Skip the test if the constitutive law is not available (i.e. the ConstitutiveLawsApplication is not compiled)
if (!KratosComponents<ConstitutiveLaw>::Has("HyperElasticPlaneStrain2DLaw")) {
const std::string claw_name = "HyperElasticPlaneStrain2DLaw";
if (!KratosComponents<ConstitutiveLaw>::Has(claw_name)) {
return;
}

Expand Down Expand Up @@ -180,7 +181,7 @@ namespace Kratos::Testing
auto p_elem_prop = r_model_part.CreateNewProperties(1);
p_elem_prop->SetValue(YOUNG_MODULUS, 250.0);
p_elem_prop->SetValue(POISSON_RATIO, 0.25);
const auto &r_clone_cl = KratosComponents<ConstitutiveLaw>::Get("HyperElasticPlaneStrain2DLaw");
const auto &r_clone_cl = KratosComponents<ConstitutiveLaw>::Get(claw_name);
p_elem_prop->SetValue(CONSTITUTIVE_LAW, r_clone_cl.Clone());
for (auto& r_elem: r_model_part.Elements()) {
r_elem.SetProperties(p_elem_prop);
Expand Down

0 comments on commit cef1dce

Please sign in to comment.