Skip to content
Snippets Groups Projects
Commit 8e0d7493 authored by Peter Gottschling's avatar Peter Gottschling
Browse files

Unterschiedliche Blockgroessen.

parent 60ef1112
No related branches found
No related tags found
No related merge requests found
......@@ -67,14 +67,18 @@ namespace AMDiS {
public :
void setMatrix(const Matrix<DOFMatrix*>& A)
{
int ns = A.getSize(), size = A[0][0]->getFESpace()->getAdmin()->getUsedSize(),
new_size = ns * size;
matrix.change_dim(new_size, new_size);
int ns= A.getSize();
std::vector<int> block_starts(ns+1);
block_starts[0]= 0;
for (int i= 0; i < ns; ++i)
block_starts[i+1]= block_starts[i] + A[i][i]->getFESpace()->getAdmin()->getUsedSize();
matrix.change_dim(block_starts[ns], block_starts[ns]);
DOFMatrix::inserter_type ins(matrix);
for (int rb= 0; rb < ns; ++rb)
for (int cb= 0; cb < ns; ++cb)
if (A[rb][cb])
ins[rb * size][cb * size] << A[rb][cb]->getBaseMatrix();
ins[block_starts[rb]][block_starts[cb]] << A[rb][cb]->getBaseMatrix();
}
const DOFMatrix::base_matrix_type& getMatrix() const { return matrix; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment