getfem-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

simple assemble questions


From: Edouard Oudet
Subject: simple assemble questions
Date: Fri, 18 Jun 2021 19:36:38 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

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)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]