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.bourri...@gmail.com> 
À: "Yves Renard" <yves.ren...@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, < [ mailto:yves.ren...@insa-lyon.fr | 
yves.ren...@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" < [ mailto:lahoussaine.bourri...@gmail.com | 
lahoussaine.bourri...@gmail.com ] > 
À: "getfem-users" < [ mailto:getfem-users@nongnu.org | getfem-users@nongnu.org 
] >, "Yves Renard" < [ mailto:yves.ren...@insa-lyon.fr | 
yves.ren...@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 = J 
second 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^2 
i 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 ? 




Reply via email to