Commit 6f8a7433 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Add test for multilevel interior boundaries and dof communicators.

parent 08a7ce8f
dimension of world: 2
elliptMesh->macro file name: ./macro/macro.stand.p16.2d
elliptMesh->global refinements: 3
ellipt->mesh: elliptMesh
ellipt->dim: 2
ellipt->components: 1
ellipt->polynomial degree[0]: 1
ellipt->solver: cg
ellipt->solver->max iteration: 10
ellipt->solver->tolerance: 1.e-8
ellipt->solver->info: 10
ellipt->solver->left precon: diag
ellipt->solver->right precon: no
ellipt->estimator[0]: 0
ellipt->marker[0]->strategy: 0
parallel->log main rank: 0
parallel->pre refine: 0
parallel->partitioner: checker
parallel->multi level test: 1
parallel->solver: petsc-feti
...@@ -9,7 +9,8 @@ using namespace AMDiS; ...@@ -9,7 +9,8 @@ using namespace AMDiS;
using namespace std; using namespace std;
/* /*
- - Simple FETI-DP test on the number of local and global primal, dual and
interior nodes.
*/ */
BOOST_AUTO_TEST_CASE(amdis_mpi_feti) BOOST_AUTO_TEST_CASE(amdis_mpi_feti)
......
...@@ -11,7 +11,7 @@ using namespace std; ...@@ -11,7 +11,7 @@ using namespace std;
using boost::lexical_cast; using boost::lexical_cast;
/* /*
- - Test 2-level FETI-DP on the number of global primal and dual nodes.
*/ */
BOOST_AUTO_TEST_CASE(amdis_mpi_feti_multilevel) BOOST_AUTO_TEST_CASE(amdis_mpi_feti_multilevel)
......
...@@ -9,7 +9,7 @@ using namespace AMDiS; ...@@ -9,7 +9,7 @@ using namespace AMDiS;
using namespace std; using namespace std;
/* /*
- - Test DOF communicator on 2-level decomposition of a 4x4 rank domain.
*/ */
BOOST_AUTO_TEST_CASE(amdis_mpi_feti_multilevel) BOOST_AUTO_TEST_CASE(amdis_mpi_feti_multilevel)
......
...@@ -9,7 +9,8 @@ using namespace AMDiS; ...@@ -9,7 +9,8 @@ using namespace AMDiS;
using namespace std; using namespace std;
/* /*
- - Test for interior boundaries on a 2-level 4x4 rank decomposition.
- Compaires the interior boundary object with a serialization file.
*/ */
......
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE 0005
#define BOOST_TEST_NO_MAIN
#include <boost/test/unit_test.hpp>
#include <AMDiS.h>
using namespace AMDiS;
using namespace std;
/*
- Test for interior boundaries of the subdomains on a 2-level
4x4 rank decomposition.
- Compaires the interior boundary object with a serialization file.
- Test for DOF communicators on the subdomains.
*/
void boundaryTest(RankToBoundMap &map0, RankToBoundMap &map1)
{
BOOST_CHECK_MESSAGE(map0.size() == map1.size(),
"Boundaries have different size!\n");
for (RankToBoundMap::iterator it = map0.begin(); it != map0.end(); ++it) {
if (map1.count(it->first) == 0) {
MSG("Boundary with rank %d missing!\n", it->first);
BOOST_ERROR("");
}
BOOST_CHECK_MESSAGE(it->second.size() == map1[it->first].size(),
"Wrong boundary size!\n");
for (unsigned int i = 0; i < it->second.size(); i++)
BOOST_CHECK_MESSAGE(it->second[i] == map1[it->first][i],
"Boundary is not equal!\n");
}
}
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();
const FiniteElemSpace *feSpace = ellipt.getFeSpace();
InteriorBoundary testBoundary;
string filename = "data/data0006/interior_boundary_p" +
lexical_cast<string>(MPI::COMM_WORLD.Get_rank()) + ".ser";
ifstream myfile(filename.c_str());
testBoundary.deserialize(myfile, ellipt.getMesh());
myfile.close();
boundaryTest(testBoundary.getOwn(), meshDist->getIntBoundarySd().getOwn());
boundaryTest(testBoundary.getOther(), meshDist->getIntBoundarySd().getOther());
boundaryTest(testBoundary.getPeriodic(), meshDist->getIntBoundarySd().getPeriodic());
Spreadsheet sheet;
sheet.read("data/data0006/dofcomm_level_1.dat");
vector<vector<double> > &data = sheet.getData();
DofComm &dofCommSd = meshDist->getDofCommSd();
DofComm::LevelDataType &sendDofsSd = dofCommSd.getSendDofs();
DofComm::LevelDataType &recvDofsSd = dofCommSd.getRecvDofs();
int nSendDofs = dofCommSd.getNumberDofs(sendDofsSd, 0, feSpace);
int nRecvDofs = dofCommSd.getNumberDofs(recvDofsSd, 0, feSpace);
int rank = MPI::COMM_WORLD.Get_rank();
BOOST_CHECK(data[rank][0] == rank);
BOOST_CHECK(data[rank][1] == nSendDofs);
BOOST_CHECK(data[rank][2] == nRecvDofs);
}
int main(int argc, char **argv)
{
AMDiS::init(argc, argv, "./init/test0006.dat.2d");
boost::unit_test::unit_test_main(&init_unit_test, argc, argv);
AMDiS::finalize();
}
Markdown is supported
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