示例#1
0
void MblkGeometry::setSShellMetrics(
   const hier::Box& domain,
   const int level_number)
{
   int b = domain.getBlockId().getBlockValue();
   //
   // Set dx (drad, dth, dphi) for the level
   //
   d_dx.resize(level_number + 1);
   d_dx[level_number].resize(d_nblocks);
   d_dx[level_number][b].resize(d_dim.getValue());

   double nrad = (domain.upper(0) - domain.lower(0) + 1);
   double nth = (domain.upper(1) - domain.lower(1) + 1);
   double nphi = 0;
   if (d_dim == tbox::Dimension(3)) {
      nphi = (domain.upper(2) - domain.lower(2) + 1);
   }

   /*
    * If its a solid shell, its a single block and dx = dr, dth, dphi
    */
   if (d_sshell_type == "SOLID") {

      d_dx[level_number][b][0] = (d_sshell_rmax - d_sshell_rmin) / nrad;
      d_dx[level_number][b][1] =
         2.0 * tbox::MathUtilities<double>::Abs(d_sangle_thmin) / nth;
      if (d_dim == tbox::Dimension(3)) {
         d_dx[level_number][b][2] =
            2.0 * tbox::MathUtilities<double>::Abs(d_sangle_thmin) / nphi;
      }
   } else {
      d_dx[level_number][b][0] = 0.0001;
      d_dx[level_number][b][1] = 0.0001;
      if (d_dim == tbox::Dimension(3)) {
         d_dx[level_number][b][2] = 0.0001;
      }
   }

   /*
    * If its an OCTANT shell, then everything is set in the
    * computeUnitSphereOctant() method so all we do here is allocate
    * space for d_dx.
    */
   d_metrics_set[level_number][0] = true;
}
示例#2
0
void MblkGeometry::setWedgeMetrics(
   const hier::Box& domain,
   const int level_number)
{
   int b = domain.getBlockId().getBlockValue();
   //
   // Set dx (dr, dth, dz) for the level
   //
   d_dx.resize(level_number + 1);
   d_dx[level_number].resize(d_nblocks);
   d_dx[level_number][b].resize(d_dim.getValue());

   double nr = (domain.upper(0) - domain.lower(0) + 1);
   double nth = (domain.upper(1) - domain.lower(1) + 1);
   d_dx[level_number][b][0] = (d_wedge_rmax[0] - d_wedge_rmin[0]) / nr;
   d_dx[level_number][b][1] = (d_wedge_thmax - d_wedge_thmin) / nth;

   if (d_dim == tbox::Dimension(3)) {
      double nz = (domain.upper(2) - domain.lower(2) + 1);
      d_dx[level_number][b][2] = (d_wedge_zmax - d_wedge_zmin) / nz;
   }

   d_metrics_set[level_number][b] = true;
}