当前位置: 首页>>代码示例>>C++>>正文


C++ FlowField::getFGH方法代码示例

本文整理汇总了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;
        }
    } 
}
开发者ID:muyan93,项目名称:Euler-EOF,代码行数:30,代码来源:VelocityStencil.cpp

示例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));
}
开发者ID:cqql,项目名称:turbulence,代码行数:10,代码来源:RHSStencil.cpp

示例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;
    }*/
}
开发者ID:akk635,项目名称:turbulent_HPC,代码行数:7,代码来源:MovingWallStencils.cpp

示例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];
}
开发者ID:EvaBr,项目名称:CFD-Lab,代码行数:3,代码来源:MovingWallStencils.cpp

示例5: applyFrontWall

void MovingWallFGHStencil::applyFrontWall ( FlowField & flowField, int i, int j, int k ){
    flowField.getFGH().getVector(i, j, k)[2] = _parameters.walls.vectorFront[2];
}
开发者ID:EvaBr,项目名称:CFD-Lab,代码行数:3,代码来源:MovingWallStencils.cpp

示例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];
}
开发者ID:EvaBr,项目名称:CFD-Lab,代码行数:3,代码来源:MovingWallStencils.cpp

示例7: applyBottomWall

void MovingWallFGHStencil::applyBottomWall ( FlowField & flowField, int i, int j, int k ){
    flowField.getFGH().getVector(i, j, k)[1] = _parameters.walls.vectorBottom[1];
}
开发者ID:EvaBr,项目名称:CFD-Lab,代码行数:3,代码来源:MovingWallStencils.cpp

示例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];
}
开发者ID:EvaBr,项目名称:CFD-Lab,代码行数:3,代码来源:MovingWallStencils.cpp

示例9: applyLeftWall

void MovingWallFGHStencil::applyLeftWall ( FlowField & flowField, int i, int j ){
    flowField.getFGH().getVector(i, j)[0] = _parameters.walls.vectorLeft[0];
}
开发者ID:EvaBr,项目名称:CFD-Lab,代码行数:3,代码来源:MovingWallStencils.cpp

示例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);
}
开发者ID:ascodt-users,项目名称:ascodt-nightly,代码行数:4,代码来源:BFInputStencils.cpp


注:本文中的FlowField::getFGH方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。