Skip to content

Commit

Permalink
assume full sphere symmetry in SPHERICAL with 1 dimension and Compone…
Browse files Browse the repository at this point in the history
…nts>1

assume full sphere symmetry when SPHERICAL coordinates with 1 dimension (#291)

fix #290
  • Loading branch information
glesur authored Nov 26, 2024
1 parent f83e560 commit 9143e77
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions src/gridHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,25 @@ void GridHost::MakeGrid(Input &input) {
// dir >= DIMENSIONS/ Init simple uniform grid
for(int i = 0 ; i < np_tot[dir] ; i++) {
// Initialize to default values
xstart[dir] = -0.5;
xend[dir] = 0.5;

#if GEOMETRY != SPHERICAL
xstart[dir] = -0.5;
xend[dir] = 0.5;
#elif GEOMETRY == SPHERICAL
if(dir == JDIR) {
xstart[dir] = 0;
xend[dir] = M_PI;
}
if(dir == KDIR) {
xstart[dir] = -0.5;
xend[dir] = 0.5;
}
#endif
this->xbeg[dir] = xstart[dir];
this->xend[dir] = xend[dir];
dx[dir](i) = 1.0;
x[dir](i)=0.0;
xl[dir](i)=-0.5;
xr[dir](i)=0.5;
dx[dir](i) = xend[dir] - xstart[dir];
x[dir](i)=0.5*(xstart[dir]+xend[dir]);
xl[dir](i)=xstart[dir];
xr[dir](i)=xend[dir];
}
}
}
Expand Down

0 comments on commit 9143e77

Please sign in to comment.