Stiffness matrix and Mass Matrix in a Form

Asked by Ted Kord

How do I define in a ufl file both the stiffness and mass matrices so I can use them in C++.

aK = D*inner(grad(u), grad(v))*dx
aM = inner(u,v)*dx

The generated header file has no reference to the forms. Does the mass matrix have a specific name?

TK

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Martin Sandve Alnæs
Solved:
Last query:
Last reply:
Revision history for this message
Best Martin Sandve Alnæs (martinal) said :
#1

By default the names "a, L, M" are exported, but you can export forms
explicitly by making a list:

forms = [aK, aM]

Take a look at the generated code to get the names, I don't remember exactly.
You'll get something like class Form_aK, class Form_aM.

Martin

On 23 December 2011 16:30, Ted Kord
<email address hidden> wrote:
> New question #182742 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/182742
>
> How do I define in a ufl file both the stiffness and mass matrices so I can use them in C++.
>
> aK = D*inner(grad(u), grad(v))*dx
> aM = inner(u,v)*dx
>
>
> The generated header file has no reference to the forms. Does the mass matrix have a specific name?
>
> TK
>
> --
> You received this question notification because you are a member of
> DOLFIN Team, which is an answer contact for DOLFIN.

Revision history for this message
Ted Kord (teddy-kord) said :
#2

Thanks Martin Sandve Alnæs, that solved my question.