From 4c8ae77a51bb63276b6bd0c62085741e25b37ced Mon Sep 17 00:00:00 2001 From: Thomas Witkowski <thomas.witkowski@gmx.de> Date: Wed, 11 Apr 2012 13:09:09 +0000 Subject: [PATCH] Added first test for parallel code, does not work yet. --- test/mpi/src/test0001.cc | 52 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 test/mpi/src/test0001.cc diff --git a/test/mpi/src/test0001.cc b/test/mpi/src/test0001.cc new file mode 100644 index 00000000..b3d9c64d --- /dev/null +++ b/test/mpi/src/test0001.cc @@ -0,0 +1,52 @@ +#define BOOST_TEST_DYN_LINK +#define BOOST_TEST_MODULE 0001 + +#include <boost/test/unit_test.hpp> +#include <AMDiS.h> + +using namespace AMDiS; +using namespace boost::unit_test; + +void test_a() +{ + FUNCNAME("main"); + + AMDiS::init("./init/test0001.dat.2d"); + + // ===== create and init the scalar problem ===== + ProblemStat ellipt("ellipt"); + ellipt.initialize(INIT_ALL); + + // === create adapt info === + AdaptInfo adaptInfo("ellipt->adapt", ellipt.getNumComponents()); + + BOOST_REQUIRE(ellipt.getNumComponents() == 1); + + // === create adapt === + AdaptStationary adapt("ellipt->adapt", ellipt, adaptInfo); + + // ===== create matrix operator ===== + Operator matrixOperator(ellipt.getFeSpace()); + matrixOperator.addTerm(new Simple_SOT); + ellipt.addMatrixOperator(matrixOperator, 0, 0); + + // ===== create rhs operator ===== + Operator rhsOperator(ellipt.getFeSpace()); + rhsOperator.addTerm(new Simple_ZOT); + ellipt.addVectorOperator(rhsOperator, 0); + + // ===== start adaption loop ===== + adapt.adapt(); + + BOOST_REQUIRE(ellipt.getFeSpace()->getAdmin()->getUsedSize() == 81); + + AMDiS::finalize(); +} + +test_suite* init_unit_test_suite(int argc, char** argv) +{ + AMDiS::init(argc, argv); + + AMDiS::finalize(); +} + -- GitLab