HARM
harm and utilities
 All Data Structures Files Functions Variables Typedefs Macros Pages
Macros | Functions
global.gridsectioning.h File Reference

Definitions and macros for grid sectioning. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SHIFTX1DN   (0)
 no sectioning – zero corrections More...
 
#define SHIFTX1UP   (0)
 
#define SHIFTX2DN   (0)
 
#define SHIFTX2UP   (0)
 
#define SHIFTX3DN   (0)
 
#define SHIFTX3UP   (0)
 
#define WITHINACTIVESECTION(ri, rj, rk)   (ri >=0 && ri<=N1-1 && rj>=0 && rj<=N2-1 && rk>=0 && rk<=N3-1 )
 Below WITHINACTIVESECTION() applies to only active computed cells not including their used boundary cells. More...
 
#define WITHINACTIVESECTIONEXPAND1(ri, rj, rk)   (ri >=-SHIFT1 && ri<=N1-1+SHIFT1 && rj>=-SHIFT2 && rj<=N2-1+SHIFT2 && rk>=-SHIFT3 && rk<=N3-1+SHIFT3 )
 Below WITHINACTIVESECTIONEXPAND1() applies to only active computed cells with +-1 boundary cells. Used, e.g., for setting timestep since often don't want to set timestep in same region flux is computed since just happens that needed p_l and p_r for CT method where fluxes end up not used. More...
 
#define LOOPWITHINACTIVESECTIONEXPAND1(ri, rj, rk)   GENLOOP(ri,rj,rk,-SHIFT1,N1-1+SHIFT1,-SHIFT2,N2-1+SHIFT2,-SHIFT3,N3-1+SHIFT3)
 
#define WITHINACTIVESECTIONEXPAND1IS   (-SHIFT1)
 
#define WITHINACTIVESECTIONEXPAND1IE   (N1-1+SHIFT1)
 
#define WITHINACTIVESECTIONEXPAND1JS   (-SHIFT2)
 
#define WITHINACTIVESECTIONEXPAND1JE   (N2-1+SHIFT2)
 
#define WITHINACTIVESECTIONEXPAND1KS   (-SHIFT3)
 
#define WITHINACTIVESECTIONEXPAND1KE   (N3-1+SHIFT3)
 
#define WITHINACTIVEWITHBNDSECTION(ri, rj, rk)   (ri >=-N1BND && ri<=N1-1+N1BND && rj>=-N2BND && rj<=N2-1+N2BND && rk>=-N3BND && rk<=N3-1+N3BND )
 Below WITHINACTIVEWITHBNDSECTION() applies to active computed cells including their used boundary cells. More...
 
#define WITHINACTIVESTAGWITHBNDSECTIONX1(ri, rj, rk)   (ri >=-N1BND && ri<=N1-1+N1BND && rj>=-N2BND && rj<=N2-1+N2BND && rk>=-N3BND && rk<=N3-1+N3BND )
 Below WITHINACTIVEWITHBNDSECTION() applies to active computed cells including their used boundary cells. More...
 
#define WITHINACTIVESTAGWITHBNDSECTIONX2(ri, rj, rk)   (ri >=-N1BND && ri<=N1-1+N1BND && rj>=-N2BND && rj<=N2-1+N2BND && rk>=-N3BND && rk<=N3-1+N3BND )
 
#define WITHINACTIVESTAGWITHBNDSECTIONX3(ri, rj, rk)   (ri >=-N1BND && ri<=N1-1+N1BND && rj>=-N2BND && rj<=N2-1+N2BND && rk>=-N3BND && rk<=N3-1+N3BND )
 
#define WITHINACTIVEBNDSECTION(ri, rj, rk)
 Below WITHINACTIVEBNDSECTION() applies to only the boundary cells of active computed cells Applies to centered quantities. More...
 
