本文整理汇总了C++中GridFunction::getGridFunction方法的典型用法代码示例。如果您正苦于以下问题:C++ GridFunction::getGridFunction方法的具体用法?C++ GridFunction::getGridFunction怎么用?C++ GridFunction::getGridFunction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GridFunction
的用法示例。
在下文中一共展示了GridFunction::getGridFunction方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ComputeHeatfunction
void Computation::ComputeHeatfunction(GridFunction& h, GridFunction& t, GridFunction& u, RealType deltaT) {
for (int i = 0; i <= h.griddimension[0]-2; i++){
for (int j = 1; j <= h.griddimension[1]-2; j++){
h.getGridFunction()[i][j] = h.getGridFunction()[i][j-1]
+ deltaT * (SimIO.para.re * SimIO.para.Pr * u.getGridFunction()[i][j]
* (t.getGridFunction()[i+1][j] + t.getGridFunction()[i][j])/2.0
- (t.getGridFunction()[i+1][j] - t.getGridFunction()[i][j])/ SimIO.para.deltaX);
}
}
}
示例2: SORCycle_White
//one cycle of the solver, starts with (1,1)
void Solver::SORCycle_White(GridFunction& p, GridFunction& rhs) {
for (int i = 1; i<=SimIO.para.iMax;i++){
for(int j=1+i%2; j<=SimIO.para.jMax;j+=2){
p.getGridFunction()[i][j] =(1-SimIO.para.omg)*p.getGridFunction()[i][j] +
(SimIO.para.omg)/(2.0*(1.0/(SimIO.para.deltaX*SimIO.para.deltaX) + 1.0/(SimIO.para.deltaY*SimIO.para.deltaY)))*
((p.getGridFunction()[i+1][j]+p.getGridFunction()[i-1][j])/(SimIO.para.deltaX*SimIO.para.deltaX) +
(p.getGridFunction()[i][j+1]+p.getGridFunction()[i][j-1])/(SimIO.para.deltaY*SimIO.para.deltaY)
- rhs.getGridFunction()[i][j]);
}
}
}