本文整理汇总了C++中FlowField::getFGH方法的典型用法代码示例。如果您正苦于以下问题:C++ FlowField::getFGH方法的具体用法?C++ FlowField::getFGH怎么用?C++ FlowField::getFGH使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FlowField
的用法示例。
在下文中一共展示了FlowField::getFGH方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: apply
void VelocityStencil::apply ( FlowField & flowField, int i, int j ){
const FLOAT dt = _parameters.timestep.dt;
const int obstacle = flowField.getFlags().getValue(i, j);
VectorField & velocity = flowField.getVelocity();
if ((obstacle & OBSTACLE_SELF) == 0){ // If this is a fluid cell
if ((obstacle & OBSTACLE_RIGHT) == 0){ // Check whether the neighbor is also fluid
// we require a spatial finite difference expression for the pressure gradient, evaluated
// at the location of the u-component. We therefore compute the distance of neighbouring
// pressure values (dx) and use this as sort-of central difference expression. This will
// yield second-order accuracy for uniform meshsizes.
const FLOAT dx = 0.5*(_parameters.meshsize->getDx(i,j)+_parameters.meshsize->getDx(i+1,j));
velocity.getVector(i,j)[0] = flowField.getFGH().getVector(i,j)[0] - dt/dx *
(flowField.getPressure().getScalar(i+1,j) - flowField.getPressure().getScalar(i,j));
} else { // Otherwise, set to zero
velocity.getVector(i,j)[0] = 0;
} // Note that we only set one direction per cell. The neighbor at the left is
// responsible for the other side
if ((obstacle & OBSTACLE_TOP) == 0){
const FLOAT dy = 0.5*(_parameters.meshsize->getDy(i,j)+_parameters.meshsize->getDy(i,j+1));
velocity.getVector(i,j)[1] = flowField.getFGH().getVector(i,j)[1] - dt/dy *
(flowField.getPressure().getScalar(i,j+1) - flowField.getPressure().getScalar(i,j));
} else {
velocity.getVector(i,j)[1] = 0;
}
}
}
示例2: apply
void RHSStencil::apply(FlowField& flowField, int i, int j) {
flowField.getRHS().getScalar(i, j) =
1.0 / _parameters.timestep.dt *
((flowField.getFGH().getVector(i, j)[0] -
flowField.getFGH().getVector(i - 1, j)[0]) /
_parameters.meshsize->getDx(i, j) +
(flowField.getFGH().getVector(i, j)[1] -
flowField.getFGH().getVector(i, j - 1)[1]) /
_parameters.meshsize->getDy(i, j));
}
示例3: applyRightWall
void MovingWallFGHStencil::applyRightWall ( FlowField & flowField, int i, int j , int k ){
flowField.getFGH().getVector(i-1, j, k)[0] = _parameters.walls.vectorRight[0];
/* if ( (i == 22) && ( j == 10 ) && ( k == 10 )){
std::cout<<"atleast here FGh "<< flowField.getVelocity().getVector(i-1, j, k)[0]<<std::endl;
}*/
}
示例4: applyBackWall
void MovingWallFGHStencil::applyBackWall ( FlowField & flowField, int i, int j, int k ){
flowField.getFGH().getVector(i, j, k-1)[2] = _parameters.walls.vectorBack[2];
}
示例5: applyFrontWall
void MovingWallFGHStencil::applyFrontWall ( FlowField & flowField, int i, int j, int k ){
flowField.getFGH().getVector(i, j, k)[2] = _parameters.walls.vectorFront[2];
}
示例6: applyTopWall
void MovingWallFGHStencil::applyTopWall ( FlowField & flowField, int i, int j, int k ){
flowField.getFGH().getVector(i, j-1, k)[1] = _parameters.walls.vectorTop[1];
}
示例7: applyBottomWall
void MovingWallFGHStencil::applyBottomWall ( FlowField & flowField, int i, int j, int k ){
flowField.getFGH().getVector(i, j, k)[1] = _parameters.walls.vectorBottom[1];
}
示例8: applyRightWall
void MovingWallFGHStencil::applyRightWall ( FlowField & flowField, int i, int j , int k ){
flowField.getFGH().getVector(i-1, j, k)[0] = _parameters.walls.vectorRight[0];
}
示例9: applyLeftWall
void MovingWallFGHStencil::applyLeftWall ( FlowField & flowField, int i, int j ){
flowField.getFGH().getVector(i, j)[0] = _parameters.walls.vectorLeft[0];
}
示例10: applyLeftWall
void BFInputFGHStencil::applyLeftWall ( FlowField & flowField, int i, int j, int k ){
flowField.getFGH().getVector(i,j,k)[0] =
computeVelocity3D (flowField, i, j, k, _stepSize, _parameters);
}