ehsanhaghighat/sciann

Logical Operator Or when implementing boundary condition

Closed this issue · 7 comments

Dear SCIANN team

I just wonder when we describe boundary condition corresponding geometrical coordinate, is there any Or operator???

I can use * to make and condition, but when I use ' |' , it does not work, and when I use 'or', it works not the way what I want

Best Regards

Seohee

Hi Ehsan

I mean like

assume there is a geometry with step like a stair
with 2D structure which has x in [0,1] y in [0,1] coordinate

image

and setting the boundary condition for u velocity for top and bottom
then we can write a code like for the top boundary like this
with no slip condition for the wall
topbc= sn.rename((y == y_train.max())*abs(u), "topbc")

However, for the bottom which has a geometry of step
we need to separate the bottom boundary condition like this

botbc1= sn.rename((y == y_train.min() )* abs(u), "botbc1")
botbc2= sn.rename((x==0.5)(y >=y_train.min())(y<=0.5) )* abs(u), "botbc2")
botbc3= sn.rename((x>=0.5)(x<=1)(y<=0.5) )*abs(u), "botbc3")

but I want to combine all bottom boundary condition in one functional argument

Also when I see the some of the example in the part of boundary condition imposing, you wrote a code abs(u)
can you give the reason why use a abs()???

Best Regards

Seohee Jang

Hi Seohee, can you write a use case? Feel free to share a simple google colab implementation of what you want to do.

On Jul 10, 2023, at 6:38 AM, SeoheeJang1 @.***> wrote: Dear SCIANN team I just wonder when we describe boundary condition corresponding geometrical coordinate, is there any Or operator??? I can use * to make and condition, but when I use |, it does not work, and when I use 'or', it works not the way what I want Best Regards Seohee — Reply to this email directly, view it on GitHub <#94>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHMBIZZ6NICXBAQ2LEU2GRLXPQAVBANCNFSM6AAAAAA2ER54ZY. You are receiving this because you are subscribed to this thread.

Dear Ehsan

If the explanation of mine is not enough, do you need actual proper google colab code to show the problem??

Best regards

Seohee Jang

Thanks for your patience. Just pushed a change — see if that's what you want.

On Jul 19, 2023, at 5:18 PM, SeoheeJang1 @.> wrote: Hi Seohee, can you write a use case? Feel free to share a simple google colab implementation of what you want to do. … x-msg://12/# On Jul 10, 2023, at 6:38 AM, SeoheeJang1 @.> wrote: Dear SCIANN team I just wonder when we describe boundary condition corresponding geometrical coordinate, is there any Or operator??? I can use * to make and condition, but when I use |, it does not work, and when I use 'or', it works not the way what I want Best Regards Seohee — Reply to this email directly, view it on GitHub <#94 <#94>>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHMBIZZ6NICXBAQ2LEU2GRLXPQAVBANCNFSM6AAAAAA2ER54ZY. You are receiving this because you are subscribed to this thread. Dear Ehsan If the explanation of mine is not enough, do you need actual proper google colab code to show the problem?? Best regards Seohee Jang — Reply to this email directly, view it on GitHub <#94 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHMBIZ44TDNVUN5ZL2BHXLLXRB2ONANCNFSM6AAAAAA2ER54ZY. You are receiving this because you commented.

Dear Ehsan

Thank you for fast response for this change

I am really appreciate what you've done for this

however, when I apply more than 3 functionals it shows like this

image

could you consider this problem as well???

I mean condition 1 & condition 2 & condition 3

or condition 1 | condition 2 | condition 3 | condition 4

so that it can shrink the loss term in the loss function

Best Regards

Seohee Jang

If you use the or operator, it should work. Try:>> (cond 1) | (cond 2) | (cond 3) | …Alternatively, you can do:>> logical_or(cond1, logocal_or(cond2, cond3))On Jul 22, 2023, at 4:21 PM, SeoheeJang1 @.> wrote: Thanks for your patience. Just pushed a change — see if that's what you want. … On Jul 19, 2023, at 5:18 PM, SeoheeJang1 @.> wrote: Hi Seohee, can you write a use case? Feel free to share a simple google colab implementation of what you want to do. … x-msg://12/# On Jul 10, 2023, at 6:38 AM, SeoheeJang1 @.> wrote: Dear SCIANN team I just wonder when we describe boundary condition corresponding geometrical coordinate, is there any Or operator??? I can use * to make and condition, but when I use |, it does not work, and when I use 'or', it works not the way what I want Best Regards Seohee — Reply to this email directly, view it on GitHub <#94 <#94>>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHMBIZZ6NICXBAQ2LEU2GRLXPQAVBANCNFSM6AAAAAA2ER54ZY. You are receiving this because you are subscribed to this thread. Dear Ehsan If the explanation of mine is not enough, do you need actual proper google colab code to show the problem?? Best regards Seohee Jang — Reply to this email directly, view it on GitHub <#94 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHMBIZ44TDNVUN5ZL2BHXLLXRB2ONANCNFSM6AAAAAA2ER54ZY. You are receiving this because you commented. Dear Ehsan Thank you for fast response for this change I am really appreciate what you've done for this however, when I apply more than 3 functionals it shows like this could you consider this problem as well??? I mean condition 1 & condition 2 & condition 3 or condition 1 | condition 2 | condition 3 | condition 4 so that it can shrink the loss term in the loss function Best Regards Seohee Jang —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.>

Dear Ehsan

Thank you for letting me know this

and yeah this is exactly what I want

Many thanks for your dedication for SCIANN

Best Regards

Seohee Jang