本文整理汇总了C++中hier::Box::getBlockId方法的典型用法代码示例。如果您正苦于以下问题:C++ Box::getBlockId方法的具体用法?C++ Box::getBlockId怎么用?C++ Box::getBlockId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hier::Box
的用法示例。
在下文中一共展示了Box::getBlockId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setSShellMetrics
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: setWedgeMetrics
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;
}