distribute[lines[c].line] = c;
int n_rows = sparsity.n_rows();
- for (int row=0; row<n_rows; ++row)
+ for (int row=0; row<n_rows; ++row)
+ {
+
if (distribute[row] == -1)
// regular line. loop over cols
for (int j=sparsity.rowstart[row]; j<sparsity.rowstart[row+1]; ++j)
sparsity.colnums[j],
uncondensed.val[j] *
lines[distribute[row]].entries[q].second);
+
uncondensed.val[j] = 0.;
}
else
uncondensed.val[j] *
lines[distribute[row]].entries[p].second *
lines[distribute[sparsity.colnums[j]]].entries[q].second);
+
uncondensed.val[j] = (row == sparsity.colnums[j] ?
1. : 0. );
};
};
+ };
};
unsigned int DoFHandler<2>::max_couplings_between_dofs () const {
Assert (selected_fe != 0, ExcNoFESelected());
- unsigned int max_adjacent_cells = tria->max_adjacent_cells();
+ const unsigned int max_adjacent_cells = tria->max_adjacent_cells();
// get these numbers by drawing pictures
// and counting...
+ // example:
+ // x-----x--x--o
+ // | | | |
+ // | x--x--x
+ // | | | |
+ // x--x--*--x--x
+ // | | | |
+ // x--x--x |
+ // | | | |
+ // o--x--x-----x
+ // x = vertices connected with center vertex *;
+ // = total of 17
+ // count lines -> 28 (don't forget to count
+ // mother and children separately!)
if (max_adjacent_cells == 4)
- return (13*selected_fe->dofs_per_vertex +
- 20*selected_fe->dofs_per_line +
+ return (17*selected_fe->dofs_per_vertex +
+ 28*selected_fe->dofs_per_line +
8*selected_fe->dofs_per_quad);
else
if (max_adjacent_cells == 5)
- return (15*selected_fe->dofs_per_vertex +
- 23*selected_fe->dofs_per_line +
+ return (19*selected_fe->dofs_per_vertex +
+ 27*selected_fe->dofs_per_line +
9*selected_fe->dofs_per_quad);
else
- if (max_adjacent_cells == 6)
- // are you really sure you
- // want to use such grids??
- return (19*selected_fe->dofs_per_vertex +
- 30*selected_fe->dofs_per_line +
- 16*selected_fe->dofs_per_quad);
- else
- {
- Assert (false, ExcNotImplemented());
- return 0;
- };
+ {
+ Assert (false, ExcNotImplemented());
+ return 0;
+ };
};