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

Work in Dirichlet preconditioner for FETI-DP.

parent 489701e5
...@@ -144,7 +144,15 @@ namespace AMDiS { ...@@ -144,7 +144,15 @@ namespace AMDiS {
const FiniteElemSpace *feSpace = dofMat->getRowFeSpace(); const FiniteElemSpace *feSpace = dofMat->getRowFeSpace();
std::set<DegreeOfFreedom>& dRows = dofMat->getDirichletRows(); std::set<DegreeOfFreedom>& dRows = dofMat->getDirichletRows();
if (dirichletRows.count(feSpace)) { if (dirichletRows.count(feSpace)) {
WARNING("Implement test that for all components dirichlet rows are equal!\n"); // === Run test if Dirichlet rows are all the same in all components ===
// === of one FE space. ===
TEST_EXIT(dirichletRows[feSpace].size() == dRows.size())
("Wrong number of dirichlet rows!\n");
for (std::set<DegreeOfFreedom>::iterator it0 = dirichletRows[feSpace].begin(),
it1 = dRows.begin(); it1 != dRows.end(); ++it0, ++it1) {
TEST_EXIT(*it0 == *it1)("Wrong DOFs %d %d!\n", *it0, *it1);
}
} else { } else {
dirichletRows[feSpace] = dRows; dirichletRows[feSpace] = dRows;
} }
...@@ -673,8 +681,6 @@ namespace AMDiS { ...@@ -673,8 +681,6 @@ namespace AMDiS {
VecAssemblyBegin(vec_scale_lagrange); VecAssemblyBegin(vec_scale_lagrange);
VecAssemblyEnd(vec_scale_lagrange); VecAssemblyEnd(vec_scale_lagrange);
VecView(vec_scale_lagrange, PETSC_VIEWER_STDOUT_WORLD);
if (fetiPreconditioner != FETI_NONE || stokesMode) { if (fetiPreconditioner != FETI_NONE || stokesMode) {
MatDuplicate(mat_lagrange, MAT_COPY_VALUES, &mat_lagrange_scaled); MatDuplicate(mat_lagrange, MAT_COPY_VALUES, &mat_lagrange_scaled);
MatDiagonalScale(mat_lagrange_scaled, vec_scale_lagrange, PETSC_NULL); MatDiagonalScale(mat_lagrange_scaled, vec_scale_lagrange, PETSC_NULL);
...@@ -1592,7 +1598,7 @@ namespace AMDiS { ...@@ -1592,7 +1598,7 @@ namespace AMDiS {
createFetiData(); createFetiData();
dirichletRows.clear(); // dirichletRows.clear();
// === Create matrices for the FETI-DP method. === // === Create matrices for the FETI-DP method. ===
...@@ -1727,10 +1733,12 @@ namespace AMDiS { ...@@ -1727,10 +1733,12 @@ namespace AMDiS {
// Traverse all rows. // Traverse all rows.
for (cursor_type cursor = begin<row>(dofMat->getBaseMatrix()), for (cursor_type cursor = begin<row>(dofMat->getBaseMatrix()),
cend = end<row>(dofMat->getBaseMatrix()); cursor != cend; ++cursor) { cend = end<row>(dofMat->getBaseMatrix()); cursor != cend; ++cursor) {
if (isPrimal(rowFeSpace, *cursor)) if (dirichletRows[rowFeSpace].count(*cursor))
continue; continue;
if (isPrimal(rowFeSpace, *cursor))
continue;
switch (fetiPreconditioner) { switch (fetiPreconditioner) {
case FETI_DIRICHLET: case FETI_DIRICHLET:
...@@ -1742,6 +1750,9 @@ namespace AMDiS { ...@@ -1742,6 +1750,9 @@ namespace AMDiS {
// Traverse all columns. // Traverse all columns.
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) {
if (dirichletRows[colFeSpace].count(col(*icursor)))
continue;
if (isPrimal(colFeSpace, col(*icursor))) if (isPrimal(colFeSpace, col(*icursor)))
continue; continue;
...@@ -1805,6 +1816,9 @@ namespace AMDiS { ...@@ -1805,6 +1816,9 @@ namespace AMDiS {
// Traverse all columns. // Traverse all columns.
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) {
if (dirichletRows[colFeSpace].count(col(*icursor)))
continue;
if (!isDual(colFeSpace, col(*icursor))) if (!isDual(colFeSpace, col(*icursor)))
continue; continue;
......
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