#define WITHINACTIVESTAGBNDSECTION(ri, rj, rk)
 Below WITHINACTIVEBNDSECTION() applies to only the boundary cells of active computed cells Applies to staggered quantities (e.g. More...
 
#define WITHINACTIVEBNDSECTIONX1DN(ri, rj, rk)
 Below WITHINACTIVEBNDSECTION() applies to only the boundary cells of active computed cells Applies to centered quantities. More...
 
#define WITHINACTIVEBNDSECTIONX1UP(ri, rj, rk)
 
#define WITHINACTIVEBNDSECTIONX2DN(ri, rj, rk)
 
#define WITHINACTIVEBNDSECTIONX2UP(ri, rj, rk)
 
#define WITHINACTIVEBNDSECTIONX3DN(ri, rj, rk)
 
#define WITHINACTIVEBNDSECTIONX3UP(ri, rj, rk)
 
#define WITHINACTIVESTAGBNDSECTIONX1DN(ri, rj, rk)
 Below WITHINACTIVESTAGBNDSECTION() applies to only the boundary cells of active computed cells Applies to staggered quantities (e.g. More...
 
#define WITHINACTIVESTAGBNDSECTIONX1UP(ri, rj, rk)
 
#define WITHINACTIVESTAGBNDSECTIONX2DN(ri, rj, rk)
 
#define WITHINACTIVESTAGBNDSECTIONX2UP(ri, rj, rk)
 
#define WITHINACTIVESTAGBNDSECTIONX3DN(ri, rj, rk)
 
#define WITHINACTIVESTAGBNDSECTIONX3UP(ri, rj, rk)
 

Functions

int findindexfromradius (FTYPE xr, int *xcpupos1, int *xi)
 
int compute_numcompzones (int(*sectiondef)[NDIM], long long int *localnumcompzones)
 

Detailed Description

Definitions and macros for grid sectioning.

Sasha related enerregion's to grid sectioning, e.g. NUMENERREGIONS See initbase.gridsectioning.c for comments There is no user/problem-dependent code here

Definition in file global.gridsectioning.h.

Macro Definition Documentation

#define LOOPWITHINACTIVESECTIONEXPAND1 (   ri,
  rj,
  rk 
)    GENLOOP(ri,rj,rk,-SHIFT1,N1-1+SHIFT1,-SHIFT2,N2-1+SHIFT2,-SHIFT3,N3-1+SHIFT3)

Definition at line 65 of file global.gridsectioning.h.

#define SHIFTX1DN   (0)

no sectioning – zero corrections

Definition at line 26 of file global.gridsectioning.h.

#define SHIFTX1UP   (0)

Definition at line 27 of file global.gridsectioning.h.

#define SHIFTX2DN   (0)

Definition at line 28 of file global.gridsectioning.h.

#define SHIFTX2UP   (0)

Definition at line 29 of file global.gridsectioning.h.

#define SHIFTX3DN   (0)

Definition at line 30 of file global.gridsectioning.h.

#define SHIFTX3UP   (0)

Definition at line 31 of file global.gridsectioning.h.

#define WITHINACTIVEBNDSECTION (   ri,
  rj,
  rk 
)
Value:
( \
(((ri >= -N1BND && ri < 0) || (ri <= N1-1+N1BND && ri > N1-1)) && (rj >= -N2BND && rj <= N2-1+N2BND && rk >= -N3BND && rk <= N3-1+N3BND)) \
|| (((rj >= -N2BND && rj < 0) || (rj <= N2-1+N2BND && rj > N2-1)) && (ri >= -N1BND && ri <= N1-1+N1BND && rk >= -N3BND && rk <= N3-1+N3BND)) \
|| (((rk >= -N3BND && rk < 0) || (rk <= N3-1+N3BND && rk > N3-1)) && (rj >= -N2BND && rj <= N2-1+N2BND && ri >= -N1BND && ri <= N1-1+N1BND)) \
)

Below WITHINACTIVEBNDSECTION() applies to only the boundary cells of active computed cells Applies to centered quantities.

Definition at line 116 of file global.gridsectioning.h.

#define WITHINACTIVEBNDSECTIONX1DN (   ri,
  rj,
  rk 
)
Value:
( \
(((ri >= -N1BND && ri < 0) ) && (rj >= -N2BND && rj <= N2-1+N2BND && rk >= -N3BND && rk <= N3-1+N3BND)) \
)

Below WITHINACTIVEBNDSECTION() applies to only the boundary cells of active computed cells Applies to centered quantities.

Definition at line 171 of file global.gridsectioning.h.

#define WITHINACTIVEBNDSECTIONX1UP (   ri,
  rj,
  rk 
)
Value:
( \
(((ri <= N1-1+N1BND && ri > N1-1)) && (rj >= -N2BND && rj <= N2-1+N2BND && rk >= -N3BND && rk <= N3-1+N3BND)) \
)

Definition at line 174 of file global.gridsectioning.h.

#define WITHINACTIVEBNDSECTIONX2DN (   ri,
  rj,
  rk 
)
Value:
( \
(((rj >= -N2BND && rj < 0) ) && (ri >= -N1BND && ri <= N1-1+N1BND && rk >= -N3BND && rk <= N3-1+N3BND)) \
)

