boolean operation

114 views
Skip to first unread message

Alexis Berny

unread,
May 18, 2018, 11:45:25 AM5/18/18
to basilisk-fr
Good day Basilisk user,

I'm working on a geometry, define from the resolution of a differential equation (see in my sandbox, http://basilisk.fr/sandbox/aberny/bubble/bubble.c for the definition of the geometry, and http://basilisk.fr/sandbox/aberny/bubble/burstingBubble.c#initialisation to see how I put it in the simulation).

I want to add a small circle to this geometry with a boolean operation (since I just want to do a reunion between 2 spaces).

According to older discussion, the boolean operation in basilisk should behave like in Gerris. The behaviour is describe here (http://gfs.sourceforge.net/wiki/index.php/GfsSurface). It's said that you need to have explicit formulation, which is not my case.

How can I manage to do that in basilisk? In other word, how can I work with boolean operation between an explicit function and a list of points (assuming it is possible)?

Best

-- 
Alexis Berny

josé López-Herrera

unread,
May 19, 2018, 12:51:13 PM5/19/18
to basilisk-fr
Alexis, 

Maybe I am saying an stupidity but...Why not to use two vof scalars: say f1[] for the point curve definition and f2[] defined from the equation surface
and to perform the boolean operation directly with the scalars f1[] and f2[]?

Cheers

Jose

I do not know if

Alexis Berny

unread,
May 19, 2018, 2:44:15 PM5/19/18
to basilisk-fr
Hi Jose,

I haven't thought about that, I will try it and let you know if it's work.

Thanks a lot

Best
-- 
Alexis Berny

Stephane Popinet

unread,
May 20, 2018, 6:15:35 AM5/20/18
to basil...@googlegroups.com
Hi Alexis, Jose,

You cannot use boolean operations between volume fraction fields, only
between distance fields. So the solution is simple, just define a first
distance field (from your geometry) using the distance() function. You
can then use the boolean operations (as described here:
http://gfs.sourceforge.net/wiki/index.php/GfsSurface), between this
distance field and other distance fields to define the resulting
distance function.

This distance function can then be used as input to fraction() to
compute the corresponding volume fraction.

cheers,

Stephane

Alexis Berny

unread,
May 22, 2018, 4:05:31 AM5/22/18
to basilisk-fr
Hi Stéphane,

I'm not sure if I get it correctly. Do you mean that an explicit circle equation like this one: x^2+y^2-r^2=0 can be consider as a distance field (if we consider a circle of radius r, in (0, 0)) ?

If so, then indeed the solution and the use of the boolean function is simple.

Best
--
Alexis BERNY

Stephane Popinet

unread,
May 22, 2018, 4:09:51 AM5/22/18
to basil...@googlegroups.com
> I'm not sure if I get it correctly. Do you mean that an explicit circle
> equation like this one: x^2+y^2-r^2=0 can be consider as a distance
> field (if we consider a circle of radius r, in (0, 0)) ?

yes.
Reply all
Reply to author
Forward
0 new messages