Add files via upload

This commit is contained in:
Nils Berglund
2023-12-26 23:01:20 +01:00
committed by GitHub
parent 283ebb8ebf
commit 281cac4775
30 changed files with 2951 additions and 499 deletions

View File

@@ -48,12 +48,22 @@
#define WINWIDTH 1920 /* window width */
#define WINHEIGHT 1150 /* window height */
// // // #define NX 2500 /* number of grid points on x axis */
// // // #define NY 1250 /* number of grid points on y axis */
#define NX 2560 /* number of grid points on x axis */
#define NY 1280 /* number of grid points on y axis */
// #define NX 1280 /* number of grid points on x axis */
// #define NY 640 /* number of grid points on y axis */
// #define NX 2048 /* number of grid points on x axis */
// #define NY 1024 /* number of grid points on y axis */
// #define NX 3064 /* number of grid points on x axis */
// #define NY 1536 /* number of grid points on y axis */
// #define NX 1024 /* number of grid points on x axis */
// #define NY 512 /* number of grid points on y axis */
#define DPOLE 20 /* safety distance to poles */
#define SMOOTHPOLE 0.1 /* smoothing coefficient at poles */
#define ZERO_MERIDIAN 0.0 /* choice of zero meridian (will be at left/right boundary of 2d plot) */
#define ZERO_MERIDIAN 180.0 /* choice of zero meridian (will be at left/right boundary of 2d plot) */
#define XMIN -2.0
#define XMAX 2.0 /* x interval */
@@ -66,6 +76,7 @@
#define JULIA_ROT -20.0 /* rotation of Julia set, in degrees */
#define JULIA_RE 0.5
#define JULIA_IM 0.462 /* parameters for Julia sets */
// #define JULIA_IM 0.45 /* parameters for Julia sets */
/* Choice of the billiard table */
@@ -87,7 +98,8 @@
#define RANDOM_POLY_ANGLE 1 /* set to 1 to randomize angle of polygons */
#define LAMBDA 0.75 /* parameter controlling the dimensions of domain */
#define MU 0.1 /* parameter controlling the dimensions of domain */
#define MU 0.1 /* parameter controlling the dimensions of domain */
#define MU_B 1.0 /* parameter controlling the dimensions of domain */
#define NPOLY 6 /* number of sides of polygon */
#define APOLY 0.0 /* angle by which to turn polygon, in units of Pi/2 */
#define MDEPTH 7 /* depth of computation of Menger gasket */
@@ -127,7 +139,7 @@
#define COURANT 0.05 /* Courant number */
#define COURANTB 0.002 /* Courant number in medium B */
#define GAMMA 0.0 /* damping factor in wave equation */
#define GAMMAB 1.0e-6 /* damping factor in wave equation */
#define GAMMAB 1.0e-2 /* damping factor in wave equation */
#define GAMMA_SIDES 1.0e-4 /* damping factor on boundary */
#define GAMMA_TOPBOT 1.0e-7 /* damping factor on boundary */
#define KAPPA 0.0 /* "elasticity" term enforcing oscillations */
@@ -140,8 +152,8 @@
/* For similar wave forms, COURANT^2*GAMMA should be kept constant */
#define ADD_OSCILLATING_SOURCE 0 /* set to 1 to add an oscillating wave source */
#define OSCILLATING_SOURCE_PERIOD 30 /* period of oscillating source */
#define ALTERNATE_OSCILLATING_SOURCE 1 /* set to 1 to alternate sign of oscillating source */
#define OSCILLATING_SOURCE_PERIOD 25 /* period of oscillating source */
#define ALTERNATE_OSCILLATING_SOURCE 0 /* set to 1 to alternate sign of oscillating source */
#define ADD_WAVE_PACKET_SOURCES 0 /* set to 1 to add several sources emitting wave packets */
#define WAVE_PACKET_SOURCE_TYPE 1 /* type of wave packet sources */
@@ -150,14 +162,17 @@
/* Boundary conditions, see list in global_pdes.c */
// #define B_COND 1
#define B_COND 2
#define PRECOMPUTE_BC 0 /* set to 1 to compute neighbours for Laplacian in advance */
/* Parameters for length and speed of simulation */
#define NSTEPS 2500 /* number of frames of movie */
#define NSTEPS 2400 /* number of frames of movie */
// #define NSTEPS 500 /* number of frames of movie */
#define NVID 4 /* number of iterations between images displayed on screen */
// #define NVID 10 /* number of iterations between images displayed on screen */
#define NSEG 1000 /* number of segments of boundary */
#define INITIAL_TIME 0 /* time after which to start saving frames */
#define BOUNDARY_WIDTH 2 /* width of billiard boundary */
@@ -173,9 +188,9 @@
/* Parameters of initial condition */
#define INITIAL_AMP 0.5 /* amplitude of initial condition */
#define INITIAL_VARIANCE 0.001 /* variance of initial condition */
#define INITIAL_WAVELENGTH 0.05 /* wavelength of initial condition */
#define INITIAL_AMP 1.0 /* amplitude of initial condition */
#define INITIAL_VARIANCE 0.00005 /* variance of initial condition */
#define INITIAL_WAVELENGTH 0.002 /* wavelength of initial condition */
/* Plot type, see list in global_pdes.c */
@@ -188,8 +203,8 @@
#define CHANGE_LUMINOSITY 1 /* set to 1 to let luminosity depend on energy flux intensity */
#define FLUX_WINDOW 30 /* size of averaging window of flux intensity */
#define AMPLITUDE_HIGH_RES 1 /* set to 1 to increase resolution of plot */
#define SHADE_3D 0 /* set to 1 to change luminosity according to normal vector */
#define SHADE_2D 1 /* set to 1 to change luminosity according to normal vector to plane */
#define SHADE_3D 1 /* set to 1 to change luminosity according to normal vector */
#define SHADE_2D 0 /* set to 1 to change luminosity according to normal vector to plane */
#define SHADE_WAVE 1 /* set to 1 to have luminosity depend on wave height */
#define NON_DIRICHLET_BC 0 /* set to 1 to draw only facets in domain, if field is not zero on boundary */
#define FLOOR_ZCOORD 1 /* set to 1 to draw only facets with z not too negative */
@@ -208,7 +223,7 @@
/* 3D representation */
#define REPRESENTATION_3D 1 /* choice of 3D representation */
#define PLOT_2D 1 /* switch to 2D representation, equirectangular projection */
#define PLOT_2D 0 /* switch to 2D representation, equirectangular projection */
#define PHISHIFT 0.0 /* shift of phi in 2D plot (in degrees) */
#define FLOODING 1 /* set to 1 to draw waves above altitude (for Earth representations) */
@@ -216,10 +231,11 @@
#define REP_PROJ_3D 1 /* projection on plane orthogonal to observer line of sight */
#define ROTATE_VIEW 1 /* set to 1 to rotate position of observer */
#define ROTATE_ANGLE 75.0 /* total angle of rotation during simulation */
#define ROTATE_ANGLE 720.0 /* total angle of rotation during simulation */
// #define ROTATE_ANGLE -50.0 /* total angle of rotation during simulation */
#define ROTATE_VIEW_WHILE_FADE 1 /* set to 1 to keep rotating viewpoint during fade */
#define VIEWPOINT_TRAJ 2 /* type of viewpoint trajectory */
#define VIEWPOINT_TRAJ 1 /* type of viewpoint trajectory */
#define MAX_LATITUDE 45.0 /* maximal latitude for viewpoint trajectory VP_ORBIT2 */
/* Color schemes */
@@ -235,14 +251,14 @@
#define COLOR_SCHEME 3 /* choice of color scheme, see list in global_pdes.c */
#define SCALE 0 /* set to 1 to adjust color scheme to variance of field */
#define SLOPE 1.0 /* sensitivity of color on wave amplitude */
#define SLOPE 0.5 /* sensitivity of color on wave amplitude */
#define VSCALE_AMPLITUDE 1.5 /* additional scaling factor for color scheme P_3D_AMPLITUDE */
#define VSCALE_ENERGY 4.0 /* additional scaling factor for color scheme P_3D_ENERGY */
#define VSCALE_ENERGY 5.0 /* additional scaling factor for color scheme P_3D_ENERGY */
#define PHASE_FACTOR 20.0 /* factor in computation of phase in color scheme P_3D_PHASE */
#define PHASE_SHIFT 0.0 /* shift of phase in color scheme P_3D_PHASE */
#define ATTENUATION 0.0 /* exponential attenuation coefficient of contrast with time */
#define E_SCALE 150.0 /* scaling factor for energy representation */
#define LOG_SCALE 0.75 /* scaling factor for energy log representation */
#define E_SCALE 200.0 /* scaling factor for energy representation */
#define LOG_SCALE 0.25 /* scaling factor for energy log representation */
#define LOG_SHIFT 0.5 /* shift of colors on log scale */
#define LOG_ENERGY_FLOOR -10.0 /* floor value for log of (total) energy */
#define LOG_MEAN_ENERGY_SHIFT 1.0 /* additional shift for log of mean energy */
@@ -260,18 +276,20 @@
#define NXMAZE 8 /* width of maze */
#define NYMAZE 32 /* height of maze */
#define MAZE_MAX_NGBH 5 /* max number of neighbours of maze cell */
#define RAND_SHIFT 5 /* seed of random number generator */
#define RAND_SHIFT 1 /* seed of random number generator */
#define MAZE_XSHIFT 0.0 /* horizontal shift of maze */
#define MAZE_WIDTH 0.02 /* half width of maze walls */
#define DRAW_COLOR_SCHEME 0 /* set to 1 to plot the color scheme */
#define COLORBAR_RANGE 2.0 /* scale of color scheme bar */
#define COLORBAR_RANGE_B 3.0 /* scale of color scheme bar for 2nd part */
#define DRAW_COLOR_SCHEME 1 /* set to 1 to plot the color scheme */
#define COLORBAR_RANGE 6.0 /* scale of color scheme bar */
#define COLORBAR_RANGE_B 6.0 /* scale of color scheme bar for 2nd part */
#define ROTATE_COLOR_SCHEME 0 /* set to 1 to draw color scheme horizontally */
#define CIRC_COLORBAR 0 /* set to 1 to draw circular color scheme */
#define CIRC_COLORBAR_B 0 /* set to 1 to draw circular color scheme */
#define DRAW_WAVE_PROFILE 0 /* set to 1 to draw a profile of the wave */
#define VERTICAL_WAVE_PROFILE 0 /* set to 1 to draw wave profile vertically */
#define DRAW_WAVE_TIMESERIES 0 /* set to 1 to draw a time series of the wave */
#define SAVE_TIME_SERIES 0 /* set to 1 to save wave time series at a point */
#define ADD_POTENTIAL 0 /* set to 1 to add potential to z coordinate */
@@ -288,27 +306,30 @@
double u_3d[2] = {0.75, -0.45}; /* projections of basis vectors for REP_AXO_3D representation */
double v_3d[2] = {-0.75, -0.45};
double w_3d[2] = {0.0, 0.015};
double light[3] = {-0.816496581, 0.40824829, 0.40824829}; /* vector of "light" direction for P_3D_ANGLE color scheme */
double observer[3] = {-5.0, 8.0, -7.0}; /* location of observer for REP_PROJ_3D representation */
double light[3] = {-0.816496581, -0.40824829, 0.40824829}; /* vector of "light" direction for P_3D_ANGLE color scheme */
double observer[3] = {-6.0, -3.0, 4.5}; /* location of observer for REP_PROJ_3D representation */
int reset_view = 0; /* switch to reset 3D view parameters (for option ROTATE_VIEW) */
#define ADD_DEM 1 /* add DEM (digital elevation model) */
#define ADD_NEGATIVE_DEM 0 /* add DEM with bathymetric data */
#define RSCALE_DEM 0.1 /* scaling factor of radial component for DEM */
#define RSCALE_DEM 0.075 /* scaling factor of radial component for DEM */
#define SMOOTH_DEM 0 /* set to 1 to smoothen DEM (to make altitude less constant) */
#define DEM_SMOOTH_STEPS 10 /* number of smoothening steps */
#define DEM_SMOOTH_STEPS 5 /* number of smoothening steps */
#define DEM_SMOOTH_HEIGHT 0.5 /* relative height below which to smoothen */
#define DEM_MAXHEIGHT 8000 /* max height of DEM (estimated from Everest) */
#define PLANET_SEALEVEL 2500.0 /* sea level for flooded planet */
#define DEM_MAXHEIGHT 9000.0 /* max height of DEM (estimated from Everest/Olympus Mons) */
#define PLANET_SEALEVEL 0.0 /* sea level for flooded planet */
// #define PLANET_SEALEVEL 3850.0 /* sea level for flooded planet */
#define VENUS_NODATA_FACTOR 0.5 /* altitude to assign to DEM points without data (fraction of mean altitude) */
#define RSCALE 0.01 /* scaling factor of radial component */
#define RMAX 10.0 /* max value of radial component */
#define Z_SCALING_FACTOR 0.85 /* overall scaling factor of z axis for REP_PROJ_3D representation */
#define XY_SCALING_FACTOR 2.0 /* overall scaling factor for on-screen (x,y) coordinates after projection */
#define RSCALE 0.025 /* scaling factor of radial component */
#define RMAX 1.5 /* max value of radial component */
#define RMIN 0.5 /* min value of radial component */
#define Z_SCALING_FACTOR 0.8 /* overall scaling factor of z axis for REP_PROJ_3D representation */
#define XY_SCALING_FACTOR 2.2 /* overall scaling factor for on-screen (x,y) coordinates after projection */
#define ZMAX_FACTOR 1.0 /* max value of z coordinate for REP_PROJ_3D representation */
#define XSHIFT_3D 0.0 /* overall x shift for REP_PROJ_3D representation */
#define YSHIFT_3D 0.0 /* overall y shift for REP_PROJ_3D representation */
#define COS_VISIBLE -0.5 /* limit on cosine of normal to shown facets */
#define COS_VISIBLE -0.7 /* limit on cosine of normal to shown facets */
#include "global_pdes.c" /* constants and global variables */
#include "global_3d.c" /* constants and global variables */
@@ -712,8 +733,51 @@ void animation()
// for (j=1; j<NPOLY; j++)
// add_circular_wave_mod(1.0, lambda1*cos(((double)j+0.5)*angle), lambda1*sin(((double)j+0.5)*angle), phi, psi, xy_in);
/* Kilauea, Hawaii, USA */
init_circular_wave_sphere(155.2867*PI/180.0, 19.42109*PI/180.0, phi, psi, xy_in, wsphere);
/* Mount Etna, Sicily, Italy */
add_circular_wave_sphere(1.0, -14.9950*PI/180.0, 37.7550*PI/180.0, phi, psi, xy_in, wsphere);
/* Eyjafjallajökull, Iceland */
add_circular_wave_sphere(1.0, 19.61333*PI/180.0, 63.62000*PI/180.0, phi, psi, xy_in, wsphere);
/* Mount Vesuvius, Italy */
add_circular_wave_sphere(1.0, -14.433*PI/180.0, 40.817*PI/180.0, phi, psi, xy_in, wsphere);
/* Sakurajima, Japan */
add_circular_wave_sphere(1.0, -130.65806*PI/180.0, 31.58056*PI/180.0, phi, psi, xy_in, wsphere);
/* Mount Merapi, Indonesia */
add_circular_wave_sphere(1.0, -110.44611*PI/180.0, -7.54139*PI/180.0, phi, psi, xy_in, wsphere);
/* Ulawun, Papua New Guinea */
add_circular_wave_sphere(1.0, -151.33333*PI/180.0, -5.05000*PI/180.0, phi, psi, xy_in, wsphere);
/* Santa María, Guatemala */
add_circular_wave_sphere(1.0, 91.55167*PI/180.0, 14.75556*PI/180.0, phi, psi, xy_in, wsphere);
/* Mount Erebus, Antarctica */
add_circular_wave_sphere(1.0, -167.15333*PI/180.0, -77.52972*PI/180.0, phi, psi, xy_in, wsphere);
/* Piton de la Fournaise, Reunion island, Indian Ocean */
add_circular_wave_sphere(0.75, -55.70889*PI/180.0, -21.24250*PI/180.0, phi, psi, xy_in, wsphere);
/* Soufrière Hills, Montserrat */
add_circular_wave_sphere(0.75, 62.1773*PI/180.0, 16.7103*PI/180.0, phi, psi, xy_in, wsphere);
/* Axial Seamount, Pacific Ocean */
add_circular_wave_sphere(0.5, 130.00*PI/180.0, 45.95*PI/180.0, phi, psi, xy_in, wsphere);
/* Havre Seamount, New Zealand */
add_circular_wave_sphere(0.5, 179.968611*PI/180.0, -31.120278*PI/180.0, phi, psi, xy_in, wsphere);
/* Boomerang Seamount, Indian Ocean */
add_circular_wave_sphere(0.5, -77.825*PI/180.0, -37.721*PI/180.0, phi, psi, xy_in, wsphere);
// init_wave_flat_sphere(phi, psi, xy_in, wsphere);
init_circular_wave_sphere(123.3*PI/180.0, -48.8*PI/180.0, phi, psi, xy_in, wsphere);
// for (j=0; j<6; j++)
// add_circular_wave_sphere(1.0, (double)j*PI/3.0, 0.925*PID, phi, psi, xy_in, wsphere);
// add_circular_wave_sphere(1.0, 1.0 - PI/9.0 + DPI/3.0, 0.15, phi, psi, xy_in, wsphere);
// add_circular_wave_sphere(1.0, 1.0 - PI/9.0 + 2.0*DPI/3.0, 0.15, phi, psi, xy_in, wsphere);
@@ -801,7 +865,8 @@ void animation()
if ((ADD_OSCILLATING_SOURCE)&&(i%OSCILLATING_SOURCE_PERIOD == 1))
{
if (ALTERNATE_OSCILLATING_SOURCE) sign = -sign;
add_circular_wave_mod(sign, -0.5, 0.0, phi, psi, xy_in);
for (j=0; j<6; j++)
add_circular_wave_sphere(sign, (double)j*PI/3.0, 0.925*PID, phi, psi, xy_in, wsphere);
}
if (PRINT_SPEED) print_speed_3d(speed, 0, 1.0);