Commit 2e2c3259 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

And found a bug in multilevel FETI-DP, now have to fix it ....

parent fc1440fc
......@@ -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();
......
......@@ -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);
......
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
......
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
......@@ -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");
}
}
......
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