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

fixed DynamicBoundaryTests with Pressure Boundary Condition

parent 3ee37c96
No related branches found
No related tags found
1 merge request!243Resolve "Fix DynamicBoundaryNeumann Tests"
Pipeline #126195 passed
......@@ -227,40 +227,40 @@ VectorField DExponentialDirichletProblem::Load(double time, const Point &x, cons
VectorField DPolynomialNeumannProblem::Deformation(double time, const Point &x) const {
VectorField u(0.5 * x[0] * x[0], 0.5 * x[1] * x[1], spaceDim > 2 ? 0.5 * x[2] * x[2] : 0.0);
VectorField u(0.5 * x[0] * x[0], 0.5 * x[1] * x[1], 0.5 * x[2] * x[2]);
return time * time * u;
}
VectorField DPolynomialNeumannProblem::Velocity(double time, const Point &x) const {
VectorField u(0.5 * x[0] * x[0], 0.5 * x[1] * x[1], spaceDim > 2 ? 0.5 * x[2] * x[2] : 0.0);
VectorField u(0.5 * x[0] * x[0], 0.5 * x[1] * x[1], 0.5 * x[2] * x[2]);
return 2.0 * time * u;
}
VectorField DPolynomialNeumannProblem::Acceleration(double time, const Point &x) const {
VectorField u(0.5 * x[0] * x[0], 0.5 * x[1] * x[1], spaceDim > 2 ? 0.5 * x[2] * x[2] : 0.0);
VectorField u(0.5 * x[0] * x[0], 0.5 * x[1] * x[1], 0.5 * x[2] * x[2] );
return 2.0 * u;
}
Tensor DPolynomialNeumannProblem::DeformationGradient(double time, const Point &x) const {
Tensor Du(x[0], 0.0, 0.0, 0.0, x[1], 0.0, 0.0, 0.0, spaceDim > 2 ? x[2] : 0.0);
Tensor Du(x[0], 0.0, 0.0, 0.0, x[1], 0.0, 0.0, 0.0, x[2]);
return time * time * Du;
}
VectorField DPolynomialNeumannProblem::Load(double time, const Point &x, const Cell &c) const {
VectorField a = Acceleration(time, x);
VectorField u(1.0, 1.0, spaceDim > 2 ? 1.0 : 0.0);
VectorField u(1.0, 1.0, 1.0);
return a - time * time * u;
}
double DPolynomialNeumannProblem::pressure(double t, const Point &x, int bndCondition) const {
if (bndCondition == 230) {
return -t * t * ((x[0]) / ((1 + x[1]) * (1 + x[2])));
return - ((t*t*x[0]) / ((1 + t*t*x[1]) * (1 + t*t*x[2])));
} else if (bndCondition == 232) {
return -t * t * ((x[1]) / ((1 + x[0]) * (1 + x[2])));
return -((t*t*x[1]) / ((1 +t*t* x[0]) * (1 + t*t*x[2])));
} else if (bndCondition == 231) {
return -t * t * ((x[2]) / ((1 + x[0]) * (1 + x[1])));
return - ((t*t*x[2]) / ((1 + t*t*x[0]) * (1 + t*t*x[1])));
} else {
return 0;
}
......@@ -274,14 +274,12 @@ VectorField DExponentialNeumannProblem::Deformation(double time, const Point &x)
}
VectorField DExponentialNeumannProblem::Velocity(double time, const Point &x) const {
VectorField u(cos(0.5 * Pi * x[0]), cos(0.5 * Pi * x[1]),
spaceDim > 2 ? cos(0.5 * Pi * x[2]) : 0.0);
VectorField u(cos(0.5 * Pi * x[0]), cos(0.5 * Pi * x[1]), cos(0.5 * Pi * x[2]));
return -cos(0.5 * Pi * time) * u;
}
VectorField DExponentialNeumannProblem::Acceleration(double time, const Point &x) const {
VectorField u(cos(0.5 * Pi * x[0]), cos(0.5 * Pi * x[1]),
spaceDim > 2 ? cos(0.5 * Pi * x[2]) : 0.0);
VectorField u(cos(0.5 * Pi * x[0]), cos(0.5 * Pi * x[1]), cos(0.5 * Pi * x[2]) );
return 0.5 * Pi * sin(0.5 * Pi * time) * u;
}
......@@ -289,7 +287,7 @@ VectorField DExponentialNeumannProblem::Acceleration(double time, const Point &x
Tensor DExponentialNeumannProblem::DeformationGradient(double time, const Point &x) const {
Tensor Du(- 0.5 * Pi * sin(0.5 * Pi * x[0]), 0.0, 0.0,
0.0, - 0.5 * Pi * sin(0.5 * Pi * x[1]), 0.0,
0.0, 0.0, spaceDim > 2 ? - 0.5 * Pi * sin(0.5 * Pi * x[2]) : 0.0
0.0, 0.0, - 0.5 * Pi * sin(0.5 * Pi * x[2])
);
return -2.0 / Pi * sin(0.5 * Pi * time) * Du;
}
......@@ -297,26 +295,22 @@ Tensor DExponentialNeumannProblem::DeformationGradient(double time, const Point
VectorField DExponentialNeumannProblem::Load(double time, const Point &x, const Cell &c) const {
VectorField a = Acceleration(time, x);
VectorField u(-0.25 * Pi * Pi * cos(0.5 * Pi * x[0]), -0.25 * Pi * Pi * cos(0.5 * Pi * x[1]),
spaceDim > 2 ? -0.25 * Pi * Pi * cos(0.5 * Pi * x[2]) : 0.0);
-0.25 * Pi * Pi * cos(0.5 * Pi * x[2]));
return a - (-2.0 / Pi * sin(0.5 * Pi * time) * u);
}
double DExponentialNeumannProblem::pressure(double t, const Point &x, int bndCondition) const {
if (bndCondition == 230) {
return 2.0 / Pi * sin(0.5 * Pi * t) * ((1 - 0.5 * sin(0.5 * Pi * x[0])) /
((1 - 0.5 * sin(0.5 * Pi * x[1])) *
(1 - 0.5 * sin(0.5 * Pi * x[2]))));
return - sin(0.5 * Pi * t) * sin(0.5 * Pi * x[0]) /((sin(0.5 * Pi * x[1]) * sin(0.5 * Pi * t) + 1) *
(sin(0.5 * Pi * x[2]) * sin(0.5 * Pi * t) + 1));
} else if (bndCondition == 232) {
return 2.0 / Pi * sin(0.5 * Pi * t) * ((1 - 0.5 * sin(0.5 * Pi * x[1])) /
((1 - 0.5 * sin(0.5 * Pi * x[2])) *
(1 - 0.5 * sin(0.5 * Pi * x[0]))));
return - sin(0.5 * Pi * t) * sin(0.5 * Pi * x[1]) /((sin(0.5 * Pi * x[0]) * sin(0.5 * Pi * t) + 1) *
(sin(0.5 * Pi * x[2]) * sin(0.5 * Pi * t) + 1));
} else if (bndCondition == 231) {
return 2.0 / Pi * sin(0.5 * Pi * t) * ((1 - 0.5 * sin(0.5 * Pi * x[2])) /
((1 - 0.5 * sin(0.5 * Pi * x[1])) *
(1 - 0.5 * sin(0.5 * Pi * x[0]))));
return - sin(0.5 * Pi * t) * sin(0.5 * Pi * x[2]) /((sin(0.5 * Pi * x[1]) * sin(0.5 * Pi * t) + 1) *
(sin(0.5 * Pi * x[0]) * sin(0.5 * Pi * t) + 1));
} else {
return 0;
}
return -sin(0.5 * Pi * t) * sin(0.5 * Pi * x[bndCondition % 230]);
}
......@@ -16,7 +16,7 @@ add_mpp_test(TestQuadraticBeamProblem ELASTICITY)
add_mpp_test(TestLaplaceElasticity ELASTICITY)
#add_mpp_test(TestElasticityBeam ELASTICITY)
#add_mpp_test(TestElasticityBlock ELASTICITY)
#add_mpp_test(TestDynamicBoundary ELASTICITY)
add_mpp_test(TestDynamicBoundary ELASTICITY)
add_mpp_test(TestOscillation ELASTICITY)
add_mpp_test(TestCFLCondition ELASTICITY)
add_mpp_test(TestPrestress ELASTICITY)
......@@ -34,7 +34,7 @@ add_mpi_test(TestQuadraticBeamProblem ELASTICITY)
#add_mpi_test(TestDynamicBoundary ELASTICITY)
#add_mpi_test(TestElasticityBeam ELASTICITY)
#add_mpi_test(TestElasticityBlock ELASTICITY)
#add_mpi_test(TestDynamicBoundary ELASTICITY)
add_mpi_test(TestDynamicBoundary ELASTICITY)
#add_mpi_test(TestCFLCondition ELASTICITY)
add_mpi_test(TestPrestress ELASTICITY)
add_mpi_test(TestVolume ELASTICITY)
......
......@@ -107,8 +107,6 @@ INSTANTIATE_TEST_SUITE_P(DynamicTestOneStep, DBoundaryTest, Values(
// BoundaryTestParam({2, 0.01, "Quad", "Traction", "Exp"}),
// BoundaryTestParam({2, 0.02, "Quad", "Viscosity", "Pol"}),
BoundaryTestParam({2, 0.02, "Quad", "Stiffness", "Exp"}),
BoundaryTestParam({2, 0.02, "Quad", "Neumann", "Pol"}),
BoundaryTestParam({2, 0.02, "Quad", "Neumann", "Exp"}),
//
BoundaryTestParam({2, 0.02, "Tet", "Dirichlet", "Pol"}),
BoundaryTestParam({2, 0.02, "Tet", "Dirichlet", "Exp"}),
......@@ -116,8 +114,6 @@ INSTANTIATE_TEST_SUITE_P(DynamicTestOneStep, DBoundaryTest, Values(
// BoundaryTestParam({2, 0.01, "Tet", "Traction", "Exp"}),
// BoundaryTestParam({2, 0.02, "Tet", "Viscosity", "Pol"}),
BoundaryTestParam({2, 0.02, "Tet", "Stiffness", "Exp"}),
BoundaryTestParam({2, 0.02, "Tet", "Neumann", "Pol"}),
BoundaryTestParam({2, 0.02, "Tet", "Neumann", "Exp"}),
BoundaryTestParam({3, 0.02, "Quad", "Dirichlet", "Pol"}),
BoundaryTestParam({3, 0.02, "Quad", "Dirichlet", "Exp"}),
......@@ -146,8 +142,6 @@ INSTANTIATE_TEST_SUITE_P(DynamicTestTwoStep, DBoundaryTest, Values(
// BoundaryTestParam({2, 0.02, "Quad", "Traction", "Exp"}),
// BoundaryTestParam({2, 0.04, "Quad", "Viscosity", "Pol"}),
BoundaryTestParam({2, 0.04, "Quad", "Stiffness", "Exp"}),
BoundaryTestParam({2, 0.04, "Quad", "Neumann", "Pol"}),
BoundaryTestParam({2, 0.04, "Quad", "Neumann", "Exp"}),
//
BoundaryTestParam({2, 0.04, "Tet", "Dirichlet", "Pol"}),
BoundaryTestParam({2, 0.04, "Tet", "Dirichlet", "Exp"}),
......@@ -155,8 +149,6 @@ INSTANTIATE_TEST_SUITE_P(DynamicTestTwoStep, DBoundaryTest, Values(
// BoundaryTestParam({2, 0.02, "Tet", "Traction", "Exp"}),
// BoundaryTestParam({2, 0.04, "Tet", "Viscosity", "Pol"}),
BoundaryTestParam({2, 0.04, "Tet", "Stiffness", "Exp"}),
BoundaryTestParam({2, 0.04, "Tet", "Neumann", "Pol"}),
BoundaryTestParam({2, 0.04, "Tet", "Neumann", "Exp"}),
//
BoundaryTestParam({3, 0.04, "Quad", "Dirichlet", "Pol"}),
BoundaryTestParam({3, 0.04, "Quad", "Dirichlet", "Exp"}),
......@@ -184,16 +176,12 @@ INSTANTIATE_TEST_SUITE_P(DynamicTestFullTime, DBoundaryTest, Values(
// BoundaryTestParam({2, 1.0, "Quad", "Traction", "Pol"}),
// BoundaryTestParam({2, 1.0, "Quad", "Traction", "Exp"}),
// BoundaryTestParam({2, 1.0, "Quad", "Stiffness", "Exp"}),
BoundaryTestParam({2, 1.0, "Quad", "Neumann", "Pol"}),
BoundaryTestParam({2, 1.0, "Quad", "Neumann", "Exp"}),
BoundaryTestParam({2, 1.0, "Tet", "Dirichlet", "Pol"}),
BoundaryTestParam({2, 1.0, "Tet", "Dirichlet", "Exp"}),
// BoundaryTestParam({2, 1.0, "Tet", "Traction", "Pol"}),
//BoundaryTestParam({2, 1.0, "Tet", "Traction", "Exp"}),
// BoundaryTestParam({2, 1.0, "Tet", "Stiffness", "Exp"}),
BoundaryTestParam({2, 1.0, "Tet", "Neumann", "Pol"}),
BoundaryTestParam({2, 1.0, "Tet", "Neumann", "Exp"}),
//
BoundaryTestParam({3, 1.0, "Quad", "Dirichlet", "Pol"}),
BoundaryTestParam({3, 1.0, "Quad", "Dirichlet", "Exp"}),
......
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