diff --git a/AMDiS/src/parallel/PetscSolverFeti.cc b/AMDiS/src/parallel/PetscSolverFeti.cc index 38ad6a53eea4763136770f71749ca4d65a4ce2c7..d9660b959091c77798f725ad882fcdb8d6697fea 100644 --- a/AMDiS/src/parallel/PetscSolverFeti.cc +++ b/AMDiS/src/parallel/PetscSolverFeti.cc @@ -412,8 +412,16 @@ namespace AMDiS { DofIndexSet primals; for (DofContainerSet::iterator it = vertices.begin(); - it != vertices.end(); ++it) - primals.insert(**it); + it != vertices.end(); ++it) { + WorldVector<double> c; + feSpace->getMesh()->getDofIndexCoords(*it, feSpace, c); + MSG("COORD %f %f\n", c[0], c[1]); + double e = 1e-8; + if (fabs(c[0]) < e || fabs(c[1]) < e || + fabs(c[0] - 25.0) < e || fabs(c[1] - 25.0) < e || + (fabs(c[0] - 12.5) < e && fabs(c[1] - 12.5) < e)) + primals.insert(**it); + } // === Calculate the number of primals that are owned by the rank and === @@ -1031,17 +1039,21 @@ namespace AMDiS { // === And copy from PETSc local vectors to the DOF vectors. === - TEST_EXIT_DBG(meshLevel == 0) - ("Recover solution does not work for multileve method!\n"); - int cnt = 0; for (int i = 0; i < vec.getSize(); i++) { DOFVector<double>& dofVec = *(vec.getDOFVector(i)); for (DofMap::iterator it = localDofMap[feSpaces[i]].getMap().begin(); it != localDofMap[feSpaces[i]].getMap().end(); ++it) { - int petscIndex = localDofMap.getLocalMatIndex(i, it->first); - dofVec[it->first] = localSolB[petscIndex]; + if (meshLevel == 0) { + int petscIndex = localDofMap.getLocalMatIndex(i, it->first); + dofVec[it->first] = localSolB[petscIndex]; + } else { + if (meshDistributor->getDofMapSd()[feSpaces[i]].isRankDof(it->first)) { + int petscIndex = localDofMap.getLocalMatIndex(i, it->first); + dofVec[it->first] = localSolB[petscIndex]; + } + } } for (DofMap::iterator it = primalDofMap[feSpaces[i]].getMap().begin(); diff --git a/AMDiS/src/parallel/SubDomainSolver.cc b/AMDiS/src/parallel/SubDomainSolver.cc index 57a17783ca898bccd14aa34673a8880c12ff13a0..51713b7b2bb8a9f017de1b1a699678930701331c 100644 --- a/AMDiS/src/parallel/SubDomainSolver.cc +++ b/AMDiS/src/parallel/SubDomainSolver.cc @@ -252,7 +252,10 @@ namespace AMDiS { PC pcInterior; KSPGetPC(kspInterior, &pcInterior); PCSetType(pcInterior, PCLU); - PCFactorSetMatSolverPackage(pcInterior, MATSOLVERUMFPACK); + if (multilevel == false) + PCFactorSetMatSolverPackage(pcInterior, MATSOLVERUMFPACK); + else + PCFactorSetMatSolverPackage(pcInterior, MATSOLVERMUMPS); KSPSetFromOptions(kspInterior); } @@ -335,11 +338,14 @@ namespace AMDiS { int ml = 0; Parameters::get("parallel->multi level test", ml); - if (ml > 0) - ERROR_EXIT("BLUB!\n"); - Vec tmp; - VecCreateSeq(PETSC_COMM_SELF, interiorMap->getRankDofs(), &tmp); + if (ml == 0) + VecCreateSeq(PETSC_COMM_SELF, interiorMap->getRankDofs(), &tmp); + else + VecCreateMPI(mpiCommInterior, + interiorMap->getRankDofs(), + interiorMap->getOverallDofs(), + &tmp); PetscScalar *tmpValues, *rhsValues; VecGetArray(tmp, &tmpValues); diff --git a/test/mpi/init/test0003.dat.2d b/test/mpi/init/test0003.dat.2d index 3ceab2fdc66e9fe4fe277dd1e06b59f0e0ebfa4b..72187b5c198068f763f47769227606a300aec0f7 100644 --- a/test/mpi/init/test0003.dat.2d +++ b/test/mpi/init/test0003.dat.2d @@ -1,6 +1,6 @@ dimension of world: 2 -elliptMesh->macro file name: ./macro/macro.stand.p16.2d +elliptMesh->macro file name: ./macro/macro.stand.p16_25x25.2d elliptMesh->global refinements: 2 ellipt->mesh: elliptMesh diff --git a/test/mpi/macro/macro.stand.p16_25x25.2d b/test/mpi/macro/macro.stand.p16_25x25.2d new file mode 100644 index 0000000000000000000000000000000000000000..d2b75acaf098e5f1a68743c1dbfe4a7e9647390b --- /dev/null +++ b/test/mpi/macro/macro.stand.p16_25x25.2d @@ -0,0 +1,135 @@ +DIM: 2 +DIM_OF_WORLD: 2 + +number of elements: 32 +number of vertices: 25 + +vertex coordinates: +0 0 +6.25 0 +12.5 0 +18.75 0 +25 0 +0 6.25 +6.25 6.25 +12.5 6.25 +18.75 6.25 +25 6.25 +0 12.5 +6.25 12.5 +12.5 12.5 +18.75 12.5 +25 12.5 +0 18.75 +6.25 18.75 +12.5 18.75 +18.75 18.75 +25 18.75 +0 25 +6.25 25 +12.5 25 +18.75 25 +25 25 + +element vertices: +0 6 5 +6 0 1 +1 7 6 +7 1 2 +2 8 7 +8 2 3 +3 9 8 +9 3 4 +5 11 10 +11 5 6 +6 12 11 +12 6 7 +7 13 12 +13 7 8 +8 14 13 +14 8 9 +10 16 15 +16 10 11 +11 17 16 +17 11 12 +12 18 17 +18 12 13 +13 19 18 +19 13 14 +15 21 20 +21 15 16 +16 22 21 +22 16 17 +17 23 22 +23 17 18 +18 24 23 +24 18 19 + +element boundaries: +0 1 0 +1 0 0 +0 0 0 +1 0 0 +0 0 0 +1 0 0 +0 0 0 +1 1 0 +0 1 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 1 0 +0 1 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 1 0 +1 1 0 +0 0 0 +1 0 0 +0 0 0 +1 0 0 +0 0 0 +1 0 0 +0 1 0 + +element neighbours: +9 -1 1 +-1 2 0 +11 1 3 +-1 4 2 +13 3 5 +-1 6 4 +15 5 7 +-1 -1 6 +17 -1 9 +0 10 8 +19 9 11 +2 12 10 +21 11 13 +4 14 12 +23 13 15 +6 -1 14 +25 -1 17 +8 18 16 +27 17 19 +10 20 18 +29 19 21 +12 22 20 +31 21 23 +14 -1 22 +-1 -1 25 +16 26 24 +-1 25 27 +18 28 26 +-1 27 29 +20 30 28 +-1 29 31 +22 -1 30 + diff --git a/test/mpi/src/test0003.cc b/test/mpi/src/test0003.cc index 31109f2ad1e60d415acbd33cb5e44eb7c6d1744d..65f9a036511ce7420b4f2f88d8a98b6b3b0ee55e 100644 --- a/test/mpi/src/test0003.cc +++ b/test/mpi/src/test0003.cc @@ -36,12 +36,12 @@ BOOST_AUTO_TEST_CASE(amdis_mpi_feti_multilevel) feti.initialize(feSpaces); feti.createFetiData(); - if (feti.getNumberOfPrimals() != 9) { - BOOST_ERROR("Number of primals is " + lexical_cast<string>(feti.getNumberOfPrimals()) + " and not 9!\n"); + if (feti.getNumberOfPrimals() != 5) { + BOOST_ERROR("Number of primals is " + lexical_cast<string>(feti.getNumberOfPrimals()) + " and not 5!\n"); } - if (feti.getNumberOfDuals() != 16) { - BOOST_ERROR("Number of duals is " + lexical_cast<string>(feti.getNumberOfDuals()) + " and not 16!\n"); + if (feti.getNumberOfDuals() != 24) { + BOOST_ERROR("Number of duals is " + lexical_cast<string>(feti.getNumberOfDuals()) + " and not 24!\n"); } }