本文整理汇总了C++中scalarField::ubound方法的典型用法代码示例。如果您正苦于以下问题:C++ scalarField::ubound方法的具体用法?C++ scalarField::ubound怎么用?C++ scalarField::ubound使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scalarField
的用法示例。
在下文中一共展示了scalarField::ubound方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: applyBCs
void applyBCs(scalarField& P) const
{
// Apply the Neumann boundary condition that grad(P) dot surface = 0
int xN = P.ubound(firstDim);
int yN = P.ubound(secondDim);
int zN = P.ubound(thirdDim);
Range all = Range::all();
// lower x
P(0,all,all) = P(2,all,all);
P(1,all,all) = P(2,all,all);
// upper x
P(xN,all,all) = P(xN-2,all,all);
P(xN-1,all,all) = P(xN-2,all,all);
// lower y
P(all,0,all) = P(all,2,all);
P(all,1,all) = P(all,2,all);
// upper y
P(all,yN,all) = P(all,yN-2,all);
P(all,yN-1,all) = P(all,yN-2,all);
// lower z
P(all,all,0) = P(all,all,2) - 2*gravityPressureGradient_;
P(all,all,1) = P(all,all,2) - gravityPressureGradient_;
// upper z
P(all,all,zN) = P(all,all,zN-2) + 2*gravityPressureGradient_;
P(all,all,zN-1) = P(all,all,zN-2) + gravityPressureGradient_;
}