diff --git a/cardmech/test/elasticity/CMakeLists.txt b/cardmech/test/elasticity/CMakeLists.txt index 295649abd48ebf602a5a7cb7ed670edd5e36facb..d111d1e8bf0a290919d1d42a66726af5837d3848 100644 --- a/cardmech/test/elasticity/CMakeLists.txt +++ b/cardmech/test/elasticity/CMakeLists.txt @@ -13,6 +13,7 @@ add_mpp_test(TestElasticityBlock ELASTICITY) add_mpp_test(TestCFLCondition ELASTICITY) add_mpp_test(TestPrestress ELASTICITY) add_mpp_test(TestVolume ELASTICITY) +add_mpp_test(TestVolumePenalty ELASTICITY) # === Parallel MPI tests === add_mpi_test(TestDirichletBeam ELASTICITY) @@ -22,4 +23,5 @@ add_mpi_test(TestElasticityBlock ELASTICITY) #add_mpi_test(TestDynamicBoundary ELASTICITY) add_mpi_test(TestCFLCondition ELASTICITY) add_mpi_test(TestPrestress ELASTICITY) -add_mpi_test(TestVolume ELASTICITY) \ No newline at end of file +add_mpi_test(TestVolume ELASTICITY) +add_mpi_test(TestVolumePenalty ELASTICITY) \ No newline at end of file diff --git a/cardmech/test/elasticity/TestVolumePenalty.cpp b/cardmech/test/elasticity/TestVolumePenalty.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a9280a597cba7f1af4c0a3769c38337e84ade140 --- /dev/null +++ b/cardmech/test/elasticity/TestVolumePenalty.cpp @@ -0,0 +1,81 @@ +#include "TestEnvironment.hpp" +#include "TestConfigurations.hpp" +#include "MainElasticity.hpp" + +constexpr double BEAM_TEST_TOLERANCE = 1e-1; + +class VolumePenaltyTest : public TestWithParam<std::string> { +protected: + MainElasticity *cmMain; + + VolumePenaltyTest() {} + + void SetUp() override { + std::map<std::string, std::string> testConfig = CARDIAC_TEST_CONFIG; + + testConfig["Model"] = "ActiveStrainElasticity"; + testConfig["MechModel"] = "Static"; + testConfig["MechDiscretization"] = "Passive"; + testConfig["PressureSteps"] = "10"; + testConfig["WithPrestress"] = "0"; + + testConfig["MechProblem"] = "ConstantPressure"; + testConfig["LVPressure"] = "10000"; + testConfig["RVPressure"] = "0"; + testConfig["RAPressure"] = "0"; + testConfig["LAPressure"] = "0"; + + testConfig["ProblemDimension"] = "3"; + testConfig["ProblemGeometry"] = "Tet"; + + testConfig["Mesh"] = "QuarterEllipsoid"; + testConfig["MechLevel"] = "0"; + testConfig["MechPolynomialDegree"] = "1"; + + + testConfig["ActiveMaterial"] = "Bonet"; + testConfig["GuccioneMat_C"] = "10000"; + testConfig["GuccioneMat_bf"] = "10"; + testConfig["GuccioneMat_bs"] = "10"; + testConfig["GuccioneMat_bfs"] = "10"; + + testConfig["VolumetricSplit"] = "0"; + testConfig["Incompressible"] = "false"; + testConfig["QuasiCompressiblePenalty"] = GetParam(); + testConfig["VolumetricPenalty"] = "20000"; + testConfig["PermeabilityPenalty"] = "20000"; + + Config::initialize(testConfig); + + cmMain = new MainElasticity(); + cmMain->Initialize(); + } + + void TearDown() override { + Config::close(); + } + + ~VolumePenaltyTest() override { + delete cmMain; + } +}; + + +TEST_P(VolumePenaltyTest, Consistency) { + Vector &solution = cmMain->Run(); + + mout << norm(solution) << endl; + +} + +INSTANTIATE_TEST_SUITE_P(TestVolumeFunctions, VolumePenaltyTest, Values( + "None", "Ciarlet", "Logarithmic" +)); + +int main(int argc, char **argv) { + MppTest mppTest = MppTestBuilder(argc, argv). + WithPPM(). + WithScreenLogging(). + WithoutDefaultConfig(); + return mppTest.RUN_ALL_MPP_TESTS(); +} \ No newline at end of file