Dear getfem users,
I am interested in computing the following fem matrices on a domain
Omega for Lagrange elements of order k
1) ∫∂Ω (∇u.n) v a dσ
where a is a vector of length the number of dof, u and v are test
functions and n the normal. I tried the following steps
md = gf.Model("real")
md.add_fem_variable('u', fem)
md.add_fem_variable('a', fem)
md.set_variable('a', ones(nbdof))
faces = gf.Mesh.get(tmesh, 'outer_faces')
bregion_id = 1
tmesh.set_region(bregion_id, faces)
B = gf.asm('generic', mim, 2, 'Normal.Grad_Test_u * Test2_u. a',
bregion_id, md)
Does it look correct?
2) ∫Ω (M ∇u) . ∇v dx
where again u and v are scalar functions and M a matrix field (defined
for every dof). I had in mind to do something like
A = gf.asm("generic", mim, 2, "(M * Grad_Test2_u).Grad_Test_u", -1, md)
but I do not know how how to define the matrix field and how to manage
its product with my gradients.
Any comments are welcome..
I apologize one again for these naive questions,
best
Edouard.
--
Edouard Oudet : http://www-ljk.imag.fr/membres/Edouard.Oudet/
IMAG - Bureau 164
700 avenue Centrale
38400 Saint Martin d'Hères
+33 (0)4 57 42 17 71 (office LJK)