dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #23398
Re: [Question #158315]: Taking the "stiffness matrix" on C++
Question #158315 on DOLFIN changed:
https://answers.launchpad.net/dolfin/+question/158315
Status: Open => Answered
James Avery proposed the following answer:
In stiffness.ufl:
element = FiniteElement("Lagrange", triangle, 1)
v = TestFunction(element)
u = TrialFunction(element)
a = inner(v, u)*dx
where "element" should be changed to fit the FE-type that you want.
Compile with "ffc -O -l dolfin stiffness.ufl".
In C++:
stiffness::BilinearForm stiffness(V, V);
Matrix M;
assemble(M,stiffness);
M now contains the stiffness matrix (i.e. the overlap matrix of FE basis
functions).
Hope this helps!
--
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.
Follow ups