Definition at line 177 of file global.gridsectioning.h.

#define WITHINACTIVEBNDSECTIONX2UP (   ri,
  rj,
  rk 
)
Value:
( \
(((rj <= N2-1+N2BND && rj > N2-1)) && (ri >= -N1BND && ri <= N1-1+N1BND && rk >= -N3BND && rk <= N3-1+N3BND)) \
)

Definition at line 180 of file global.gridsectioning.h.

#define WITHINACTIVEBNDSECTIONX3DN (   ri,
  rj,
  rk 
)
Value:
( \
(((rk >= -N3BND && rk < 0) ) && (rj >= -N2BND && rj <= N2-1+N2BND && ri >= -N1BND && ri <= N1-1+N1BND)) \
)

Definition at line 183 of file global.gridsectioning.h.

#define WITHINACTIVEBNDSECTIONX3UP (   ri,
  rj,
  rk 
)
Value:
( \
(((rk <= N3-1+N3BND && rk > N3-1)) && (rj >= -N2BND && rj <= N2-1+N2BND && ri >= -N1BND && ri <= N1-1+N1BND)) \
)

Definition at line 186 of file global.gridsectioning.h.

#define WITHINACTIVESECTION (   ri,
  rj,
  rk 
)    (ri >=0 && ri<=N1-1 && rj>=0 && rj<=N2-1 && rk>=0 && rk<=N3-1 )

Below WITHINACTIVESECTION() applies to only active computed cells not including their used boundary cells.

Definition at line 42 of file global.gridsectioning.h.

#define WITHINACTIVESECTIONEXPAND1 (   ri,
  rj,
  rk 
)    (ri >=-SHIFT1 && ri<=N1-1+SHIFT1 && rj>=-SHIFT2 && rj<=N2-1+SHIFT2 && rk>=-SHIFT3 && rk<=N3-1+SHIFT3 )

Below WITHINACTIVESECTIONEXPAND1() applies to only active computed cells with +-1 boundary cells. Used, e.g., for setting timestep since often don't want to set timestep in same region flux is computed since just happens that needed p_l and p_r for CT method where fluxes end up not used.

Definition at line 64 of file global.gridsectioning.h.

#define WITHINACTIVESECTIONEXPAND1IE   (N1-1+SHIFT1)

Definition at line 68 of file global.gridsectioning.h.

#define WITHINACTIVESECTIONEXPAND1IS   (-SHIFT1)

Definition at line 67 of file global.gridsectioning.h.

#define WITHINACTIVESECTIONEXPAND1JE   (N2-1+SHIFT2)

Definition at line 70 of file global.gridsectioning.h.

#define WITHINACTIVESECTIONEXPAND1JS   (-SHIFT2)

Definition at line 69 of file global.gridsectioning.h.

#define WITHINACTIVESECTIONEXPAND1KE   (N3-1+SHIFT3)

Definition at line 72 of file global.gridsectioning.h.

#define WITHINACTIVESECTIONEXPAND1KS   (-SHIFT3)

Definition at line 71 of file global.gridsectioning.h.

#define WITHINACTIVESTAGBNDSECTION (   ri,
  rj,
  rk 
)
Value:
( \
(((ri >= -N1BND && ri <= 0) || (ri <= N1-1+N1BND && ri > N1-1)) && (rj >= -N2BND && rj <= N2-1+N2BND && rk >= -N3BND && rk <= N3-1+N3BND)) \
|| (((rj >= -N2BND && rj <= 0) || (rj <= N2-1+N2BND && rj > N2-1)) && (ri >= -N1BND && ri <= N1-1+N1BND && rk >= -N3BND && rk <= N3-1+N3BND)) \
|| (((rk >= -N3BND && rk <= 0) || (rk <= N3-1+N3BND && rk > N3-1)) && (rj >= -N2BND && rj <= N2-1+N2BND && ri >= -N1BND && ri <= N1-1+N1BND)) \
)

Below WITHINACTIVEBNDSECTION() applies to only the boundary cells of active computed cells Applies to staggered quantities (e.g.

i=0 is boundary cell for fixed BCs)

Definition at line 132 of file global.gridsectioning.h.

#define WITHINACTIVESTAGBNDSECTIONX1DN (   ri,
  rj,
  rk 
)
Value:
( \
(((ri >= -N1BND && ri <= 0) ) && (rj >= -N2BND && rj <= N2-1+N2BND && rk >= -N3BND && rk <= N3-1+N3BND)) \
)

