Add files via upload
This commit is contained in:
committed by
GitHub
parent
7daa596903
commit
7e2166b1d9
@@ -42,7 +42,7 @@
|
||||
#include <tiffio.h> /* Sam Leffler's libtiff library. */
|
||||
#include <omp.h>
|
||||
|
||||
#define MOVIE 0 /* set to 1 to generate movie */
|
||||
#define MOVIE 1 /* set to 1 to generate movie */
|
||||
|
||||
#define WINWIDTH 1280 /* window width */
|
||||
#define WINHEIGHT 720 /* window height */
|
||||
@@ -59,11 +59,11 @@
|
||||
|
||||
/* Choice of the billiard table */
|
||||
|
||||
#define B_DOMAIN 20 /* choice of domain shape, see list in global_pdes.c */
|
||||
#define B_DOMAIN_B 20 /* choice of domain shape, see list in global_pdes.c */
|
||||
#define B_DOMAIN 20 /* choice of domain shape, see list in global_pdes.c */
|
||||
#define B_DOMAIN_B 20 /* choice of domain shape, see list in global_pdes.c */
|
||||
|
||||
#define CIRCLE_PATTERN 1 /* pattern of circles, see list in global_pdes.c */
|
||||
#define CIRCLE_PATTERN_B 10 /* pattern of circles, see list in global_pdes.c */
|
||||
#define CIRCLE_PATTERN 11 /* pattern of circles, see list in global_pdes.c */
|
||||
#define CIRCLE_PATTERN_B 8 /* pattern of circles, see list in global_pdes.c */
|
||||
|
||||
#define P_PERCOL 0.25 /* probability of having a circle in C_RAND_PERCOL arrangement */
|
||||
#define NPOISSON 300 /* number of points for Poisson C_RAND_POISSON arrangement */
|
||||
@@ -78,7 +78,7 @@
|
||||
#define MANDELLEVEL 1000 /* iteration level for Mandelbrot set */
|
||||
#define MANDELLIMIT 10.0 /* limit value for approximation of Mandelbrot set */
|
||||
#define FOCI 1 /* set to 1 to draw focal points of ellipse */
|
||||
#define NGRIDX 15 /* number of grid point for grid of disks */
|
||||
#define NGRIDX 20 /* number of grid point for grid of disks */
|
||||
#define NGRIDY 20 /* number of grid point for grid of disks */
|
||||
|
||||
/* You can add more billiard tables by adapting the functions */
|
||||
@@ -86,16 +86,22 @@
|
||||
|
||||
/* Physical parameters of wave equation */
|
||||
|
||||
#define TWOSPEEDS 0 /* set to 1 to replace hardcore boundary by medium with different speed */
|
||||
#define OSCILLATE_LEFT 0 /* set to 1 to add oscilating boundary condition on the left */
|
||||
#define OSCILLATE_TOPBOT 0 /* set to 1 to enforce a planar wave on top and bottom boundary */
|
||||
#define TWOSPEEDS 1 /* set to 1 to replace hardcore boundary by medium with different speed */
|
||||
#define OSCILLATE_LEFT 1 /* set to 1 to add oscilating boundary condition on the left */
|
||||
#define OSCILLATE_TOPBOT 0 /* set to 1 to enforce a planar wave on top and bottom boundary */
|
||||
|
||||
#define OMEGA 0.0035 /* frequency of periodic excitation */
|
||||
#define AMPLITUDE 1.0 /* amplitude of periodic excitation */
|
||||
#define OMEGA 0.0 /* frequency of periodic excitation */
|
||||
#define AMPLITUDE 0.025 /* amplitude of periodic excitation */
|
||||
#define COURANT 0.02 /* Courant number */
|
||||
#define COURANTB 0.0075 /* Courant number in medium B */
|
||||
#define COURANTB 0.004 /* Courant number in medium B */
|
||||
// #define COURANTB 0.005 /* Courant number in medium B */
|
||||
// #define COURANTB 0.008 /* Courant number in medium B */
|
||||
#define GAMMA 0.0 /* damping factor in wave equation */
|
||||
#define GAMMAB 1.0e-5 /* damping factor in wave equation */
|
||||
// #define GAMMA 1.0e-8 /* damping factor in wave equation */
|
||||
#define GAMMAB 1.0e-8 /* damping factor in wave equation */
|
||||
// #define GAMMAB 1.0e-6 /* damping factor in wave equation */
|
||||
// #define GAMMAB 2.0e-4 /* damping factor in wave equation */
|
||||
// #define GAMMAB 2.5e-4 /* damping factor in wave equation */
|
||||
#define GAMMA_SIDES 1.0e-4 /* damping factor on boundary */
|
||||
#define GAMMA_TOPBOT 1.0e-6 /* damping factor on boundary */
|
||||
#define KAPPA 0.0 /* "elasticity" term enforcing oscillations */
|
||||
@@ -112,7 +118,7 @@
|
||||
|
||||
/* Parameters for length and speed of simulation */
|
||||
|
||||
#define NSTEPS 6000 /* number of frames of movie */
|
||||
#define NSTEPS 3200 /* number of frames of movie */
|
||||
#define NVID 25 /* number of iterations between images displayed on screen */
|
||||
#define NSEG 100 /* number of segments of boundary */
|
||||
#define INITIAL_TIME 200 /* time after which to start saving frames */
|
||||
@@ -123,10 +129,11 @@
|
||||
#define PSLEEP 1 /* sleep time during pause */
|
||||
#define SLEEP1 1 /* initial sleeping time */
|
||||
#define SLEEP2 1 /* final sleeping time */
|
||||
#define END_FRAMES 100 /* number of still frames at end of movie */
|
||||
|
||||
/* Plot type, see list in global_pdes.c */
|
||||
|
||||
#define PLOT 1
|
||||
#define PLOT 0
|
||||
|
||||
/* Color schemes */
|
||||
|
||||
@@ -135,7 +142,7 @@
|
||||
#define COLOR_SCHEME 1 /* 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.5 /* sensitivity of color on wave amplitude */
|
||||
#define SLOPE 50.0 /* sensitivity of color on wave amplitude */
|
||||
#define ATTENUATION 0.0 /* exponential attenuation coefficient of contrast with time */
|
||||
#define E_SCALE 2000.0 /* scaling factor for energy representation */
|
||||
|
||||
@@ -148,7 +155,7 @@
|
||||
|
||||
/* For debugging purposes only */
|
||||
#define FLOOR 0 /* set to 1 to limit wave amplitude to VMAX */
|
||||
#define VMAX 10.0 /* max value of wave amplitude */
|
||||
#define VMAX 5.0 /* max value of wave amplitude */
|
||||
|
||||
|
||||
#include "global_pdes.c" /* constants and global variables */
|
||||
@@ -174,7 +181,7 @@ void evolve_wave_half(double *phi_in[NX], double *psi_in[NX], double *phi_out[NX
|
||||
|
||||
time++;
|
||||
|
||||
#pragma omp parallel for private(i,j,iplus,iminus,jplus,jminus,delta,x,y)
|
||||
#pragma omp parallel for private(i,j,iplus,iminus,jplus,jminus,delta,x,y,c,cc,gamma)
|
||||
for (i=0; i<NX; i++){
|
||||
for (j=0; j<NY; j++){
|
||||
if (xy_in[i][j])
|
||||
@@ -228,8 +235,9 @@ void evolve_wave_half(double *phi_in[NX], double *psi_in[NX], double *phi_out[NX
|
||||
iminus = (i-1); if (iminus == -1) iminus = 0;
|
||||
if (j < jmid) /* lower half */
|
||||
{
|
||||
jplus = (j+1) % jmid;
|
||||
jminus = (j-1) % jmid;
|
||||
jplus = (j+1);
|
||||
if (jplus >= jmid) jplus -= jmid;
|
||||
jminus = (j-1);
|
||||
if (jminus < 0) jminus += jmid;
|
||||
}
|
||||
else /* upper half */
|
||||
@@ -293,6 +301,7 @@ void evolve_wave_half(double *phi_in[NX], double *psi_in[NX], double *phi_out[NX
|
||||
|
||||
/* add oscillating boundary condition on the left */
|
||||
if ((i == 0)&&(OSCILLATE_LEFT)) phi_out[i][j] = AMPLITUDE*cos((double)time*OMEGA);
|
||||
|
||||
psi_out[i][j] = x;
|
||||
|
||||
if (FLOOR)
|
||||
@@ -344,7 +353,8 @@ void animation()
|
||||
courantb2 = COURANTB*COURANTB;
|
||||
|
||||
/* initialize wave with a drop at one point, zero elsewhere */
|
||||
int_planar_wave_comp(XMIN + 0.015, 0.0, phi, psi, xy_in);
|
||||
init_wave_flat_comp(phi, psi, xy_in);
|
||||
// int_planar_wave_comp(XMIN + 0.015, 0.0, phi, psi, xy_in);
|
||||
// int_planar_wave_comp(XMIN + 0.5, 0.0, phi, psi, xy_in);
|
||||
printf("initializing wave\n");
|
||||
// int_planar_wave_comp(XMIN + 0.1, 0.0, phi, psi, xy_in);
|
||||
@@ -434,7 +444,7 @@ void animation()
|
||||
|
||||
if (MOVIE)
|
||||
{
|
||||
for (i=0; i<20; i++) save_frame();
|
||||
for (i=0; i<END_FRAMES; i++) save_frame();
|
||||
s = system("mv wave*.tif tif_wave/");
|
||||
}
|
||||
for (i=0; i<NX; i++)
|
||||
|
||||
Reference in New Issue
Block a user