sandbox/acastillo/output_fields/tests_quantities/test_available_potential.c
Testing
reference_height()
In this example use the sample results to test the reference_height function which is useful to highlight density contrasts.
![]() |
![]() |
|
|
set ylabel 'y'
set xlabel 'c'
p "reference_state_gsl_0.asc" u 2:3
#define MAXLEVEL 9
#include "view.h"
#include "acastillo/output_fields/available_potential.h"
double rho1 = 3;
double rho2 = 1;
int main()
{
= 1.0;
L0 = Y0 = Z0 = -L0 / 2;
X0 = 1 << MAXLEVEL;
N (N); init_grid
We load the fields from
scalar f[], c[];
vector u[];
foreach(){
[] = (0 > y);
f[] = 0.5*( 1. + tanh( (0.25 + 0.05*cos(4*pi*x) + y)/(0.01 + 0.005*cos(6*pi*x))) ) * f[];
c}
boundary({c,f});
stats s = statsf(c);
scalar yref[];
reference_height(yref, f, c, s.min, s.max, true, L0/2.);
Then, visualize the results