本文整理汇总了C++中shards::CellTopology::getBaseKey方法的典型用法代码示例。如果您正苦于以下问题:C++ CellTopology::getBaseKey方法的具体用法?C++ CellTopology::getBaseKey怎么用?C++ CellTopology::getBaseKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shards::CellTopology
的用法示例。
在下文中一共展示了CellTopology::getBaseKey方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getLatticeSize
inline
ordinal_type
PointTools::
getLatticeSize( const shards::CellTopology cellType,
const ordinal_type order,
const ordinal_type offset ) {
#ifdef HAVE_INTREPID2_DEBUG
INTREPID2_TEST_FOR_EXCEPTION( order < 0 || offset < 0,
std::invalid_argument ,
">>> ERROR (PointTools::getLatticeSize): order and offset must be positive values." );
#endif
ordinal_type r_val = 0;
switch (cellType.getBaseKey()) {
case shards::Tetrahedron<>::key: {
const auto effectiveOrder = order - 4 * offset;
r_val = (effectiveOrder < 0 ? 0 :(effectiveOrder+1)*(effectiveOrder+2)*(effectiveOrder+3)/6);
break;
}
case shards::Triangle<>::key: {
const auto effectiveOrder = order - 3 * offset;
r_val = (effectiveOrder < 0 ? 0 : (effectiveOrder+1)*(effectiveOrder+2)/2);
break;
}
case shards::Line<>::key: {
const auto effectiveOrder = order - 2 * offset;
r_val = (effectiveOrder < 0 ? 0 : (effectiveOrder+1));
break;
}
default: {
INTREPID2_TEST_FOR_EXCEPTION( true , std::invalid_argument ,
">>> ERROR (Intrepid2::PointTools::getLatticeSize): the specified cell type is not supported." );
}
}
return r_val;
}
示例2: getWarpBlendLattice
void PointTools::
getWarpBlendLattice( /**/ Kokkos::DynRankView<pointValueType,pointProperties...> points,
const shards::CellTopology cell,
const ordinal_type order,
const ordinal_type offset ) {
switch (cell.getBaseKey()) {
// case shards::Tetrahedron<>::key: getWarpBlendLatticeTetrahedron( points, order, offset ); break;
// case shards::Triangle<>::key: getWarpBlendLatticeTriangle ( points, order, offset ); break;
case shards::Line<>::key: getWarpBlendLatticeLine ( points, order, offset ); break;
default: {
INTREPID2_TEST_FOR_EXCEPTION( true , std::invalid_argument ,
">>> ERROR (Intrepid2::PointTools::getWarpBlendLattice): the specified cell type is not supported." );
}
}
}