Commit 807e9d57 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

* Bug fix

parent a9ba2f66
......@@ -377,22 +377,19 @@ namespace AMDiS {
void DOFMatrix::compressDOFIndexed(int first, int last,
std::vector<DegreeOfFreedom> &newDOF)
{
int i, j, k, col;
std::vector<MatEntry> *row;
for(i = first; i <= last; i++) {
if((k = newDOF[i]) >= 0) {
matrix[k].swap(matrix[i]);
for (int i = first; i <= last; i++) {
if (newDOF[i] >= 0) {
matrix[newDOF[i]].swap(matrix[i]);
matrix[i].resize(0);
}
}
int usedSize = rowFESpace->getAdmin()->getUsedSize();
for (i = 0; i < usedSize; i++) {
row = reinterpret_cast< std::vector<MatEntry>*>(&(matrix[i]));
for (int i = 0; i < usedSize; i++) {
std::vector<MatEntry> *row = reinterpret_cast<std::vector<MatEntry>*>(&(matrix[i]));
int rowSize = static_cast<int>(row->size());
for (j = 0; j < rowSize; j++) {
col = (*row)[j].col;
if (entryUsed(i,j))
for (int j = 0; j < rowSize; j++) {
int col = (*row)[j].col;
if (entryUsed(i, j))
(*row)[j].col = newDOF[col];
}
}
......@@ -403,6 +400,8 @@ namespace AMDiS {
int col = 0;
if (0 < matrix[index].size()) {
int nRows = matrix.size();
// for all columns in this row
int size = static_cast<int>(matrix[index].size());
for (int i = 0; i < size; i++) {
......@@ -410,7 +409,7 @@ namespace AMDiS {
if (entryUsed(index, i)) {
// get column of this entry
col = matrix[index][i].col;
if (col != index) { // remove symmetric entry if exists
if ((col != index) && (col < nRows)) { // remove symmetric entry if exists
int colsize = static_cast<int>(matrix[col].size());
for (int j = 0; j < colsize; j++) {
int col2 = matrix[col][j].col;
......
......@@ -260,14 +260,14 @@ namespace AMDiS {
/** \brief
* Returns whether entry matrix[a][b] is used
*/
inline bool entryUsed(DegreeOfFreedom a,int b) const {
inline bool entryUsed(DegreeOfFreedom a, int b) const {
return (((matrix[a])[b]).col >= 0);
}
/** \brief
* Returns true if matrix[a][b] has entry \ref NO_MORE_ENTRIES
*/
inline bool noMoreEntries(DegreeOfFreedom a,int b) const {
inline bool noMoreEntries(DegreeOfFreedom a, int b) const {
return (NO_MORE_ENTRIES == ((matrix[a])[b]).col);
}
......@@ -548,7 +548,7 @@ namespace AMDiS {
return NULL;
if (it->col == jcol)
return &(it->entry);
};
}
return NULL;
}
......
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