Below WITHINACTIVESTAGBNDSECTION() applies to only the boundary cells of active computed cells Applies to staggered quantities (e.g.

i=0 is boundary cell for fixed BCs)

Definition at line 217 of file global.gridsectioning.h.

#define WITHINACTIVESTAGBNDSECTIONX1UP (   ri,
  rj,
  rk 
)
Value:
( \
(((ri <= N1-1+N1BND && ri > N1-1)) && (rj >= -N2BND && rj <= N2-1+N2BND && rk >= -N3BND && rk <= N3-1+N3BND)) \
)

Definition at line 220 of file global.gridsectioning.h.

#define WITHINACTIVESTAGBNDSECTIONX2DN (   ri,
  rj,
  rk 
)
Value:
( \
(((rj >= -N2BND && rj <= 0) ) && (ri >= -N1BND && ri <= N1-1+N1BND && rk >= -N3BND && rk <= N3-1+N3BND)) \
)

Definition at line 223 of file global.gridsectioning.h.

#define WITHINACTIVESTAGBNDSECTIONX2UP (   ri,
  rj,
  rk 
)
Value:
( \
(((rj <= N2-1+N2BND && rj > N2-1)) && (ri >= -N1BND && ri <= N1-1+N1BND && rk >= -N3BND && rk <= N3-1+N3BND)) \
)

Definition at line 226 of file global.gridsectioning.h.

#define WITHINACTIVESTAGBNDSECTIONX3DN (   ri,
  rj,
  rk 
)
Value:
( \
(((rk >= -N3BND && rk <= 0) ) && (rj >= -N2BND && rj <= N2-1+N2BND && ri >= -N1BND && ri <= N1-1+N1BND)) \
)

Definition at line 229 of file global.gridsectioning.h.

#define WITHINACTIVESTAGBNDSECTIONX3UP (   ri,
  rj,
  rk 
)
Value:
( \
(((rk <= N3-1+N3BND && rk > N3-1)) && (rj >= -N2BND && rj <= N2-1+N2BND && ri >= -N1BND && ri <= N1-1+N1BND)) \
)

Definition at line 232 of file global.gridsectioning.h.

#define WITHINACTIVESTAGWITHBNDSECTIONX1 (   ri,
  rj,
  rk 
)    (ri >=-N1BND && ri<=N1-1+N1BND && rj>=-N2BND && rj<=N2-1+N2BND && rk>=-N3BND && rk<=N3-1+N3BND )

Below WITHINACTIVEWITHBNDSECTION() applies to active computed cells including their used boundary cells.

all same

Definition at line 100 of file global.gridsectioning.h.

#define WITHINACTIVESTAGWITHBNDSECTIONX2 (   ri,
  rj,
  rk 
)    (ri >=-N1BND && ri<=N1-1+N1BND && rj>=-N2BND && rj<=N2-1+N2BND && rk>=-N3BND && rk<=N3-1+N3BND )

Definition at line 101 of file global.gridsectioning.h.

#define WITHINACTIVESTAGWITHBNDSECTIONX3 (   ri,
  rj,
  rk 
)    (ri >=-N1BND && ri<=N1-1+N1BND && rj>=-N2BND && rj<=N2-1+N2BND && rk>=-N3BND && rk<=N3-1+N3BND )

Definition at line 102 of file global.gridsectioning.h.

#define WITHINACTIVEWITHBNDSECTION (   ri,
  rj,
  rk 
)    (ri >=-N1BND && ri<=N1-1+N1BND && rj>=-N2BND && rj<=N2-1+N2BND && rk>=-N3BND && rk<=N3-1+N3BND )

Below WITHINACTIVEWITHBNDSECTION() applies to active computed cells including their used boundary cells.

Definition at line 83 of file global.gridsectioning.h.

Function Documentation

int compute_numcompzones ( int(*)  sectiondef[NDIM],
long long int *  localnumcompzones 
)

Definition at line 499 of file initbase.gridsectioning.c.

int findindexfromradius ( FTYPE  xr,
int *  xcpupos1,
int *  xi 
)
Returns
0 on success Somewhat user-dependent since in general might want to find an arbitrary grid index from an arbitrary physical position Notes: 1) BCtype could change in time, so don't assume fixed – ok so far

Definition at line 260 of file initbase.gridsectioning.c.

Here is the call graph for this function: