Commit 21613a2b authored by uheqb's avatar uheqb
Browse files

added new Testconfiguration for CardiacBeam and edit TestParameters

parent 84312569
Pipeline #219240 passed with stages
in 37 minutes
......@@ -12,13 +12,13 @@ set_option(MPP_BUILD_TYPE MppDebug)
#set_option(MPP_BUILD_TYPE MppRelease)
set_option(SUPPRESS_WARNINGS OFF)
set_option(AFFINE_LINEAR_TRAFO ON)
set_option(BUILD_TESTS ON)
set_option(BUILD_TESTS OFF)
set_option(BUILD_CARDIAC_TESTS ON)
set_option(BUILD_IBTLIBRARY OFF)
set_option(BUILD_TUTORIAL ON)
set_option(BUILD_TUTORIAL_TESTS ON)
set_option(BUILD_TUTORIAL OFF)
set_option(BUILD_TUTORIAL_TESTS OFF)
#---------------------------------------------------------------------------------------#
......
//
// Created by laura on 13.06.22.
//
#ifndef CARDMECH_TESTCARDIACBEAMCONFIGURATION_H
#define CARDMECH_TESTCARDIACBEAMCONFIGURATION_H
#include <map>
struct ConfigMaps {
std::string confPath;
std::map<std::string, std::string> defaultMap;
std::map<std::string, std::string> additionalMap;
};
static const std::map<std::string, std::string> CARDIACBEAM_TEST_CONFIG{
// ----- Problem Settings -----
{"GeoPath", "../../../../geo/"},
{"EulerReAssemble", "0"},
{"PressureIterations", "10"},
{"PressureDepth", "0"},
// === Linear Solver === //
{"LinearSolver", "gmres"},
{"LinearEpsilon", "1e-8"},
{"LinearReduction", "1e-8"},
{"LinearReduction", "1e-11"},
{"LinearSteps", "10000"},
{"BasePreconditioner", "GaussSeidel"},
{"Preconditioner", "GaussSeidel"},
// =================================================================
// === Gating Solver ===============================================
{"GatingSolver", "gmres"},
{"GatingPreconditioner", "GaussSeidel"},
{"GatingEpsilon", "1e-8"},
{"GatingReduction", "1e-12"},
// === Elphy Solver ================================================
{"ElphySolver", "gmres"},
{"ElphyPreconditioner", "GaussSeidel"},
{"ElphyEpsilon", "1e-8"},
{"ElphyReduction", "1e-12"},
// === Stretch Solver ==============================================
{"StretchSolver", "gmres"},
{"StretchPreconditioner", "GaussSeidel"},
{"StretchEpsilon", "1e-8"},
{"StretchReduction", "1e-12"},
// === Mechanics Solver ============================================
{"MechSolver", "gmres"},
{"MechPreconditioner", "GaussSeidel"},
{"MechEpsilon", "1e-8"},
{"MechReduction", "1e-12"},
{"MechSteps", "10000"},
// === Newton Method === //
{"NewtonEpsilon", "1e-8"},
{"NewtonReduction", "1e-10"},
{"NewtonSteps", "200"},
{"NewtonLineSearchSteps", "50"},
{"NewtonLinearizationReduction", "1e-12"},
{"Smoother", "GaussSeidel"},
{"presmoothing", "3"},
{"postsmoothing", "3"},
{"Overlap_Distribution", "0"},
{"DebugLevel", "0"},
{"TimeLevel", "0"},
{"precision", "10"},
{"MechPlot", "0"},
{"PlotVertexPotential", "0"},
{"PlotVTK", "0"},
{"PlottingSteps", "1"},
{"h0", "1e-4"},
{"h_min", "1e-6"},
{"PlotStress", "0"},
{"plevel", "0"},
{"Model", "ActiveStrainElasticity"},
{"Mesh", "BenchmarkBeam3DTet"},
{"Incompressible", "false"},
{"QuasiCompressiblePenalty", "None"},
{"VolumetricPenalty", "2"},
{"PermeabilityPenalty", "2"},
// === Material Parameters ===//
/**************************************************
* Linear Material
**************************************************/
{"LinearMat_Mu" , "2"},
{"LinearMat_Lambda", "4"},
/**************************************************
* Bonet Material
**************************************************/
{"GuccioneMat_C","2"},
{"GuccioneMat_bf", "8"},
{"GuccioneMat_bs", "2"},
{"GuccioneMat_bfs", "4"},
// === Verbose Levels ===//
{"AssembleVerbose", "-1"},
{"MultigridVerbose", "-1"},
{"BaseSolverVerbose", "-1"},
{"LinearVerbose", "-1"},
{"NewtonVerbose", "-1"},
{"MechVerbose", "-1"},
{"ElphyVerbose", "-1"},
{"ElphyLinearSolverVerbose", "-1"},
{"ElphySolverVerbose", "-1"}
};
#endif //CARDMECH_TESTCARDIACBEAMCONFIGURATION_H
......@@ -4,19 +4,16 @@
#include "MainElasticity.hpp"
#include "TestEnvironment.hpp"
#include "TestConfigurations.hpp"
//#include "TestConfigurations.hpp"
#include "TestCardiacBeamConfiguration.hpp"
std::vector<std::string> elasticityProblems{"CardiacBeam"};
struct TestBeamParameter {
std::string discretization;
int problemLevel;
int degree;
std::string material;
std::string QuasiCompressiblePenalty;
double NewtonDamping;
std::string Overlap;
int OverlapDistribution;
int DGPenalty;
};
......@@ -37,53 +34,34 @@ protected:
void SetUp() override {
std::map<string, string> testConfig = CARDIAC_TEST_CONFIG;
std::map<string, string> testConfig = CARDIACBEAM_TEST_CONFIG;
testConfig["Model"] = "ActiveStrainElasticity";
testConfig["MechModel"] = "Static";
testConfig["LAPressure"] = "0.004";
testConfig["Mesh"] = "BenchmarkBeam3DTet";
testConfig["MechProblem"] = "CardiacBeam"; //TODO noch anpassen auf mehrere Probleme
testConfig["VolumetricPenalty"] = "2";
testConfig["PermeabilityPenalty"] = "2";
testConfig["ConfigVerbose"] = "5";
testConfig["MechLevel"] = std::to_string(GetParam().problemLevel);
testConfig["MechDiscretization"] = GetParam().discretization;
testConfig["ActiveMaterial"] = GetParam().material;
testConfig["QuasiCompressiblePenalty"] = GetParam().QuasiCompressiblePenalty;
testConfig["NewtonDamping"] = std::to_string(GetParam().NewtonDamping);
testConfig["Overlap"] = GetParam().Overlap;
testConfig["Overlap_Distribution"] = std::to_string(GetParam().OverlapDistribution);
testConfig["DGPenalty"] = std::to_string(GetParam().DGPenalty);
/**************************************************
* Linear Material
**************************************************/
testConfig["LinearMat_Mu"] = "2";
testConfig["LinearMat_Lambda"] = "4";
/**************************************************
* Bonet Material
**************************************************/
testConfig["GuccioneMat_C"] = "2";
testConfig["GuccioneMat_bf"] = "8";
testConfig["GuccioneMat_bs"] = "2";
testConfig["GuccioneMat_bfs"] = "4";
if (model =="DG"){
testConfig["MechDiscretization"] = "DG";
testConfig["Overlap_Distribution"] = "1";
testConfig["Overlap"] = "dG1";
}
else if(model == "EG"){
testConfig["MechDiscretization"] = "EG";
testConfig["Overlap_Distribution"] = "1";
testConfig["Overlap"] = "EG";
}
Config::initialize(testConfig);
config.PrintInfo();
mout << "MechLevel Test " << GetParam().problemLevel << endl;
mout << "MechPolynomialDegree Test " << GetParam().degree << endl;
elastProblem = getElasticityProblem();//CardiacBeam
pressProblem = getPressureProblem();//"CardiacBeam"
......@@ -105,7 +83,7 @@ protected:
**************************************************/
class LagrangeElasticityTest : public ElasticityTest {
protected:
LagrangeElasticityTest() : ElasticityTest(GetParam().discretization) {
LagrangeElasticityTest() : ElasticityTest("Conforming") {
}
};
......@@ -113,31 +91,23 @@ TEST_P(LagrangeElasticityTest, AssembleConsistency) {
EXPECT_TRUE(isAssembleConsistent(*assemble, *u));
}
/*std::vector<TestBeamParameter> BeamParameters(int degree) {
return std::vector<TestBeamParameter>{
TestBeamParameter({"Conforming", degree}),
TestBeamParameter({"DG", degree}),
};
}*/
INSTANTIATE_TEST_SUITE_P(Degree_1_Consistency, LagrangeElasticityTest, Values(
TestBeamParameter({"Conforming", 0, 1, "Linear", "None", 1.0, "NoOverlap", 0})
/*TestBeamParameter({"Conforming", 1, 1, "Linear", "None", 1.0, "NoOverlap", 0 }),
TestBeamParameter({"Conforming", 2, 1, "Linear", "None", 1.0, "NoOverlap", 0}),
TestBeamParameter({"Conforming", 0, 1, "Bonet", "Ciarlet", 0.75, "NoOverlap", 0}),
TestBeamParameter({"Conforming", 1, 1, "Bonet", "Ciarlet", 0.75, "NoOverlap", 0}),
TestBeamParameter({"Conforming", 2, 1, "Bonet", "Ciarlet", 0.75, "NoOverlap", 0})*/
TestBeamParameter({0, 1, "Linear", "None", 0}),
TestBeamParameter({ 1, 1, "Linear", "None", 0 }),
/*TestBeamParameter({ 2, 1, "Linear", "None", 0}),*/
TestBeamParameter({0, 1, "Bonet", "Ciarlet", 0}),
TestBeamParameter({1, 1, "Bonet", "Ciarlet", 0})
/*TestBeamParameter({2, 1, "Bonet", "Ciarlet", 0})*/
));
/*INSTANTIATE_TEST_SUITE_P(Degree_2_Consistency, LagrangeElasticityTest,Values(
TestBeamParameter({"Conforming", 0, 2, "Linear", "None", 1.0, "NoOverlap", 0}),
TestBeamParameter({"Conforming", 1, 2, "Linear", "None", 1.0, "NoOverlap", 0 }),
TestBeamParameter({"Conforming", 2, 2, "Linear", "None", 1.0, "NoOverlap", 0}),
TestBeamParameter({"Conforming", 0, 2, "Bonet", "Ciarlet", 0.75, "NoOverlap", 0}),
TestBeamParameter({"Conforming", 1, 2, "Bonet", "Ciarlet", 0.75, "NoOverlap", 0}),
TestBeamParameter({"Conforming", 2, 2, "Bonet", "Ciarlet", 0.75, "NoOverlap", 0})
));*/
INSTANTIATE_TEST_SUITE_P(Degree_2_Consistency, LagrangeElasticityTest,Values(
TestBeamParameter({0, 2, "Linear", "None", 0})/*,
TestBeamParameter({1, 2, "Linear", "None", 0 }),
TestBeamParameter({2, 2, "Linear", "None", 0}),
TestBeamParameter({0, 2, "Bonet", "Ciarlet", 0}),
TestBeamParameter({1, 2, "Bonet", "Ciarlet", 0}),
TestBeamParameter({2, 2, "Bonet", "Ciarlet", 0})*/
));
/**************************************************
......@@ -145,7 +115,7 @@ INSTANTIATE_TEST_SUITE_P(Degree_1_Consistency, LagrangeElasticityTest, Values(
**************************************************/
class DGElasticityTest : public ElasticityTest {
protected:
DGElasticityTest() : ElasticityTest(GetParam().discretization) {
DGElasticityTest() : ElasticityTest("DG") {
}
};
......@@ -153,30 +123,30 @@ TEST_P(DGElasticityTest, AssembleConsistency) {
EXPECT_TRUE(isAssembleConsistent(*assemble, *u));
}
INSTANTIATE_TEST_SUITE_P(Degree_1_Consistency, DGElasticityTest,Values(
TestBeamParameter({"DG", 0, 1, "Linear", "None", 1.0, "dG1", 1, 9})
//TestBeamParameter({"DG", 1, 1, "Linear", "None", 1.0, "dG1", 1, 9 }),
//TestBeamParameter({"DG", 2, 1, "Linear", "None", 1.0, "dG1", 1, 9}),
//TestBeamParameter({"DG", 0, 1, "Bonet", "Ciarlet", 0.75, "dG1", 1, 9})
//TestBeamParameter({"DG", 1, 1, "Bonet", "Ciarlet", 0.75, "dG1", 1, 9})
//TestBeamParameter({"DG", 2, 1, "Bonet", "Ciarlet", 0.75, "dG1", 1, 9})
INSTANTIATE_TEST_SUITE_P(DG_Degree_1_Consistency, DGElasticityTest,Values(
TestBeamParameter({0, 1, "Linear", "None", 9}),
TestBeamParameter({1, 1, "Linear", "None", 9 }),
//TestBeamParameter({2, 1, "Linear", "None", 9}),
TestBeamParameter({0, 1, "Bonet", "Ciarlet", 9}),
TestBeamParameter({1, 1, "Bonet", "Ciarlet", 9})
//TestBeamParameter({2, 1, "Bonet", "Ciarlet", 9})
));
/*INSTANTIATE_TEST_SUITE_P(Degree_1_Consistency, DGElasticityTest,Values(
TestBeamParameter({"DG", 0, 2, "Linear", "None", 1.0, "dG1", 1, 9}),
//TestBeamParameter({"DG", 1, 2, "Linear", "None", 1.0, "dG1", 1, 9 }),
//TestBeamParameter({"DG", 2, 2, "Linear", "None", 1.0, "dG1", 1, 9}),
TestBeamParameter({"DG", 0, 2, "Bonet", "Ciarlet", 0.75, "dG1", 1, 9})
//TestBeamParameter({"DG", 1, 2, "Bonet", "Ciarlet", 0.75, "dG1", 1, 9})
//TestBeamParameter({"DG", 2, 2, "Bonet", "Ciarlet", 0.75, "dG1", 1, 9})
));*/
INSTANTIATE_TEST_SUITE_P(DG_Degree_2_Consistency, DGElasticityTest,Values(
TestBeamParameter({0, 2, "Linear", "None", 9}),
//TestBeamParameter({1, 2, "Linear", "None", 9 }),
//TestBeamParameter({2, 2, "Linear", "None", 9}),
TestBeamParameter({0, 2, "Bonet", "Ciarlet", 9})
//TestBeamParameter({1, 2, "Bonet", "Ciarlet", 9})
//TestBeamParameter({2, 2, "Bonet", "Ciarlet", 9})
));
/**************************************************
* EG Consistency
**************************************************/
class EGElasticityTest : public ElasticityTest {
protected:
EGElasticityTest() : ElasticityTest(GetParam().discretization) {
EGElasticityTest() : ElasticityTest("EG") {
}
};
......@@ -184,23 +154,23 @@ TEST_P(EGElasticityTest, AssembleConsistency) {
EXPECT_TRUE(isAssembleConsistent(*assemble, *u));
}
INSTANTIATE_TEST_SUITE_P(Degree_1_Consistency, EGElasticityTest,Values(
TestBeamParameter({"EG", 0, 1, "Linear", "None", 1.0, "EG", 1, 2}),
//TestBeamParameter({"EG", 1, 1, "Linear", "None", 1.0, "dG1", 1, 2 }),
//TestBeamParameter({"EG", 2, 1, "Linear", "None", 1.0, "dG1", 1, 2}),
TestBeamParameter({"EG", 0, 1, "Bonet", "Ciarlet", 0.75, "EG", 1, 2})
//TestBeamParameter({"EG", 1, 1, "Bonet", "Ciarlet", 0.75, "dG1", 1, 2})
//TestBeamParameter({"EG", 2, 1, "Bonet", "Ciarlet", 0.75, "dG1", 1, 2})
INSTANTIATE_TEST_SUITE_P(EG_Degree_1_Consistency, EGElasticityTest,Values(
TestBeamParameter({0, 1, "Linear", "None", 2}),
TestBeamParameter({1, 1, "Linear", "None", 2 }),
//TestBeamParameter({2, 1, "Linear", "None", 2}),
TestBeamParameter({0, 1, "Bonet", "Ciarlet", 2}),
TestBeamParameter({1, 1, "Bonet", "Ciarlet", 2})
//TestBeamParameter({2, 1, "Bonet", "Ciarlet", 2})
));
/*INSTANTIATE_TEST_SUITE_P(Degree_1_Consistency, DGElasticityTest,Values(
TestBeamParameter({"EG", 0, 2, "Linear", "None", 1.0, "dG1", 1, 2}),
//TestBeamParameter({"EG", 1, 2, "Linear", "None", 1.0, "dG1", 1, 2 }),
//TestBeamParameter({"EG", 2, 2, "Linear", "None", 1.0, "dG1", 1, 2}),
TestBeamParameter({"EG", 0, 2, "Bonet", "Ciarlet", 0.75, "dG1", 1, 2})
//TestBeamParameter({"EG", 1, 2, "Bonet", "Ciarlet", 0.75, "dG1", 1, 2})
//TestBeamParameter({"EG", 2, 2, "Bonet", "Ciarlet", 0.75, "dG1", 1, 2})
));*/
INSTANTIATE_TEST_SUITE_P(EG_Degree_2_Consistency, EGElasticityTest,Values(
TestBeamParameter({0, 2, "Linear", "None", 2})
//TestBeamParameter({1, 2, "Linear", "None", 2 }),
//TestBeamParameter({2, 2, "Linear", "None", 2}),
//TestBeamParameter({0, 2, "Bonet", "Ciarlet", 2})
//TestBeamParameter({1, 2, "Bonet", "Ciarlet", 2})
//TestBeamParameter({2, 2, "Bonet", "Ciarlet", 2})
));
int main(int argc, char **argv) {
return MppTest(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment