Skip to content
Snippets Groups Projects
Commit e5f2b343 authored by Laura Stengel's avatar Laura Stengel
Browse files

Merge branch '225-fix-prestress' into 'feature'

Resolve "Fix Prestress"

Closes #225

See merge request mpp/cardmech!247
parents 463d1606 a09690ab
No related branches found
No related tags found
1 merge request!247Resolve "Fix Prestress"
Pipeline #126323 passed
......@@ -7,6 +7,7 @@
LagrangeElasticity::LagrangeElasticity(ElasticityProblem &eP, int degree, bool isStatic)
: IElasticity(eP), disc(eP.GetMeshes(), degree, dim()) {
this->degree = degree;
Config::Get("activeDeformation", name);
}
double LagrangeElasticity::Energy(const Vector &u) const {
......@@ -904,8 +905,6 @@ void LagrangeElasticity::SetDisplacement(Vector &u) const {
}
void LagrangeElasticity::UpdateStretch(const Vector &gamma_f) const {
std::string name;
Config::Get("activeDeformation", name);
//Quarteroni
if ((name == "Quarteroni") || name == "Quarteroni2") {
for (row r = gamma->rows(); r != gamma->rows_end(); ++r) {
......
......@@ -7,6 +7,7 @@
class LagrangeElasticity : public IElasticity {
int size{3};
const LagrangeDiscretization disc;
std::string name;
void fixationBnd(const cell &c, const Vector &U, RowBndValues &u_c, int face) const;
......
......@@ -19,7 +19,7 @@ add_mpp_test(TestLaplaceElasticity ELASTICITY)
#add_mpp_test(TestDynamicBoundary ELASTICITY)
add_mpp_test(TestOscillation ELASTICITY)
add_mpp_test(TestCFLCondition ELASTICITY)
#add_mpp_test(TestPrestress ELASTICITY)#TODO should be included again
add_mpp_test(TestPrestress ELASTICITY)
add_mpp_test(TestVolume ELASTICITY)
#add_mpp_test(TestVolumePenalty ELASTICITY)
......@@ -35,7 +35,7 @@ add_mpi_test(TestQuadraticBeamProblem ELASTICITY)
#add_mpi_test(TestElasticityBlock ELASTICITY)
add_mpi_test(TestDynamicBoundary ELASTICITY)
#add_mpi_test(TestCFLCondition ELASTICITY)
#add_mpi_test(TestPrestress ELASTICITY) #TODO should be included again
add_mpi_test(TestPrestress ELASTICITY)
add_mpi_test(TestVolume ELASTICITY)
#add_mpi_test(TestOscillation ELASTICITY)
......@@ -30,6 +30,11 @@ protected:
testConfig["PrestressSteps"] = "5";
testConfig["WithPrestress"] = "true";
testConfig["MechEpsilon"] = "1e-12";
testConfig["NewtonEpsilon"] = "1e-11";
testConfig["NewtonReduction"] = "1e-12";
testConfig["WithPrestress"] = "true";
//testConfig["Mesh"] = GetParam().meshName;
testConfig["Mechlevel"] = std::to_string(GetParam().level);
......@@ -61,7 +66,8 @@ protected:
TEST_P(PrestressTest, TestInitialValue) {
Vector &solution = cmMain->Run();
mout << solution << endl;
mout << "solution " << solution << endl;
mout << "num " << cmMain->EvaluateQuantity(solution, "L2") << endl << endl;
for (row r = solution.rows(); r != solution.rows_end(); ++r) {
for (int i = 0; i < r.n(); ++i) {
EXPECT_NEAR(solution(r, i), 0.0, NEWTON_TOLERANCE);
......@@ -109,6 +115,6 @@ INSTANTIATE_TEST_SUITE_P(OnEllipsoid, PrestressTest, Values(
*/
int main(int argc, char **argv) {
MppTest mppTest = MppTestBuilder(argc, argv).WithPPM().WithoutDefaultConfig().WithScreenLogging();
MppTest mppTest = MppTestBuilder(argc, argv).WithPPM().WithoutDefaultConfig().WithScreenLogging().WithFileLogging();
return mppTest.RUN_ALL_MPP_TESTS();
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment