getfem-users
[Top][All Lists]
Advanced

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

Re: Source term


From: Konstantinos Poulios
Subject: Re: Source term
Date: Thu, 2 Jun 2022 13:54:57 +0200

Hello,

When you say that you have a value for each element, do you have an analytic _expression_ for that, or do you have something like a list with element number --> value?

If you have an analytic _expression_ then you can use md.interpolation(....) to assign your source data to a model variable. Something like this (assuming that your problem variable is called u):

N = m.dim()
mf = gf.MeshFem(m,N)
mf.set_classical_fem(0) # zero degree fem, i.e. discontinuous
...
md.add_fem_data("source", md.interpolation(".....", mf, RG_ID))
md.add_linear_term(mim, "source.Test_u", RG_ID)

BR
Kostas

On Thu, Jun 2, 2022 at 11:54 AM Bourriche Lahoussaine <lahoussaine.bourriche@etu.toulouse-inp.fr> wrote:
Hello 
I want to define a source term in a specific region, the source is a vector of values ( for each elemnt i have a source value ).
How it will be?
Cordialement

Lahoussaine BOURRICHE


reply via email to

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