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

[FastPR][Structural] Skip test and verbosity in structural mechanics application tests #12162

Merged
merged 3 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ namespace
calculate_norm_dx);

p_solving_strategy->Check();
p_solving_strategy->SetEchoLevel(0);

// Fix the boundary nodes
p_node_1->Fix(DISPLACEMENT_X);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ PrimalTestSolver::PrimalTestSolver(ModelPart* pPrimalModelPart, unsigned Respons
double PrimalTestSolver::CalculateResponseValue()
{
auto p_solver = CreateSolvingStrategy();
p_solver->SetEchoLevel(0);
p_solver->Initialize();
p_solver->Solve();
auto p_response_function = ResponseFunctionFactory(mpPrimalModelPart, mResponseNodeId);
Expand Down Expand Up @@ -335,6 +336,7 @@ AdjointTestSolver::AdjointTestSolver(ModelPart* pAdjointModelPart, unsigned Resp
auto p_adjoint_response_function =
ResponseFunctionFactory(mpAdjointModelPart, mResponseNodeId);
auto p_adjoint_solver = CreateAdjointSolvingStrategy(p_adjoint_response_function);
p_adjoint_solver->SetEchoLevel(0);
p_adjoint_solver->Initialize();
p_adjoint_solver->Solve();
SensitivityBuilder sensitivity_builder(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ void SolvePrimal(ModelPart* pModelPart,
std::function<void(ModelPart*)> CallerFun)
{
auto p_solver = CreatePrimalSolvingStrategy(pModelPart);
p_solver->SetEchoLevel(0);
p_solver->Initialize();
const double start_time = 0.0;
pModelPart->CloneTimeStep(start_time - DeltaTime);
Expand Down Expand Up @@ -291,6 +292,7 @@ void SolveAdjoint(ModelPart* pAdjointModelPart,
auto p_response_function = ResponseFunctionFactory(pAdjointModelPart, ResponseNodeId);
auto p_adjoint_solver =
CreateAdjointSolvingStrategy(pAdjointModelPart, p_response_function);
p_adjoint_solver->SetEchoLevel(0);
p_adjoint_solver->Initialize();
SensitivityBuilder sensitivity_builder(
Parameters(R"(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ 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)
const std::string claw_name = "HyperElasticPlaneStrain2DLaw";
if (!KratosComponents<ConstitutiveLaw>::Has(claw_name)) {
return;
}

// Set the test model part
Model current_model;
auto &r_model_part = current_model.CreateModelPart("ModelPart",1);
Expand Down Expand Up @@ -175,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
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ class ResidualBasedNewtonRaphsonStrategy
{
BaseType::mEchoLevel = Level;
GetBuilderAndSolver()->SetEchoLevel(Level);
mpConvergenceCriteria->SetEchoLevel(Level);
}

//*********************************************************************************
Expand Down
Loading