The FARGO_THORIN code developer's guide
 All Data Structures Files Functions Variables Typedefs Macros
SideEuler.c
Go to the documentation of this file.
1 /** \file SideEuler.c
2 
3 Total mass and angular momentum monitoring, and boundary conditions.
4 In addition, this file contains a few low-level functions that
5 manipulate PolarGrid 's or initialize the forces evaluation.
6 
7 @author THORIN modifications by
8 Ondřej Chrenko <chrenko@sirrah.troja.mff.cuni.cz>, Copyright (C) 2017;
9 original code by Frédéric Masset
10 
11 */
12 
13 #include "fargo.h"
14 
15 extern boolean OpenInner, NonReflecting, OuterSourceMass;
16 
17 
19 PolarGrid *array;
20 {
21  int i,j,ns;
22  real *density, total = 0.0, fulltotal=0.0;
23  ns = array->Nsec;
24  density = array->Field;
25  if (FakeSequential && (CPU_Rank > 0))
26  MPI_Recv (&total, 1, MPI_DOUBLE, CPU_Rank-1, 0, MPI_COMM_WORLD, &fargostat);
27  for (i = Zero_or_active; i < Max_or_active; i++) {
28  for (j = 0; j < ns; j++) {
29  total += Surf[i]*density[j+i*ns];
30  }
31  }
32  if (FakeSequential) {
33  if (CPU_Rank < CPU_Number-1)
34  MPI_Send (&total, 1, MPI_DOUBLE, CPU_Rank+1, 0, MPI_COMM_WORLD);
35  }
36  else
37  MPI_Allreduce (&total, &fulltotal, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
38  if (FakeSequential) {
40  fulltotal = total;
41  }
42  return fulltotal;
43 }
44 
45 real GasMomentum (Density, Vtheta)
46 PolarGrid *Density, *Vtheta;
47 {
48  int i,j,ns;
49  real *density, *vtheta, total = 0.0, fulltotal=0.0;
50  ns = Density->Nsec;
51  density = Density->Field;
52  vtheta = Vtheta->Field;
53  if (FakeSequential && (CPU_Rank > 0))
54  MPI_Recv (&total, 1, MPI_DOUBLE, CPU_Rank-1, 2, MPI_COMM_WORLD, &fargostat);
55  for (i = Zero_or_active; i < Max_or_active; i++) {
56  for (j = 1; j < ns; j++) {
57  total += Surf[i]*(density[j+i*ns]+density[j-1+i*ns])*Rmed[i]*(vtheta[j+i*ns]+OmegaFrame*Rmed[i]);
58  }
59  total += Surf[i]*(density[i*ns]+density[i*ns+ns-1])*Rmed[i]*(vtheta[i*ns]+OmegaFrame*Rmed[i]);
60  }
61  if (FakeSequential) {
62  if (CPU_Rank < CPU_Number-1)
63  MPI_Send (&total, 1, MPI_DOUBLE, CPU_Rank+1, 2, MPI_COMM_WORLD);
64  }
65  else
66  MPI_Allreduce (&total, &fulltotal, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
67  if (FakeSequential) {
69  fulltotal = total;
70  }
71  return 0.5*fulltotal;
72 }
73 
74 void DivisePolarGrid (Num, Denom, Res)
75 PolarGrid *Num, *Denom, *Res;
76 {
77  int i,j,l,nr,ns;
78  real *num, *denom, *res;
79  num = Num->Field;
80  denom=Denom->Field;
81  res = Res->Field;
82  ns = Res->Nrad;
83  nr = Res->Nsec;
84 #pragma omp parallel for private(j,l)
85  for (i = 0; i <= nr; i++) {
86  for (j = 0; j < ns; j++) {
87  l = j+ns*i;
88  res[l] = num[l]/(denom[l]+1e-20);
89  }
90  }
91 }
92 
94 {
95  int i, j, l, nr, ns;
96  real *abs, *ord;
97  CellAbscissa = CreatePolarGrid (NRAD,NSEC,"abscissa");
98  CellOrdinate = CreatePolarGrid (NRAD,NSEC,"ordinate");
99  nr = CellAbscissa->Nrad;
100  ns = CellAbscissa->Nsec;
101  abs = CellAbscissa->Field;
102  ord = CellOrdinate->Field;
103  for (i = 0; i < nr; i++) {
104  for (j = 0; j < ns; j++) {
105  l = j+i*ns;
106  abs[l] = Rmed[i] * cos(2.0*PI*(real)j/(real)ns);
107  ord[l] = Rmed[i] * sin(2.0*PI*(real)j/(real)ns);
108  }
109  }
110 }
111 
112 void OpenBoundary (Vrad, Rho, Energy) /* #THORIN */
113 PolarGrid *Vrad, *Rho, *Energy;
114 {
115  int i,j,l,ns;
116  real *rho, *vr, *energy;
117  if (CPU_Rank != 0) return;
118  ns = Rho->Nsec;
119  rho = Rho->Field;
120  vr = Vrad->Field;
121  energy = Energy->Field;
122  i = 1;
123 #pragma omp parallel for private(l)
124  for (j = 0; j < ns; j++) {
125  l = j+i*ns;
126  rho[l-ns] = rho[l]; /* copy first ring into ghost ring */
127  energy[l-ns] = energy[l]; /* #THORIN */
128  if ((vr[l+ns] > 0.0) || (rho[l] < SigmaMed[0]))
129  vr[l] = 0.0; /* we just allow outflow [inwards] */
130  else
131  vr[l] = vr[l+ns];
132  }
133 }
134 
135 void NonReflectingBoundary (Vrad, Rho, Energy) /* #THORIN */
136 PolarGrid *Vrad, *Rho, *Energy;
137 {
138  int i,j,l,ns,nr,jp,lp,i_angle;
139  real *rho, *vr, *energy, *cs;
140  real dangle, mean, vr_med, csin, csout;
141  /* ----- */
142  ns = Rho->Nsec;
143  nr = Rho->Nrad;
144  rho = Rho->Field;
145  vr = Vrad->Field;
146  energy = Energy->Field;
147  cs = SoundSpeed->Field;
148  if (CPU_Rank == 0) {
149  csin = 0.0;
150  csout = 0.0;
151  for (j=0; j<ns; j++) {
152  csin += cs[j];
153  csout += cs[ns+j];
154  }
155  csin /= (real)ns;
156  csout /= (real)ns;
157  i = 1; /* The expression below should be refined */
158  /* We need to know the orbital frequency of the nearest planet */
159  dangle = (pow(Rinf[1],-1.5)-1.0)/(.5*(csin + csout));
160  dangle *= (Rmed[1]-Rmed[0]);
161  i_angle = (int)(dangle/2.0/PI*(real)NSEC+.5);
162 #pragma omp parallel for private(l,jp,lp,vr_med)
163  for (j = 0; j < ns; j++) {
164  l = j+i*ns;
165  jp = j+i_angle;
166  if (jp >= ns) jp -= ns;
167  if (jp < 0) jp += ns;
168  lp = jp;
169  rho[lp] = rho[l]; /* copy first ring into ghost ring */
170  energy[lp] = energy[l];
171  vr_med = -cs[l]*(rho[l]-SigmaMed[1])/SigmaMed[1];
172  vr[l] = 2.*vr_med-vr[l+ns];
173  }
174  mean = 0.0;
175  for (j = 0; j < ns; j++) {
176  mean += rho[j];
177  }
178  mean /= (real)ns;
179  for (j = 0; j < ns; j++) {
180  rho[j] += SigmaMed[0]-mean;
181  }
182  /* #THORIN ---> */
183  mean = 0.0;
184  for (j = 0; j < ns; j++) {
185  mean += energy[j];
186  }
187  mean /= (real)ns;
188  for (j = 0; j < ns; j++) {
189  energy[j] += EnergyMed[0]-mean;
190  }
191  /* <--- */
192  }
193  if (CPU_Rank == CPU_Number-1) {
194  csin = 0.0;
195  csout = 0.0;
196  for (j=0; j<ns; j++) {
197  csin += cs[(nr-2)*ns+j];
198  csout += cs[(nr-1)*ns+j];
199  }
200  csin /= (real)ns;
201  csout /= (real)ns;
202  i = nr-1; /* The expression below should be refined */
203  /* We need to know the orbital frequency of the nearest planet */
204  dangle = (pow(Rinf[nr-2],-1.5)-1.0)/(.5*(csin + csout));
205  dangle *= (Rmed[nr-1]-Rmed[nr-2]);
206  i_angle = (int)(dangle/2.0/PI*(real)NSEC+.5);
207 #pragma omp parallel for private(l,jp,lp,vr_med)
208  for (j = 0; j < ns; j++) {
209  l = j+i*ns;
210  jp = j-i_angle;
211  if (jp >= ns) jp -= ns;
212  if (jp < 0) jp += ns;
213  lp = jp+(i-1)*ns;
214  rho[l] = rho[lp]; /* copy first ring into ghost ring */
215  energy[l] = energy[lp]; /* #THORIN */
216  vr_med = cs[l]*(rho[l-ns]-SigmaMed[nr-2])/SigmaMed[nr-2];
217  vr[l] = 2.*vr_med-vr[l-ns];
218  }
219  mean = 0.0;
220  for (j = 0; j < ns; j++) {
221  mean += rho[j+ns*(nr-1)];
222  }
223  mean /= (real)ns;
224  for (j = 0; j < ns; j++) {
225  rho[j+(nr-1)*ns] += SigmaMed[nr-1]-mean;
226  }
227  /* #THORIN ---> */
228  mean = 0.0;
229  for (j = 0; j < ns; j++) {
230  mean += energy[j+ns*(nr-1)];
231  }
232  mean /= (real)ns;
233  for (j = 0; j < ns; j++) {
234  energy[j+(nr-1)*ns] += EnergyMed[nr-1]-mean;
235  }
236  /* <--- */
237  }
238 }
239 
240 /** Sets the wave-killing factors within the damping zones;
241  * inspired by de Val-Borro et al. (2006). */
242 void SetWaveKillingZones () /* #THORIN */
243 {
244  int i;
245  real DRin, DRout, tauin, tauout, damp;
246  /* ----- */
247  DRin = RMIN*DAMPINGRMINFRAC; /* Boundaries of killling zones */
248  DRout = RMAX*DAMPINGRMAXFRAC;
249  tauin = DAMPINGPERIODFRAC*2.0*PI*pow(RMIN,1.5);
250  tauout = DAMPINGPERIODFRAC*2.0*PI*pow(DRout, 1.5); /* DRout (shortest frequency) used in outer zone */
251  /* compute damping coefficients */
252  for (i=Zero_or_active; i<Max_or_active; i++) {
253  WaveKiller[i] = 0.0;
254  if (Rmed[i] < DRin) {
255  damp = (DRin - Rmed[i])/(DRin - RMIN);
256  WaveKiller[i] = damp*damp/tauin;
257  }
258  if (Rmed[i] > DRout) {
259  damp = (Rmed[i] - DRout)/(RMAX - DRout);
260  WaveKiller[i] = damp*damp/tauout;
261  WaveKiller[i] = damp/tauout;
262  }
263  }
264 }
265 
266 /** Imposes the wave-killing boundary condition. Currently,
267  * the condition is set to always damp the radial velocity
268  * to zero. Additionaly, the density, azimuthal velocity
269  * and energy can be damped to their initial values. */
270 void DampingBoundary (Vrad, Vtheta, Rho, Energy, step) /* #THORIN */
271 PolarGrid *Vrad, *Vtheta, *Rho, *Energy;
272 real step;
273 {
274  int i, j, l, ns;
275  real *vrad, *vtheta, *rho, *energy;
276  real vrad0, vtheta0=0.0, rho0, energy0;
277  real DRin, DRout, lambda;
278  /* ----- */
279  vrad = Vrad->Field;
280  vtheta = Vtheta->Field;
281  ns = Vrad->Nsec;
282  rho = Rho->Field;
283  energy = Energy->Field;
284  DRin = RMIN*DAMPINGRMINFRAC;
285  DRout = RMAX*DAMPINGRMAXFRAC;
286 #pragma omp parallel default(none) \
287  shared(Zero_or_active,Max_or_active,Rmed,DRin,DRout,DampInit,\
288  ns,vrad,rho,energy,vtheta,WaveKiller,OmegaFrame,SigmaMed,EnergyMed,VthetaMed,step) \
289  private(i,vrad0,rho0,energy0,vtheta0,lambda,j,l)
290  {
291 #pragma omp for
292  for (i=Zero_or_active; i<Max_or_active; i++) {
293  if (Rmed[i] < DRin || Rmed[i] > DRout) {
294  vrad0 = 0.0;
295  if (DampInit) {
296  rho0 = SigmaMed[i];
297  energy0 = EnergyMed[i];
298  vtheta0 = VthetaMed[i] - Rmed[i]*OmegaFrame; /* from inertial to corot */
299  }
300  lambda = WaveKiller[i]*step;
301  for (j=0; j<ns; j++) {
302  l = j + i*ns;
303  vrad[l] = (vrad[l] + lambda*vrad0)/(1.0 + lambda);
304  if (DampInit) {
305  rho[l] = (rho[l] + lambda*rho0)/(1.0 + lambda);
306  energy[l] = (energy[l] + lambda*energy0)/(1.0 + lambda);
307  vtheta[l] = (vtheta[l] + lambda*vtheta0)/(1.0 + lambda);
308  }
309  }
310  }
311  }
312  } // end of the omp parallel region
313 }
314 
315 /** Damps the pebble disk inside the wave-killing zones
316  * towards its equilibrium state. */
317 void DampPebbles (PebbleDens, PebbleVrad, PebbleVtheta, dt) /* #THORIN */
319 real dt;
320 {
321  int i, j, l, ns;
322  real DRin, DRout, lambda;
323  real pdens0, pvr0, pvt0;
324  real *pdens, *pvr, *pvt;
325  /* ----- */
326  ns = PebbleDens->Nsec;
327  pdens = PebbleDens->Field;
328  pvr = PebbleVrad->Field;
329  pvt = PebbleVtheta->Field;
330  DRin = RMIN*DAMPINGRMINFRAC;
331  DRout = RMAX*DAMPINGRMAXFRAC;
332 #pragma omp parallel for default(none) \
333  shared (Zero_or_active,Max_or_active,Rmed,DRin,DRout, \
334  WaveKiller,PebDensInit,PebVradInit,PebVthetaInit,OmegaFrame,dt,pdens,pvr,pvt,ns) \
335  private (i,j,l,lambda,pdens0,pvr0,pvt0)
336  for (i=Zero_or_active; i<Max_or_active; i++) {
337  if (Rmed[i] < DRin || Rmed[i] > DRout) {
338  lambda = WaveKiller[i]*dt;
339  pdens0 = PebDensInit[i];
340  pvr0 = PebVradInit[i];
341  pvt0 = PebVthetaInit[i] - Rmed[i]*OmegaFrame;
342  for (j=0; j<ns; j++) {
343  l = j + i*ns;
344  pdens[l] = (pdens[l] + lambda*pdens0)/(1.0 + lambda);
345  pvr[l] = (pvr[l] + lambda*pvr0)/(1.0 + lambda);
346  pvt[l] = (pvt[l] + lambda*pvt0)/(1.0 + lambda);
347  }
348  }
349  }
350 }
351 
352 /* <--- */
353 
354 void ApplyOuterSourceMass (Rho, Vrad)
355  PolarGrid *Rho, *Vrad;
356 {
357  int i,j,l,nr,ns;
358  real *rho, average_rho = 0.0, *vr, penul_vr;
359  if (CPU_Rank != CPU_Number-1) return;
360  nr = Rho->Nrad;
361  ns = Rho->Nsec;
362  rho= Rho->Field;
363  vr = Vrad->Field;
364  i = nr-1;
365  for (j = 0; j < ns; j++) {
366  l = j+i*ns;
367  average_rho += rho[l];
368  }
369  average_rho /= (real)ns;
370  average_rho = SigmaMed[nr-1]-average_rho;
371  for (j = 0; j < ns; j++) {
372  l = j+i*ns;
373  rho[l] += average_rho;
374  }
375  i = nr-1;
376  penul_vr = IMPOSEDDISKDRIFT*pow((Rinf[nr-1]/1.0),-SIGMASLOPE);
377  for (j = 0; j < ns; j++) {
378  l = j+i*ns;
379  vr[l] = penul_vr;
380  }
381 }
382 
383 
384 void ApplyBoundaryCondition (Vrad, Vtheta, Rho, Energy, dt) /* #THORIN */
385 PolarGrid *Vrad, *Vtheta, *Rho, *Energy;
386 real dt;
387 {
388  /* Note: Stockholm boundary was discarded, it is now refined in DampingBoundary() */
389  if (OpenInner == YES) OpenBoundary (Vrad, Rho, Energy); /* #THORIN */
390  if (NonReflecting == YES) {
391  if (EnergyEq) ComputeSoundSpeed (Rho, Energy); /* #THORIN */
392  NonReflectingBoundary (Vrad, Rho, Energy); /* #THORIN */
393  }
394  if (Damping) DampingBoundary (Vrad, Vtheta, Rho, Energy, dt); /* #THORIN */
395  if (OuterSourceMass == YES) ApplyOuterSourceMass (Rho, Vrad);
396 }
397 
398 void CorrectVtheta (vtheta, domega)
399 PolarGrid *vtheta;
400 real domega;
401 {
402  int i,j,l,nr,ns;
403  real *vt;
404  nr = vtheta->Nrad;
405  ns = vtheta->Nsec;
406  vt = vtheta->Field;
407  for (i = 0; i < nr; i++) {
408  for (j = 0; j < ns; j++) {
409  l = j+i*ns;
410  vt[l] -= domega*Rmed[i];
411  }
412  }
413 }
414 
415 /* see e.g. GasTotalMass() to compare the MPI implementation */
416 real GasTotalEnergy (Rho, Vrad, Vtheta, Energy)
417 PolarGrid *Rho, *Vrad, *Vtheta, *Energy;
418 {
419  int i, j, l, ns;
420  real vr_cent, vt_cent;
421  real total = 0.0, fulltotal = 0.0;
422  real *density, *vrad, *vtheta, *energy;
423  /* ----- */
424  ns = Rho->Nsec;
425  density = Rho->Field;
426  vrad = Vrad->Field;
427  vtheta = Vtheta->Field;
428  energy = Energy->Field;
429  if (FakeSequential && (CPU_Rank > 0))
430  MPI_Recv (&total, 1, MPI_DOUBLE, CPU_Rank-1, 2, MPI_COMM_WORLD, &fargostat);
431  for (i = Zero_or_active; i < Max_or_active; i++) {
432  for (j = 0; j < ns; j++) {
433  l = j + i*ns;
434  /* centered-in-cell radial velocity, weighted mean */
435  vr_cent = (Rmed[i]-Rinf[i])*vrad[l+ns] + (Rsup[i]-Rmed[i])*vrad[l];
436  vr_cent /= (Rsup[i]-Rinf[i]);
437  /* centered-in-cell azimuthal velocity, arithmetic mean as the azim. velocity
438  position with respect to the cell center is symetric */
439  if (j < ns-1)
440  vt_cent = 0.5*(vtheta[l]+vtheta[l+1]) + Rmed[i]*OmegaFrame;
441  else
442  vt_cent = 0.5*(vtheta[l]+vtheta[i*ns]) + Rmed[i]*OmegaFrame;
443  /* Total energy is the sum of the kinetic and internal energy. GPE? */
444  total += 0.5*Surf[i]*density[l]*(vr_cent*vr_cent + vt_cent*vt_cent) + \
445  Surf[i]*energy[l];
446  }
447  }
448  if (FakeSequential) {
449  if (CPU_Rank < CPU_Number-1) MPI_Send (&total, 1, MPI_DOUBLE, CPU_Rank+1, 2, MPI_COMM_WORLD);
450  } else {
451  MPI_Allreduce (&total, &fulltotal, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
452  }
453  if (FakeSequential) {
455  fulltotal = total;
456  }
457  return fulltotal;
458 }
459 /* <--- */
double real
Definition of the type 'real' used throughout the code.
Definition: types.h:20
real DAMPINGRMAXFRAC
Definition: param_noex.h:69
MPI_Status fargostat
Definition: global.h:32
real VthetaMed[MAX1D]
Definition: global.h:16
void MPI_Send()
Definition: mpi_dummy.c:56
real SIGMASLOPE
Definition: param_noex.h:27
real Rsup[MAX1D]
Definition: global.h:11
real DAMPINGPERIODFRAC
Definition: param_noex.h:70
int CPU_Number
Definition: global.h:2
#define YES
Definition: types.h:46
static real vt_cent[MAX1D]
Definition: Pframeforce.c:29
real EnergyMed[MAX1D]
Definition: global.h:16
#define MPI_DOUBLE
Definition: mpi_dummy.h:11
void OpenBoundary(PolarGrid *Vrad, PolarGrid *Rho, PolarGrid *Energy)
Definition: SideEuler.c:112
void DivisePolarGrid(PolarGrid *Num, PolarGrid *Denom, PolarGrid *Res)
Definition: SideEuler.c:74
PolarGrid * CreatePolarGrid(int Nr, int Ns, char *name)
Definition: LowTasks.c:73
PolarGrid * SoundSpeed
Definition: global.h:35
boolean FakeSequential
Definition: global.h:29
real GasMomentum(PolarGrid *Density, PolarGrid *Vtheta)
Definition: SideEuler.c:45
int Zero_or_active
Definition: global.h:6
void SetWaveKillingZones()
Sets the wave-killing factors within the damping zones; inspired by de Val-Borro et al...
Definition: SideEuler.c:242
A structure used to store any scalar fied on the computational domain.
Definition: types.h:37
boolean DampInit
Definition: global.h:24
real * Field
Definition: types.h:40
boolean OpenInner
Definition: main.c:14
int Nrad
Radial size of the grid, in number of zones.
Definition: types.h:38
real GasTotalEnergy(PolarGrid *Rho, PolarGrid *Vrad, PolarGrid *Vtheta, PolarGrid *Energy)
Definition: SideEuler.c:416
real Rmed[MAX1D]
Definition: global.h:11
void ApplyOuterSourceMass(PolarGrid *Rho, PolarGrid *Vrad)
Definition: SideEuler.c:354
boolean OuterSourceMass
Definition: Interpret.c:30
real PebVthetaInit[MAX1D]
Definition: global.h:18
PolarGrid * CellOrdinate
Definition: global.h:33
boolean EnergyEq
Definition: global.h:24
boolean Damping
Definition: global.h:24
void DampPebbles(PolarGrid *PebbleDens, PolarGrid *PebbleVrad, PolarGrid *PebbleVtheta, real dt)
Damps the pebble disk inside the wave-killing zones towards its equilibrium state.
Definition: SideEuler.c:317
boolean NonReflecting
Definition: Interpret.c:30
real OmegaFrame
Definition: global.h:20
real GasTotalMass(PolarGrid *array)
Definition: SideEuler.c:18
void MPI_Allreduce(void *ptr, void *ptr2, int count, int type, int foo3, int foo4)
Definition: mpi_dummy.c:72
#define MPI_SUM
Definition: mpi_dummy.h:17
real PebDensInit[MAX1D]
Definition: global.h:18
void InitComputeAccel()
Definition: SideEuler.c:93
int NSEC
Definition: param_noex.h:19
int Max_or_active
Definition: global.h:7
real PebVradInit[MAX1D]
Definition: global.h:18
PolarGrid * CellAbscissa
Definition: global.h:33
real RMIN
Definition: param_noex.h:20
real DAMPINGRMINFRAC
Definition: param_noex.h:68
real Surf[MAX1D]
Definition: global.h:11
real RMAX
Definition: param_noex.h:21
void NonReflectingBoundary(PolarGrid *Vrad, PolarGrid *Rho, PolarGrid *Energy)
Definition: SideEuler.c:135
PolarGrid * PebbleDens
Definition: global.h:38
void ApplyBoundaryCondition(PolarGrid *Vrad, PolarGrid *Vtheta, PolarGrid *Rho, PolarGrid *Energy, real dt)
Definition: SideEuler.c:384
void MPI_Recv()
Definition: mpi_dummy.c:60
real WaveKiller[MAX1D]
Definition: global.h:16
int NRAD
Definition: param_noex.h:18
static real domega
Definition: EnergySources.c:40
Contains all the include directives requested by the code.
real Rinf[MAX1D]
Definition: global.h:11
real IMPOSEDDISKDRIFT
Definition: param_noex.h:38
int Nsec
Azimuthal size of the grid, in number of zones.
Definition: types.h:39
real SigmaMed[MAX1D]
Definition: global.h:14
PolarGrid * PebbleVtheta
Definition: global.h:38
void CorrectVtheta(PolarGrid *vtheta, real domega)
Definition: SideEuler.c:398
int CPU_Rank
Definition: global.h:1
real Energy()
PolarGrid * PebbleVrad
Definition: global.h:38
#define PI
Definition: fondam.h:12
void ComputeSoundSpeed()
#define MPI_COMM_WORLD
Definition: mpi_dummy.h:10
void DampingBoundary(PolarGrid *Vrad, PolarGrid *Vtheta, PolarGrid *Rho, PolarGrid *Energy, real step)
Imposes the wave-killing boundary condition.
Definition: SideEuler.c:270
void MPI_Bcast()
Definition: mpi_dummy.c:44