some problems in the process from gerris to basilisk

247 views
Skip to first unread message

Bofeng Tang

unread,
May 25, 2017, 3:46:02 PM5/25/17
to basilisk-fr
Hello, all,
I am trying to write a basilisk code to reproduce some similar results as my gerris code. I have some problems.

1. Changing the simulation domain. 
In the gerris, the simulation is a rectangle of 2 x 8 with the origin locates at the center of left edge.But it looks like all simulation domains in basilisk are square. Does any one know how to change the simulation domain from square to rectangle?

2. Adaptive grid.
In the gerris, I can use the syntax "  AdaptGradient { istep = 1 } { maxlevel = 6 minlevel = 4 cmax = 0.025 } T  " to change the grid according to the gradient of the scalar field T. But from the basilisk tutorial, I only find the syntax  "  adapt_wavelet ({h}, (double []){4e-3}, maxlevel = 8);  ".  It there other syntax in basilisk which can change the grid according to the gradient of the scalar field just like in the gerris?

3. Outputting the whole simulation. 
In the gerris I can output the whole simulation (e.g. output the values of a  scalar filed T at every point in simulation domain ) by using syntax "  GfsOutputSimulation { istep = 100 } SWE-%06ld.txt { format = text variables = T }    " . But in the basilisk I have to use " interpolate(f,x,y) " to output the scalar filed and this method is not based on the adaptive grid. So I was wondering that is there other syntax in the basilisk can output the whole simulation based on adaptive grid just like in the gerris?

Thank you very much!
All the best!

Bofeng Tang

Stephane Popinet

unread,
May 27, 2017, 3:46:16 AM5/27/17
to basil...@googlegroups.com
> 1. Changing the simulation domain.
> In the gerris, the simulation is a rectangle of 2 x 8 with the origin
> locates at the center of left edge.But it looks like all simulation
> domains in basilisk are square. Does any one know how to change the
> simulation domain from square to rectangle?

See:

http://basilisk.fr/Basilisk%20C#complex-domains
http://basilisk.fr/src/Tips#non-cubic-domains

> 2. ". It there other syntax in basilisk
> which can change the grid according to the gradient of the scalar field
> just like in the gerris?

No, because it is not a good idea.

> 3. Outputting the whole simulation.
> In the gerris I can output the whole simulation (e.g. output the values
> of a scalar filed T at every point in simulation domain ) by using
> syntax " GfsOutputSimulation { istep = 100 } SWE-%06ld.txt { format =
> text variables = T } " . But in the basilisk I have to use "
> interpolate(f,x,y) " to output the scalar filed and this method is not
> based on the adaptive grid. So I was wondering that is there other
> syntax in the basilisk can output the whole simulation based on adaptive
> grid just like in the gerris?

See:

http://basilisk.fr/src/examples/tsunami.c#outputs
http://basilisk.fr/src/examples/atomisation.c#outputs
http://basilisk.fr/src/output.h#output_gfs-gerris-simulation-format
http://basilisk.fr/src/README#output-functions

and next time, please make sure to search/read the docs more thoroughly
before asking questions. In the good/bad old days before political
correctness you may have got this answer

https://en.wikipedia.org/wiki/RTFM

This can also be useful

http://www.catb.org/esr/faqs/smart-questions.html

cheers

Stephane

Reply all
Reply to author
Forward
0 new messages