Commit 5c44035b authored by Thomas Witkowski's avatar Thomas Witkowski

Fixed some BDDCML issues.

parent 520a6e23
...@@ -149,7 +149,7 @@ if(AMDIS_NEED_PNG) ...@@ -149,7 +149,7 @@ if(AMDIS_NEED_PNG)
message(FATAL_ERROR "Could not find the PNG library") message(FATAL_ERROR "Could not find the PNG library")
endif() endif()
endif(AMDIS_NEED_PNG) endif(AMDIS_NEED_PNG)
if(AMDIS_NEED_BDDCML) if(AMDIS_NEED_BDDCML)
set(AMDIS_BDDCML_PATH @BDDCML_PATH@) set(AMDIS_BDDCML_PATH @BDDCML_PATH@)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_BDDCML_PATH}) list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_BDDCML_PATH})
......
...@@ -6,7 +6,7 @@ if(AMDIS_HAS_PARALLEL_DOMAIN) ...@@ -6,7 +6,7 @@ if(AMDIS_HAS_PARALLEL_DOMAIN)
list(APPEND AMDIS_COMPILEFLAGS ${MPI_COMPILE_FLAGS}) list(APPEND AMDIS_COMPILEFLAGS ${MPI_COMPILE_FLAGS})
list(APPEND AMDIS_INCLUDE_DIRS ${MPI_INCLUDE_PATH}) list(APPEND AMDIS_INCLUDE_DIRS ${MPI_INCLUDE_PATH})
endif(MPI_FOUND) endif(MPI_FOUND)
if(AMDIS_HAS_PARALLEL_DOMAIN STREQUAL "PETSC") if(AMDIS_HAS_PARALLEL_DOMAIN STREQUAL "PETSC")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${AMDIS_DIR}) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${AMDIS_DIR})
set(PETSC_EXECUTABLE_RUNS ON) set(PETSC_EXECUTABLE_RUNS ON)
find_package(PETSc REQUIRED) find_package(PETSc REQUIRED)
......
...@@ -327,6 +327,10 @@ if(ENABLE_BDDCML) ...@@ -327,6 +327,10 @@ if(ENABLE_BDDCML)
message(FATAL_ERROR "Could not find the BDDCML library") message(FATAL_ERROR "Could not find the BDDCML library")
endif() endif()
find_file(BLOPEX_PATH blopex
HINTS ENV CPATH
DOC "Path to BLOPEX library.")
endif(ENABLE_BDDCML) endif(ENABLE_BDDCML)
......
...@@ -89,7 +89,8 @@ namespace AMDiS { ...@@ -89,7 +89,8 @@ namespace AMDiS {
MSG("nelem = %d\n", nelem); MSG("nelem = %d\n", nelem);
// global number of nodes // global number of nodes
int nnod = meshDistributor->getNumberOverallDofs(feSpace); ParallelDofMapping &dofMap = meshDistributor->getDofMap();
int nnod = dofMap[feSpace].nOverallDofs;
MSG("nnod = %d\n", nnod); MSG("nnod = %d\n", nnod);
...@@ -150,14 +151,14 @@ namespace AMDiS { ...@@ -150,14 +151,14 @@ namespace AMDiS {
// array of indices of subdomain nodes in global numbering // array of indices of subdomain nodes in global numbering
int isngn[nnods]; int isngn[nnods];
for (int i = 0; i < nnods; i++) for (int i = 0; i < nnods; i++)
isngn[i] = meshDistributor->mapDofToGlobal(feSpace, i); isngn[i] = dofMap[feSpace][i].global; //meshDistributor->mapDofToGlobal(feSpace, i);
// array of indices of subdomain variables in global numbering // array of indices of subdomain variables in global numbering
int isvgvn[ndofs]; int isvgvn[ndofs];
for (int j = 0; j < nnods; j++) for (int j = 0; j < nnods; j++)
for (int i = 0; i < nComponents; i++) for (int i = 0; i < nComponents; i++)
isvgvn[j * nComponents + i] = isvgvn[j * nComponents + i] =
meshDistributor->mapDofToGlobal(feSpace, j) * nComponents + i; dofMap[feSpace][j].global * nComponents + i;
// array of indices of subdomain elements in global numbering // array of indices of subdomain elements in global numbering
int isegn[nelems]; int isegn[nelems];
...@@ -367,6 +368,12 @@ namespace AMDiS { ...@@ -367,6 +368,12 @@ namespace AMDiS {
} }
void BddcMlSolver::destroyVectorData()
{
FUNCNAME("BddcMlSolver::destroyVectorData()");
}
void BddcMlSolver::addDofMatrix(DOFMatrix* dmat, void BddcMlSolver::addDofMatrix(DOFMatrix* dmat,
vector<int>& i_sparse, vector<int>& i_sparse,
vector<int>& j_sparse, vector<int>& j_sparse,
...@@ -391,22 +398,22 @@ namespace AMDiS { ...@@ -391,22 +398,22 @@ namespace AMDiS {
typedef traits::range_generator<row, Matrix>::type cursor_type; typedef traits::range_generator<row, Matrix>::type cursor_type;
typedef traits::range_generator<nz, cursor_type>::type icursor_type; typedef traits::range_generator<nz, cursor_type>::type icursor_type;
ParallelDofMapping &dofMap = meshDistributor->getDofMap();
for (cursor_type cursor = begin<row>(dmat->getBaseMatrix()), for (cursor_type cursor = begin<row>(dmat->getBaseMatrix()),
cend = end<row>(dmat->getBaseMatrix()); cursor != cend; ++cursor) { cend = end<row>(dmat->getBaseMatrix()); cursor != cend; ++cursor) {
int rowIndex = int rowIndex =
meshDistributor->mapDofToGlobal(feSpace, *cursor) * nComponents + dofMap[feSpace][*cursor].global * nComponents + ithRowComponent;
ithRowComponent;
for (icursor_type icursor = begin<nz>(cursor), icend = end<nz>(cursor); for (icursor_type icursor = begin<nz>(cursor), icend = end<nz>(cursor);
icursor != icend; ++icursor) { icursor != icend; ++icursor) {
int colIndex = int colIndex =
meshDistributor->mapDofToGlobal(feSpace, col(*icursor)) * nComponents + dofMap[feSpace][col(*icursor)].global * nComponents + ithColComponent;
ithColComponent;
double val = value(*icursor); double val = value(*icursor);
// i_sparse.push_back(rowIndex); // i_sparse.push_back(rowIndex);
// j_sparse.push_back(colIndex); // j_sparse.push_back(colIndex);
i_sparse.push_back(*cursor * nComponents + ithRowComponent); i_sparse.push_back(*cursor * nComponents + ithRowComponent);
j_sparse.push_back(col(*icursor) * nComponents + ithColComponent); j_sparse.push_back(col(*icursor) * nComponents + ithColComponent);
a_sparse.push_back(val); a_sparse.push_back(val);
......
...@@ -49,6 +49,8 @@ namespace AMDiS { ...@@ -49,6 +49,8 @@ namespace AMDiS {
void destroyMatrixData(); void destroyMatrixData();
void destroyVectorData();
protected: protected:
void addDofMatrix(DOFMatrix* mat, void addDofMatrix(DOFMatrix* mat,
vector<int>& i_sparse, vector<int>& i_sparse,
......
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