src/Boundary/CylindricalBoundary.cc
//------------------------------------------------------------------------------
// Compute the target azimuthal angular spacing.
//------------------------------------------------------------------------------
Compute the target azimuthal angular spacing.
Compute the target azimuthal angular spacing .
double
CylindricalBoundary::
angularSpacing(const double ri,
               const double hzi,
               const double nodesPerh,
               const double kernelExtent) {
  REQUIRE(ri >= 0.0);
  REQUIRE(hzi >= 0.0);
  REQUIRE(nodesPerh > 0.0);
  REQUIRE(kernelExtent > 0.0);
  const double rmin = kernelExtent*hzi/(0.125*M_PI);
  CONTRACT_VAR(rmin);
  CHECK(rmin > 0.0);
  const double reff = ri; 
  const double delta = hzi/nodesPerh;
  double dphi = 2.0*atan2(delta, 2.0*reff);
  CHECK(dphi > 0.0);
  int twoi = max(2, int(2.0*M_PI/dphi));
  if (twoi % 2 != 0) ++twoi;
  CHECK(twoi % 2 == 0);
  const double result = 2.0*M_PI/(twoi + 1);
  ENSURE(result > 0.0);
  return result;
}
double CylindricalBoundary :: angularSpacing ( const double ri , const double hzi , const double nodesPerh , const double kernelExtent ) { REQUIRE ( ri >= 0.0 ) ; REQUIRE ( hzi >= 0.0 ) ; REQUIRE ( nodesPerh > 0.0 ) ; REQUIRE ( kernelExtent > 0.0 ) ; const double rmin = kernelExtent * hzi / ( 0.125 * M_PI ) ; CONTRACT_VAR ( rmin ) ; CHECK ( rmin > 0.0 ) ; const double reff = ri ; const double delta = hzi / nodesPerh ; double dphi = 2.0 * atan2 ( delta , 2.0 * reff ) ; CHECK ( dphi > 0.0 ) ; int twoi = max ( 2 , int ( 2.0 * M_PI / dphi ) ) ; if ( twoi % 2 != 0 ) ++ twoi ; CHECK ( twoi % 2 == 0 ) ; const double result = 2.0 * M_PI / ( twoi + 1 ) ; ENSURE ( result > 0.0 ) ; return result ; }
Compute the target azimuthal angular spacing.
Compute the target azimuthal angular spacing .
// Choose a minimum effective radius such based on whether we see more than // 1/4*Pi around the circumference of the ring. // max(rmin, ri); // Compute the nominal spacing. // Now find the closest value of dphi that will give us an integer + 1/2 // number of steps in Pi.