Hi everyone,
I have a problem with using the adaptive_wavelet_limited function.
to test the adaptive_wavelet_limited function.
But there is no adaptive grid generated with the same codes.
in the file, there is a line as :
local = true, break;
with this line
I always get an error like:
./adapt_wavelet_limited.h:74: warning: Basilisk C parse error near `
local = true, break'
./adapt_wavelet_limited.h: In function ‘adapt_wavelet_limited’:
./adapt_wavelet_limited.h:74:22: error: expected expression before ‘break’
Then I change it to
local = true; break;
after this change, there is no error but no adaptive grid is generated.
Also, the codes shared in the following link is the same like:
local = true, break;
I always get the error with this "local = true, break;" but I didn't see people report the same error.
I don't know if there is anything I miss about this adaptive_wavelet_limited.h header file.
Can anyone who successfully used the adapt_wavelet_limited function help me with this issue.
Thank you very much with your consideration and time!
Here are the codes:
#include "axi.h"
#include "navier-stokes/centered.h"
#include "two-phase.h"
#include "navier-stokes/conserving.h"
#include "tension.h"
#include "reduced.h"
#include "adapt_wavelet_limited.h"
#include "view.h"
int MAXlevel = 6; // maximum level: This is increased in time.
#define MINlevel 4 // minimum level
#define Ldomain 4
#define tmax 1
#define tsnap (0.05)
// Error tolerances
#define fErr (1e-3) // error tolerance in VOF
#define KErr (1e-4) // error tolerance in KAPPA
#define OmegaErr (1e-3) // error tolerances in vorticity
#define Mu21 (6e-3) // viscosity ratio between the gas and the liquid
#define Rho21 (1./770) // density ratio between the gas and the liquid
char comm[80], FacetName[80], nameOut[80];
u.t[left] = dirichlet(0.0);
f[left] = dirichlet(0.0);
int main(){
L0=Ldomain;
X0=0.; Y0=0.;
init_grid (1 << (4));
double Bond = 0.308;
G.x = -Bond;
f.sigma = 1.;
mu1 = 1.; mu2 = Mu21;
rho1 = 1.; rho2 = Rho21;
run();
}
event init (t=0){
sprintf (comm, "mkdir -p intermediate%5.4f", fabs(G.x));
system(comm);
//refine (sq(x-1.015625) + sq(y) < sq(1.04) && level < MAXlevel+2);
fraction (f, 1. - sq(x-1.015625) - sq(y));
}
int refRegion(double x, double y, double z){
return (x < 0.128 ? MAXlevel+2 : x < 0.256 ? MAXlevel+1 : MAXlevel);
}
scalar KAPPA[], omega[];
event adapt(i++){
MAXlevel = t < 5.0 ? 6 : t < 10.0 ? 7 : 8;
curvature(f, KAPPA);
vorticity (u, omega);
foreach(){
omega[] *= (f[]);
}
boundary((scalar *){KAPPA, omega});
adapt_wavelet_limited ((scalar *){f, KAPPA, omega},(double[]){fErr, KErr, OmegaErr}, refRegion, MINlevel);
}
event movies (t += 0.001; t <= tmax)
{
clear();
//view (fov = 20, quat = {0,0,-0.707,0.707},tx = 1e-6, ty = -0.5, width = 780, height = 382);
//view (tx = -0.5);
draw_vof ("f", lw = 2);
squares ("p", min = -1., max = 10., linear = false, map = cool_warm);
mirror (n = {0, 1, 0}, alpha = 0.) {
draw_vof ("f", lw = 2);
//draw_vof("f", filled = 1, fc = {0.9, 0.4, 0.2});
//squares("thin_structure");
}
cells();
save ("TO.10.mp4");
}