test0003.cc 1.14 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE 0002
#define BOOST_TEST_NO_MAIN

#include <boost/test/unit_test.hpp>
#include <AMDiS.h>

using namespace AMDiS;
using namespace std;

/*
  - 
*/

BOOST_AUTO_TEST_CASE(amdis_mpi_feti_multilevel)
{
  BOOST_REQUIRE(MPI::COMM_WORLD.Get_size() == 16);

  ProblemStat ellipt("ellipt");
  ellipt.initialize(INIT_ALL);

  MeshDistributor *meshDist = MeshDistributor::globalMeshDistributor;
  meshDist->initParallelization();

  Mesh* mesh = ellipt.getMesh();
  BOOST_REQUIRE(mesh->getNumberOfLeaves() == 8);
  BOOST_REQUIRE(meshDist->getMeshLevelData().getLevelNumber() == 2);

  vector<const FiniteElemSpace*> feSpaces;
  feSpaces.push_back(ellipt.getFeSpace(0));

  PetscSolverFeti &feti = *(dynamic_cast<PetscSolverFeti*>(ellipt.getPetscSolver()));
  feti.setMeshDistributor(meshDist);
  feti.initialize(feSpaces);
  feti.createFetiData();

  BOOST_REQUIRE(feti.getNumberOfPrimals() == 9);
  BOOST_REQUIRE(feti.getNumberOfDuals() == 16);
}


int main(int argc, char **argv)
{
  AMDiS::init(argc, argv, "./init/test0003.dat.2d");

  boost::unit_test::unit_test_main(&init_unit_test, argc, argv);

  AMDiS::finalize();
}