Commit 7570863e authored by webmanue's avatar webmanue Committed by Manuel Weberndorfer
Browse files

use ALMM instead of PDIPM

- tests now pass when run with 3 MPI ranks
parent a230e119
......@@ -26,6 +26,7 @@
using ae108::cppptest::isLocal;
using ae108::cppptest::ScalarEqIfLocal;
using ae108::cppptest::ScalarNearIfLocal;
using testing::Test;
using testing::Types;
......@@ -146,7 +147,7 @@ TYPED_TEST(TAOSolver_Test, minimizes_with_equality_constraints) {
using matrix_type = typename TestFixture::matrix_type;
typename TestFixture::solver_type solver(
matrix_type(2, 2), TestFixture::solver_type::Type::pdipm);
matrix_type(2, 2), TestFixture::solver_type::Type::almm);
const auto value = 5.;
......@@ -184,7 +185,7 @@ TYPED_TEST(TAOSolver_Test, minimizes_with_equality_constraints) {
},
tag<DistributedTag>(vector_type::fromList({3., 4.})));
EXPECT_THAT(solution.unwrap(), ScalarEqIfLocal(0, value));
EXPECT_THAT(solution.unwrap(), ScalarNearIfLocal(0, value, 1e-7));
EXPECT_THAT(solution.unwrap(), ScalarEqIfLocal(1, 2.));
}
......
......@@ -265,7 +265,7 @@ GeneralizedTAOSolver<Assembler>::computeSolution(
const auto global = matrix.size();
const auto local = matrix.localSize();
Solver solver{std::move(matrix), Solver::Type::pdipm};
Solver solver{std::move(matrix), Solver::Type::almm};
solver.setConstraints(typename Solver::EqualityConstraints{
boundaryConditions.residual
......
......@@ -22,6 +22,7 @@
#include <gmock/gmock.h>
using ae108::cppptest::ScalarEqIfLocal;
using ae108::cppptest::ScalarNearIfLocal;
using testing::Types;
namespace ae108 {
......@@ -78,8 +79,8 @@ TYPED_TEST(GeneralizedTAOSolver_Test, solves_partially_constrained_problem) {
vector_type::fromGlobalMesh(this->mesh), assembler_type::constantTime,
&this->assembler);
EXPECT_THAT(solution.unwrap(), ScalarEqIfLocal(0, 3. / 2.));
EXPECT_THAT(solution.unwrap(), ScalarEqIfLocal(1, 3. / 2.));
EXPECT_THAT(solution.unwrap(), ScalarNearIfLocal(0, 3. / 2., 1e-6));
EXPECT_THAT(solution.unwrap(), ScalarNearIfLocal(1, 3. / 2., 1e-6));
}
TYPED_TEST(GeneralizedTAOSolver_Test, solves_fully_constrained_problem) {
......@@ -111,8 +112,8 @@ TYPED_TEST(GeneralizedTAOSolver_Test, solves_fully_constrained_problem) {
vector_type::fromGlobalMesh(this->mesh), assembler_type::constantTime,
&this->assembler);
EXPECT_THAT(solution.unwrap(), ScalarEqIfLocal(0, 3.));
EXPECT_THAT(solution.unwrap(), ScalarEqIfLocal(1, 4.));
EXPECT_THAT(solution.unwrap(), ScalarNearIfLocal(0, 3., 1e-6));
EXPECT_THAT(solution.unwrap(), ScalarNearIfLocal(1, 4., 1e-6));
}
TYPED_TEST(GeneralizedTAOSolver_Test,
......
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