本文整理汇总了C++中GridField类的典型用法代码示例。如果您正苦于以下问题:C++ GridField类的具体用法?C++ GridField怎么用?C++ GridField使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GridField类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: calcDy
double UpwindDiff::calcDy(GridField<double> &g, const int i, const int j, const int k)
{
if((*_w)(i, j, k).y > 0.0)
return (g(i, j, k) - g(i, j-1, k))/g.dx();
else
return (g(i, j+1, k) - g(i, j, k))/g.dx();
}
示例2: calcDz
double UpwindDiff::calcDz(GridField<double> &g, const int i, const int j, const int k)
{
if((*_w)(i, j, k).z > 0.0)
return (g(i, j, k) - g(i, j, k-1))/g.dx();
else
return (g(i, j, k+1) - g(i, j, k))/g.dx();
}
示例3: calcDx
Vector3 UpwindDiff::calcDx(GridField<Vector3> &g, const int i, const int j, const int k)
{
if((*_w)(i, j, k).x > 0.0)
return (g(i, j, k) - g(i-1, j, k))/g.dx();
else
return (g(i+1, j, k) - g(i, j, k))/g.dx();
}
示例4: calcDxy
double CentralDiff::calcDxy(GridField<double> &g, const int i, const int j, const int k)
{
/*CellType c_t = LevelSet::getCellType(g(i,j,k));
return ( g(i+1,j+1,k,c_t) - g(i+1,j-1,k,c_t) + g(i-1,j-1,k,c_t) - g(i-1,j+1,k,c_t) ) / (4.0*g.dx()*g.dx());*/
/*double asd4 = g(i-1,j+1,k);
double asd3 = g(i-1,j-1,k);
double asd2 = g(i+1,j-1,k);
double asd1 = g(i+1,j+1,k);
*/
return ( g(i+1,j+1,k) - g(i+1,j-1,k) + g(i-1,j-1,k) - g(i-1,j+1,k) ) / (4.0*g.dx()*g.dx());
}
示例5:
GridField<T>::GridField(const GridField<T> &g):GridMapping(g),_extrapolation(nullptr),_interpolation(nullptr),_extrapolate(true){
int count = g.cellCount();
_data = new T[count];
//Iterera över g
for (GridFieldIterator<T> iter = g.iterator(); !iter.done(); iter.next()) {
setValueAtIndex(iter.value(), iter.index());
}
//Interpolation
//Extra/Interpolation
setInterpolation(g._interpolation);
setExtrapolation(g._extrapolation);
}
示例6: calcDyz
Vector3 CentralDiff::calcDyz(GridField<Vector3> &g, const int i, const int j, const int k)
{
return ( g(i,j+1,k+1) - g(i,j+1,k-1) + g(i,j-1,k-1) - g(i,j-1,k+1) ) / (4.0*g.dx()*g.dx());
}
示例7: calcDxz
double CentralDiff::calcDxz(GridField<double> &g, const int i, const int j, const int k)
{
return ( g(i+1,j,k+1) - g(i+1,j,k-1) + g(i-1,j,k-1) - g(i-1,j,k+1) ) / (4.0*g.dx()*g.dx());
}
示例8: g
double CentralDiff::calcD2z(GridField<double> &g, const int i, const int j, const int k)
{
return ( g(i,j,k+1) - 2.0*g(i,j,k) + g(i,j,k-1))/( g.dx()*g.dx() /* deltaZ^2 */ );
}
示例9: calcDzp
double CentralDiff::calcDzp(GridField<double> &g, const int i, const int j, const int k)
{
throw;
//EJ DEFINIERAD I CENTRAL
return (double)(g(i, j, k + 1) - g(i, j, k))/(g.dx());
}