本文整理汇总了C++中BasisCachePtr::getSideNormalsSpaceTime方法的典型用法代码示例。如果您正苦于以下问题:C++ BasisCachePtr::getSideNormalsSpaceTime方法的具体用法?C++ BasisCachePtr::getSideNormalsSpaceTime怎么用?C++ BasisCachePtr::getSideNormalsSpaceTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BasisCachePtr
的用法示例。
在下文中一共展示了BasisCachePtr::getSideNormalsSpaceTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: values
void UnitNormalFunction::values(Intrepid::FieldContainer<double> &values, BasisCachePtr basisCache)
{
this->CHECK_VALUES_RANK(values);
int numCells = values.dimension(0);
int numPoints = values.dimension(1);
int spaceDim = basisCache->getSpaceDim();
if (_comp == -1)
{
// check the the "D" dimension of values is correct:
if (_spaceTime)
{
TEUCHOS_TEST_FOR_EXCEPTION(values.dimension(2) != spaceDim+1, std::invalid_argument, "For space-time normals, values.dimension(2) should be spaceDim + 1.");
}
else
{
TEUCHOS_TEST_FOR_EXCEPTION(values.dimension(2) != spaceDim, std::invalid_argument, "For spatial normals, values.dimension(2) should be spaceDim.");
}
}
const Intrepid::FieldContainer<double> *sideNormals = _spaceTime ? &(basisCache->getSideNormalsSpaceTime()) : &(basisCache->getSideNormals());
int comp = _comp;
if (comp == -2)
{
// want to select the temporal component, t()
comp = spaceDim;
}
for (int cellIndex=0; cellIndex<numCells; cellIndex++)
{
for (int ptIndex=0; ptIndex<numPoints; ptIndex++)
{
if (comp == -1)
{
for (int d=0; d<spaceDim; d++)
{
double nd = (*sideNormals)(cellIndex,ptIndex,d);
values(cellIndex,ptIndex,d) = nd;
}
if (_spaceTime)
{
double nd = (*sideNormals)(cellIndex,ptIndex,spaceDim);
values(cellIndex,ptIndex,spaceDim) = nd;
}
}
else
{
double ni = (*sideNormals)(cellIndex,ptIndex,comp);
values(cellIndex,ptIndex) = ni;
}
}
}
}