Dear Lahoussaine, 

Ok, this is a good reason. The high level generic assembly that allows to take 
into account easily such nonlinear terms is not available in complex models. 

Does it means that U or T is complex ? 

May be the simpler is that your isolate the minimal code that reproduce the 
error and send it the mailing list. 

Best regards, 

Yves 



De: "lahoussaine BOURRICHE" <lahoussaine.bourri...@gmail.com> 
À: "Yves Renard" <yves.ren...@insa-lyon.fr> 
Envoyé: Mercredi 7 Septembre 2022 11:26:22 
Objet: Re: Non linear term 

I didn't understand your question, but about models, I am working with a 
complex model, that's why I use gf.asm. 

On Tue, 6 Sept 2022 at 15:50, Renard Yves < [ mailto:yves.ren...@insa-lyon.fr | 
yves.ren...@insa-lyon.fr ] > wrote: 





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 : 

BQ_BEGIN

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, < [ mailto:yves.ren...@insa-lyon.fr | 
yves.ren...@insa-lyon.fr ] > wrote: 

BQ_BEGIN


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" < [ mailto:lahoussaine.bourri...@gmail.com | 
lahoussaine.bourri...@gmail.com ] > 
À: "Yves Renard" < [ mailto:yves.ren...@insa-lyon.fr | yves.ren...@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, < [ mailto:yves.ren...@insa-lyon.fr | 
yves.ren...@insa-lyon.fr ] > wrote: 

BQ_BEGIN


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" < [ mailto:lahoussaine.bourri...@gmail.com | 
lahoussaine.bourri...@gmail.com ] > 
À: "Yves Renard" < [ mailto:yves.ren...@insa-lyon.fr | yves.ren...@insa-lyon.fr 
] > 
Cc: "getfem-users" < [ mailto:getfem-users@nongnu.org | 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: 

BQ_BEGIN


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 ? 




BQ_END



BQ_END


BQ_END


BQ_END


Reply via email to