The event order in Basilisk

Skip to first unread message

shine Sun

Sep 26, 2021, 4:02:46 AM9/26/21
to basilisk-fr
Dear basilisk community,
    As we all know, there are various events in the source code to implement the calculations during the simulation. The user can define their own "events" to realize some specific functionalities. However, it's not very clear to me the sequence of the executation of all the inherent events as well as the user defined events. If I put the events which are defined by myself in the .c code, I know that the sequence is the order when I write them. But what should I do if I want to implentment an user event after some inherent events? For example, what should I do if I want to execute an event after an event in navier-stokes/centered.h?  
    Any suggestion will be appreciated! Thanks a lot.

Stephane Popinet

Sep 27, 2021, 6:28:35 AM9/27/21

shine Sun

Sep 27, 2021, 8:37:14 AM9/27/21
to basilisk-fr
Thank you Prof. Popinet! The first event found in the src/ directory is executed last. It's much clear to me now.

On Monday, 27 September 2021 at 18:28:35 UTC+8 Stephane Popinet wrote:

shine Sun

Oct 14, 2021, 3:22:05 AM10/14/21
to basilisk-fr
Thanks for the hints from Prof. Popinet. And I have a further question about the event inheritance.
What is the sequence rule of different events when they appear in the .h files?

For example, in the plused atomization case, now I understand that the events are implemented sequently in the navier-stokes/centered.h. However, if I #include "navier-stokes/perfs.h" in the source atomisation.c like this:

#include "navier-stokes/centered.h"                                           
#include "navier-stokes/perfs.h"                                               
#include "two-phase.h"

The event sequence is as follows for a specific timestep:
events (i = 236, t = 0.15955)                                         
perfs                     src/navier-stokes/perfs.h:7                        
logfile                   atomisation.c:121                                                                     
set_dtmax                 src/navier-stokes/centered.h:209                   
stability                 src/tension.h:36                                   
stability                 src/vof.h:63                                       
stability                 src/navier-stokes/centered.h:211                   
vof                       src/vof.h:312                                     
vof                       src/navier-stokes/centered.h:221                 
tracer_advection          src/navier-stokes/centered.h:222                   
tracer_diffusion          src/navier-stokes/centered.h:223 

Why are the events in perfs.h and in atomisation.c implemented before those in the centered.h?
Any discussion or help is appricated!

Oct 14, 2021, 4:29:12 PM10/14/21
to basilisk-fr
Hallo 01sunxi...,

The `last` keyword exists, which forces certain event to occur later than others.

all reoccurring events defined in `src/navier-stokes/centerered.h` are defined with this superlative.

Op donderdag 14 oktober 2021 om 09:22:05 UTC+2 schreef

shine Sun

Oct 18, 2021, 8:42:22 AM10/18/21
to basilisk-fr
Thank you Antoon! The event order is more clear to me now with your help!
Reply all
Reply to author
0 new messages