Liebe Gitlab-Nutzer, lieber Gitlab-Nutzer, es ist nun möglich sich mittels des ZIH-Logins/LDAP an unserem Dienst anzumelden. Ein Anmelden über dieses erzeugt ein neues Konto. Das alte Konto ist über den Reiter "Standard" erreichbar. Die Administratoren

Dear Gitlab user, it is now possible to log in to our service using the ZIH login/LDAP. Logging in via this will create a new account. The old account can be accessed via the "Standard" tab. The administrators

Commit a377678b authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Work on blablablab

parent c8cd584a
...@@ -786,8 +786,8 @@ namespace AMDiS { ...@@ -786,8 +786,8 @@ namespace AMDiS {
ofstream file; ofstream file;
file.open(filename.str().c_str()); file.open(filename.str().c_str());
file << "# First line contains number of DOFs, than each line has the format\n"; // file << "# First line contains number of DOFs, than each line has the format\n";
file << "# Local DOF index Global DOF index Is rank DOF x-coord y-coord z-coord\n"; // file << "# Local DOF index Global DOF index Is rank DOF x-coord y-coord z-coord\n";
file << coords.getUsedSize() << "\n"; file << coords.getUsedSize() << "\n";
DOFIterator<WorldVector<double> > it(&coords, USED_DOFS); DOFIterator<WorldVector<double> > it(&coords, USED_DOFS);
for (it.reset(); !it.end(); ++it) { for (it.reset(); !it.end(); ++it) {
...@@ -801,9 +801,9 @@ namespace AMDiS { ...@@ -801,9 +801,9 @@ namespace AMDiS {
// === Write to all elements in ranks mesh the included dofs. === // === Write to all elements in ranks mesh the included dofs. ===
file << "\n\n"; // file << "\n\n";
file << "# First line containes number of elements in mesh, second line contain the number of DOFs per element.\n"; // file << "# First line containes number of elements in mesh, second line contain the number of DOFs per element.\n";
file << "# Than, each entry contains of two lines. The first is the element index, the second line is a list with the local DOF indices of this element.\n"; // file << "# Than, each entry contains of two lines. The first is the element index, the second line is a list with the local DOF indices of this element.\n";
file << elDofMap.size() << "\n"; file << elDofMap.size() << "\n";
file << basisFcts->getNumber() << "\n"; file << basisFcts->getNumber() << "\n";
for (ElDofMap::iterator it = elDofMap.begin(); it != elDofMap.end(); ++it) { for (ElDofMap::iterator it = elDofMap.begin(); it != elDofMap.end(); ++it) {
......
...@@ -639,22 +639,17 @@ namespace AMDiS { ...@@ -639,22 +639,17 @@ namespace AMDiS {
double wtime = MPI::Wtime(); double wtime = MPI::Wtime();
Vec tmpVecB;
VecCreateMPI(PETSC_COMM_WORLD,
nRankB * nComponents,
nOverallB * nComponents, &tmpVecB);
int nRowsRankPrimal = nRankPrimals * nComponents; int nRowsRankPrimal = nRankPrimals * nComponents;
int nRowsOverallPrimal = nOverallPrimals * nComponents; int nRowsOverallPrimal = nOverallPrimals * nComponents;
Vec tmpVecPrimal; int nRowsRankB = nRankB * nComponents;
VecCreateMPI(PETSC_COMM_WORLD, int nRowsOverallB = nOverallB * nComponents;
nRowsRankPrimal, nRowsOverallPrimal, &tmpVecPrimal);
Mat matPrimal;
MatCreateMPIAIJ(PETSC_COMM_WORLD,
nRowsRankPrimal, nRowsRankPrimal,
nRowsOverallPrimal, nRowsOverallPrimal,
10, PETSC_NULL, 10, PETSC_NULL, &matPrimal);
Mat matBPi;
MatCreateMPIAIJ(PETSC_COMM_WORLD,
nRowsRankB, nRowsRankPrimal,
nRowsOverallB, nRowsOverallPrimal,
30, PETSC_NULL, 30, PETSC_NULL, &matBPi);
Mat matPrimal;
PetscInt nCols; PetscInt nCols;
const PetscInt *cols; const PetscInt *cols;
...@@ -671,7 +666,7 @@ namespace AMDiS { ...@@ -671,7 +666,7 @@ namespace AMDiS {
if (values[j] != 0.0) if (values[j] != 0.0)
mat_b_primal_cols[cols[j]].push_back(make_pair(i, values[j])); mat_b_primal_cols[cols[j]].push_back(make_pair(i, values[j]));
MatRestoreRow(mat_b_primal, i, &nCols, &cols, &values); MatRestoreRow(mat_b_primal, row, &nCols, &cols, &values);
} }
int maxLocalPrimal = mat_b_primal_cols.size(); int maxLocalPrimal = mat_b_primal_cols.size();
...@@ -693,40 +688,26 @@ namespace AMDiS { ...@@ -693,40 +688,26 @@ namespace AMDiS {
KSPSolve(ksp_b, tmpVec, tmpVec); KSPSolve(ksp_b, tmpVec, tmpVec);
PetscScalar *tmpValuesB, *tmpValues; PetscScalar *tmpValues;
VecGetArray(tmpVecB, &tmpValuesB);
VecGetArray(tmpVec, &tmpValues); VecGetArray(tmpVec, &tmpValues);
for (int i = 0; i < nRankB * nComponents; i++) for (int i = 0; i < nRankB * nComponents; i++)
tmpValuesB[i] = tmpValues[i]; MatSetValue(matBPi,
rStartB * nComponents + i,
it->first,
tmpValues[i],
ADD_VALUES);
VecRestoreArray(tmpVec, &tmpValues); VecRestoreArray(tmpVec, &tmpValues);
VecRestoreArray(tmpVecB, &tmpValuesB);
MatMult(mat_primal_b, tmpVecB, tmpVecPrimal);
VecGetArray(tmpVecPrimal, &tmpValues);
for (int i = 0; i < nRowsRankPrimal; i++)
MatSetValue(matPrimal, rStartPrimals * nComponents + i,
it->first, tmpValues[i], ADD_VALUES);
VecRestoreArray(tmpVecPrimal, &tmpValues);
VecDestroy(&tmpVec); VecDestroy(&tmpVec);
} }
for (int i = mat_b_primal_cols.size(); i < maxLocalPrimal; i++) MatAssemblyBegin(matBPi, MAT_FINAL_ASSEMBLY);
MatMult(mat_primal_b, tmpVecB, tmpVecPrimal); MatAssemblyEnd(matBPi, MAT_FINAL_ASSEMBLY);
MatMatMult(mat_primal_b, matBPi, MAT_INITIAL_MATRIX, PETSC_DEFAULT, &matPrimal);
VecDestroy(&tmpVecB);
VecDestroy(&tmpVecPrimal);
MatAssemblyBegin(matPrimal, MAT_FINAL_ASSEMBLY);
MatAssemblyEnd(matPrimal, MAT_FINAL_ASSEMBLY);
MatAXPY(mat_primal_primal, -1.0, matPrimal, DIFFERENT_NONZERO_PATTERN); MatAXPY(mat_primal_primal, -1.0, matPrimal, DIFFERENT_NONZERO_PATTERN);
MatDestroy(&matPrimal); MatDestroy(&matPrimal);
MatDestroy(&matBPi);
MatInfo minfo; MatInfo minfo;
MatGetInfo(mat_primal_primal, MAT_GLOBAL_SUM, &minfo); MatGetInfo(mat_primal_primal, MAT_GLOBAL_SUM, &minfo);
...@@ -1031,7 +1012,7 @@ namespace AMDiS { ...@@ -1031,7 +1012,7 @@ namespace AMDiS {
MatCreateMPIAIJ(PETSC_COMM_WORLD, MatCreateMPIAIJ(PETSC_COMM_WORLD,
nRowsRankPrimal, nRowsRankB, nRowsRankPrimal, nRowsRankB,
nRowsOverallPrimal, nRowsOverallB, nRowsOverallPrimal, nRowsOverallB,
10, PETSC_NULL, 10, PETSC_NULL, &mat_primal_b); 15, PETSC_NULL, 15, PETSC_NULL, &mat_primal_b);
// === Create matrices for FETI-DP preconditioner. === // === Create matrices for FETI-DP preconditioner. ===
......
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