本文整理汇总了C++中ArrayScalar::rank方法的典型用法代码示例。如果您正苦于以下问题:C++ ArrayScalar::rank方法的具体用法?C++ ArrayScalar::rank怎么用?C++ ArrayScalar::rank使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArrayScalar
的用法示例。
在下文中一共展示了ArrayScalar::rank方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cell
void Basis_HGRAD_QUAD_C2_FEM<Scalar, ArrayScalar>::getDofCoords(ArrayScalar & DofCoords) const {
#ifdef HAVE_INTREPID2_DEBUG
// Verify rank of output array.
TEUCHOS_TEST_FOR_EXCEPTION( !(DofCoords.rank() == 2), std::invalid_argument,
">>> ERROR: (Intrepid2::Basis_HGRAD_QUAD_C2_FEM::getDofCoords) rank = 2 required for DofCoords array");
// Verify 0th dimension of output array.
TEUCHOS_TEST_FOR_EXCEPTION( !( static_cast<index_type>(DofCoords.dimension(0)) == static_cast<index_type>(this -> basisCardinality_) ), std::invalid_argument,
">>> ERROR: (Intrepid2::Basis_HGRAD_QUAD_C2_FEM::getDofCoords) mismatch in number of DoF and 0th dimension of DofCoords array");
// Verify 1st dimension of output array.
TEUCHOS_TEST_FOR_EXCEPTION( !( static_cast<index_type>(DofCoords.dimension(1)) == static_cast<index_type>(this -> basisCellTopology_.getDimension()) ), std::invalid_argument,
">>> ERROR: (Intrepid2::Basis_HGRAD_QUAD_C2_FEM::getDofCoords) incorrect reference cell (1st) dimension in DofCoords array");
#endif
DofCoords(0,0) = -1.0; DofCoords(0,1) = -1.0;
DofCoords(1,0) = 1.0; DofCoords(1,1) = -1.0;
DofCoords(2,0) = 1.0; DofCoords(2,1) = 1.0;
DofCoords(3,0) = -1.0; DofCoords(3,1) = 1.0;
DofCoords(4,0) = 0.0; DofCoords(4,1) = -1.0;
DofCoords(5,0) = 1.0; DofCoords(5,1) = 0.0;
DofCoords(6,0) = 0.0; DofCoords(6,1) = 1.0;
DofCoords(7,0) = -1.0; DofCoords(7,1) = 0.0;
DofCoords(8,0) = 0.0; DofCoords(8,1) = 0.0;
}
示例2: cell
void Basis_HVOL_TRI_C0_FEM<Scalar, ArrayScalar>::getDofCoords(ArrayScalar & DofCoords) const {
#ifdef HAVE_INTREPID_DEBUG
// Verify rank of output array.
TEUCHOS_TEST_FOR_EXCEPTION( !(DofCoords.rank() == 2), std::invalid_argument,
">>> ERROR: (Intrepid::Basis_HVOL_TRI_C0_FEM::getDofCoords) rank = 2 required for DofCoords array");
// Verify 0th dimension of output array.
TEUCHOS_TEST_FOR_EXCEPTION( !( DofCoords.dimension(0) == this -> basisCardinality_ ), std::invalid_argument,
">>> ERROR: (Intrepid::Basis_HVOL_TRI_C0_FEM::getDofCoords) mismatch in number of DoF and 0th dimension of DofCoords array");
// Verify 1st dimension of output array.
TEUCHOS_TEST_FOR_EXCEPTION( !( DofCoords.dimension(1) == (int)(this -> basisCellTopology_.getDimension()) ), std::invalid_argument,
">>> ERROR: (Intrepid::Basis_HVOL_TRI_C0_FEM::getDofCoords) incorrect reference cell (1st) dimension in DofCoords array");
DofCoords(0,0) = 0.0; DofCoords(0,1) = 0.0;
#endif
}