PLUTO
get_nghost.c File Reference

Return the number of ghost zones. More...

#include "pluto.h"
Include dependency graph for get_nghost.c:

Go to the source code of this file.

Functions

int GetNghost (void)
 

Detailed Description

Return the number of ghost zones.

Return the number of ghost zones employed by the selected numerical algorithm. The minimum number for a 2nd-order algorithm is 2. Higher-order interpolation scheme may require more zones.

Authors
A. Mignone (migno.nosp@m.ne@p.nosp@m.h.uni.nosp@m.to.i.nosp@m.t)
Date
Aug 24, 2015

Definition in file get_nghost.c.

Function Documentation

int GetNghost ( void  )

Compute the number of ghost zones, depending on the selected scheme.

Definition at line 18 of file get_nghost.c.

24 {
25  int nv, nghost ;
26  Limiter *limiter[NVAR];
27 
28  #if RECONSTRUCTION == FLAT
29 
30  nghost = 2;
31 
32  #elif RECONSTRUCTION == LINEAR || RECONSTRUCTION == LimO3\
33  || RECONSTRUCTION == WENO3
34  #if LIMITER == FOURTH_ORDER_LIM
35  nghost = 3;
36  #else
37  nghost = 2;
38  #endif
39 
40  #elif RECONSTRUCTION == LINEAR_MULTID
41 
42  nghost = 2;
43 
44  #elif RECONSTRUCTION == PARABOLIC
45 
46  #if PHYSICS == HD || PHYSICS == RHD
47  nghost = 4; /* -- since HD makes use of contact steepener -- */
48  #else
49  nghost = 3;
50  #endif
51 
52  #elif RECONSTRUCTION == WENO3_FD || RECONSTRUCTION == LIMO3_FD
53 
54  nghost = 2;
55 
56  #elif RECONSTRUCTION == WENOZ_FD || \
57  RECONSTRUCTION == MP5_FD
58 
59  nghost = 3;
60 
61  #endif
62 
63  #if SHOCK_FLATTENING == ONED
64 
65  nghost = MAX(4, nghost);
66 
67  #elif SHOCK_FLATTENING == MULTID
68 
69 /* ------------------------------------------------------
70  The MULTID shock flattening only need 2 ghost zones.
71  However for axisymmetric simulations with CTU
72  3 zones will ensure that flag[][][] will remain
73  symmetric around the axis.
74  ------------------------------------------------------ */
75 
76  nghost = MAX(3, nghost);
77  #endif
78 
79 /* ----------------------------------------------------
80  The following should operate on the static grid
81  version of the code. Add an extra row of boundary
82  zones if CTU+CT is selected.
83  At least 3 ghost zones.
84  ---------------------------------------------------- */
85 
86  #ifdef CTU
87  #ifdef STAGGERED_MHD
88  nghost++;
89  #endif
90  #endif
91 
92 /* ----------------------------------------
93  FARGO PPM needs at least 3 ghost zones
94  ---------------------------------------- */
95 
96  #ifdef FARGO
97  #if FARGO_ORDER == 3
98  nghost = MAX(3,nghost);
99  #endif
100  #endif
101 
102  #if (defined CH_SPACEDIM) && (TIME_STEPPING == RK_MIDPOINT)
103  nghost++; /* AMR + RK_MIDPOINT */
104  #endif
105 
106  return (nghost);
107 }
#define MAX(a, b)
Definition: macros.h:101
void Limiter(double *, double *, double *, int, int, Grid *)
Definition: pluto.h:490
#define NVAR
Definition: pluto.h:609

Here is the caller graph for this function: