Changing block structure of matrix

Asked by Jason Hicken

Hello,

When using mixed function spaces, the generic solution vector stores all dofs associated with variable 1, and then all dofs associated with variable 2, and so on. Is there an existing option within Dolfin to specify that the solution vector should group all the variables at each dof? In some applications where the variables at a given dof are tightly coupled, this can help improve the effectiveness of the preconditioner.

For example, suppose we have variables u and v. For n dofs, the default storage appears to be:

x = [u[0] u[1] u[2] ... u[n] v[0] v[1] v[2] ... v[n]]^{T}

I would like the block structure

x = [u[0] v[0] u[1] v[1] u[2] v[2] ... u[n] v[n]]^{T}

If this is not presently an option, I would appreciate any pointers on where in the source code this might be accommodated.

Thank you,
Jason

Question information

Language:
English Edit question
Status:
Answered
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Garth Wells (garth-wells) said :
#1

On 4 September 2012 17:41, Jason Hicken
<email address hidden> wrote:
> New question #207674 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/207674
>
> Hello,
>
> When using mixed function spaces, the generic solution vector stores all dofs associated with variable 1, and then all dofs associated with variable 2, and so on.

Not any more. The development version now does graph re-ordering by default.

> Is there an existing option within Dolfin to specify that the solution vector should group all the variables at each dof? In some applications where the variables at a given dof are tightly coupled, this can help improve the effectiveness of the preconditioner.
>

I have looked at this and did some tests, and came to the conclusion
that supporting this would be too complicated for the range of
problems that DOLFIN supports relative to the benefits. The
renumbering that now happens by default will help with what you
describe, but it doesn't permit use of block compressed row storage.

> For example, suppose we have variables u and v. For n dofs, the default storage appears to be:
>
> x = [u[0] u[1] u[2] ... u[n] v[0] v[1] v[2] ... v[n]]^{T}
>
> I would like the block structure
>
> x = [u[0] v[0] u[1] v[1] u[2] v[2] ... u[n] v[n]]^{T}
>
> If this is not presently an option, I would appreciate any pointers on where in the source code this might be accommodated.
>

Your can see what I played around with for elasticity at:

    https://code.launchpad.net/~garth-wells/dolfin/block-dofmaps

It's doable, for say elasticity, but gets complicated for problems
with a mixture of spaces (which is the case in which I think
FEniCS/DOLFIN is very strong).

Garth

> Thank you,
> Jason
>
> --
> You received this question notification because you are a member of
> DOLFIN Team, which is an answer contact for DOLFIN.

Can you help with this problem?

Provide an answer of your own, or ask Jason Hicken for more information if necessary.

To post a message you must log in.