Improve the procedure of identifying blocks in dofmap
The method:
DofMapBuilder::compute_blocksize
can only identify dofmap blocks of VectorFunctionSpace
or from a MixedFunctionSpace
where all subspaces are the same. Blocks are not identified for MixedFunctionSpace
using a mixture of sub spaces like P1-P2.
With this in place we could:
- use MatNest for efficient block preconditioning
- block dofs within each subspace for efficiency
- more easily attach null spaces, etc (with are required for some preconditioners).
- make
FunctionAssigner
work for more thanVectorFunctionSpaces
We should also remove all global (Real
) dofs from the dof reordering graph algorithm and position these at a fixed place in the dofmap, for example the first dofs. Global dofs are connected to all other dofs, making the procedure of building the graph very time consuming and it does not add any information to the graph.
It would be nice to have available different strategies for how the dofs are ordered. For the FunctionAssigner
to work we need all subspaces of the same family and degree to be ordered in the same way. For this to happen a subspace based dof block identification need to be possible.
Comments (17)
-
reporter -
reporter Issue
#160was marked as a duplicate of this issue. -
I believe that global DOFs should be placed in the end. This should help to sparse direct solvers as they typically need denser rows in the end of a matrix. This produces smaller fill-in during factorization.
-
@blechta I think all decent direct solvers re-order internally.
-
@garth-wells Sure, but why to make it harder for these algorithms. Moreover, they are not bullet-proof.
-
reporter @blechta putting it in the front was just a suggestion based on having a consistent rule.
-
reporter Issue
#210was marked as a duplicate of this issue. -
Johan correctly points out that it appears that many of the issues that we're having at the moment with block ("multiphysics") problems could be handled if we more closely adapt to PETSc's MatNest structure. For problems like Stokes, we'd probably have to climb down to the assembler to required it not to produce one large matrix, but four blocks subsequently stitched together by
MatCreateNest
. Block DOFs, subvector assignment, sub-functionspace access and everything else that is marked as a duplicate of this bug would be close to trivially solved. Something that I don't see clearly here is how (I)LU and AMG methods act on (nested) block matrices. (This is disregarding the fact that one wouldn't want to do that in the first place and rather exploit the block structure first.) -
The necessary development for block support has already been registered as an issue: https://bitbucket.org/fenics-project/dolfin/issue/119.
-
@garth-wells The approach here goes a little further than
#119in that it suggests to adapt the assembler to produce matrix/vector blocks forMatCreateNest
. -
@nschloe The key ingredient for MatNest is to switch to local dof indexing. It is then possible to seamlessly create PETSc monolithic or nested matrices without changing the assembler.
-
Issue
#256was marked as a duplicate of this issue. -
reporter - changed status to resolved
WIth recent work with dof reordering:
256a1ced756087144c5e609db764a1f956336d72 7f07599f12f50f6a835f2e96d937228699fe2fcd
some of the listed issues of this report has been fixed. The remaining issues can be contained by existing issue 119.
-
@johanhake Is there another bug or will it be covered by
#119?from dolfin import * mesh = UnitSquareMesh(20,20,"crossed") P = FunctionSpace(mesh, "Lagrange", 1) W = FunctionSpace(mesh, "Lagrange", 1) R = VectorFunctionSpace(mesh, "Lagrange", 2) M = VectorFunctionSpace(mesh, "Lagrange", 2) V = MixedFunctionSpace([P, W, R, M]) assigner = FunctionAssigner(V.sub(0),P)
returns in parallel
*** Error: Unable to create function assigner. *** Reason: The receiving and assigning spaces do not have the same number of dofs per space. *** Where: This error was encountered inside FunctionAssigner.cpp.
-
reporter Not sure what you mean but the code snippet shown above passes for me in parallel now.
-
Ah, sorry, I picked wrong build of FEniCS.
-
- removed milestone
Removing milestone: 1.4 (automated comment)
- Log in to comment
Issue
#192was marked as a duplicate of this issue.