|
From: | yves . renard |
Subject: | Re: Non linear term |
Date: | Wed, 7 Sep 2022 13:33:09 +0200 (CEST) |
Dear Lahoussaine,
Just a question. If you have a model, why don't you just have your nonlinear term in a weak form into the model ?
Best regards,
Yves
Le 06/09/2022 à 14:07, lahoussaine BOURRICHE a écrit :
Thank Yves,Unfortunately I still get nan value, i do this------------------------------------rhs_CH = gf.asm('generic',mim,1,"sqr(abs(u)).Test_T",3,'T',1,mfT,np.zeros(mfT.nbdof()),'u',0,mfa,U)md.add_explicit_rhs('T', rhs_CH)
-------------------------------------I have to mention that i have two variables, and with this method, i don't get corrects values
On Wed, 31 Aug 2022 at 14:28, <yves.renard@insa-lyon.fr> wrote:
Dear Lahoussaine,
Normally the call should be
rhs_CH = gf.asm('generic',mim,1,"sqr(abs(u)).Test_T",3,'T',1,mfT,np.zeros(mfT.nbdof()),'u',0,mfa,U)
where U is the vector of degrees of freedom of 'u'.
Best regards,
Yves
De: "lahoussaine BOURRICHE" <lahoussaine.bourriche@gmail.com>
À: "Yves Renard" <yves.renard@insa-lyon.fr>
Envoyé: Mercredi 31 Août 2022 10:02:21
Objet: Re: Non linear term
Thanks Yves.But doing what you told me :rhs_CH = gf.asm('generic',mim,1,"sqr(abs(u)).Test_T",3,'T',1,mfT,0,'u',0,mfa,np.zeros(mfa.nbdof()))
return value 0 in all dof ! or I do it wrong!
Thank you again
On Tue, 30 Aug 2022 at 16:38, <yves.renard@insa-lyon.fr> wrote:
Dear Lahoussaine,
'1' indicates that it is a variable and not data. So that the output vector will contains more rows corresponding to the degrees of freedom in 'u'. For that point of view, your _expression_ is correct.But the "0" in your _expression_ should be replaced by np.zeros(mfa.nbdof())
Best regards,
Yves
De: "lahoussaine BOURRICHE" <lahoussaine.bourriche@gmail.com>
À: "Yves Renard" <yves.renard@insa-lyon.fr>
Cc: "getfem-users" <getfem-users@nongnu.org>
Envoyé: Mardi 30 Août 2022 15:22:10
Objet: Re: Non linear term
Thank you for the clarification.
Even when i do something like :rhs_CH = gf.asm('generic',mim,1,"(sqr(abs(u))).Test_T",region_number,'T',1,mfT,0,'u',0,mfu,0)I got nan values.I think the problem may come from << ,'T',1,mfT,0,'u',0,mfa,0) >>Do I use it correctly? ( why 'u',0,mfa,0 and not 'u',1,mfa,0)
On Tue, 30 Aug 2022 at 14:17, <yves.renard@insa-lyon.fr> wrote:
Dear Lahoussaine,
Your formulation is correct for the right hand side of your second equation (sqr(u) instead of abs(u)*abs(u) would be simpler).
A problem could come from the vector values for sigma. You should pass a vector of the size the number of degrees of freedom of mfs. The same for 'u'.(not that even when you use your own assembly procedure, it is simpler to use a model object and put inside your variables to call gf.asm)
Best regards,
Yves
De: "lahoussaine BOURRICHE" <lahoussaine.bourriche@gmail.com>
À: "getfem-users" <getfem-users@nongnu.org>, "Yves Renard" <Yves.Renard@insa-lyon.fr>
Envoyé: Lundi 29 Août 2022 10:44:28
Objet: Non linear term
Hello community.I have two equations with two variables :first depends on u : delta u = Jsecond depends on u and T : delta T = sigma * u^2 so u in this equation is a source----------------------I have problem with implementation of second term sigma * u^2i did something like :gf.asm('generic',mim,1,"sigma*((abs(u)*abs(u)).Test_T)",region_number,'T',1,mfT,0,'sigma',1,mfs,0',u',0,mfu,0)but i get values = nan.Does the problem come from the non linearity of the term ?
[Prev in Thread] | Current Thread | [Next in Thread] |