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


C++ FlowField类代码示例

本文整理汇总了C++中FlowField的典型用法代码示例。如果您正苦于以下问题:C++ FlowField类的具体用法?C++ FlowField怎么用?C++ FlowField使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了FlowField类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

void VelocityBufferReadStencil::applyBackWall   (FlowField & flowField, int i, int j, int k){
    const int index = 3 * (i + (flowField.getNx()+3) * j);
    flowField.getVelocity().getVector(i, j, flowField.getNz()+2)[0] = _backBufferIn[ index ];
    flowField.getVelocity().getVector(i, j, flowField.getNz()+2)[1] = _backBufferIn[index+1];
    flowField.getVelocity().getVector(i, j, flowField.getNz()+2)[2] = _backBufferIn[index+2];
}
开发者ID:EvaBr,项目名称:CFD-Lab,代码行数:6,代码来源:BufferStencils.cpp

示例2: applyFrontWall

void VelocityBufferFillStencil::applyFrontWall  (FlowField & flowField, int i, int j, int k){
    const int index = 3 * (i + (flowField.getNx()+3) * j);
    _frontBufferOut[ index ] = flowField.getVelocity().getVector(i, j, 2)[0];
    _frontBufferOut[index+1] = flowField.getVelocity().getVector(i, j, 2)[1];
    _frontBufferOut[index+2] = flowField.getVelocity().getVector(i, j, 2)[2];
}
开发者ID:EvaBr,项目名称:CFD-Lab,代码行数:6,代码来源:BufferStencils.cpp

示例3: applyLeftWall

void VelocityBufferReadStencil::applyLeftWall (FlowField & flowField, int i, int j){
    flowField.getVelocity().getVector(0, j)[0] = _leftBufferIn[ 2*j ];
    flowField.getVelocity().getVector(1, j)[1] = _leftBufferIn[2*j+1];
}
开发者ID:EvaBr,项目名称:CFD-Lab,代码行数:4,代码来源:BufferStencils.cpp

示例4: applyRightWall

void VelocityBufferFillStencil::applyRightWall  (FlowField & flowField, int i, int j, int k){
    const int index = 3 * (j + (flowField.getNy()+3) * k);
    _rightBufferOut[ index ] = flowField.getVelocity().getVector(flowField.getNx(),   j, k)[0];
    _rightBufferOut[index+1] = flowField.getVelocity().getVector(flowField.getNx()+1, j, k)[1];
    _rightBufferOut[index+2] = flowField.getVelocity().getVector(flowField.getNx()+1, j, k)[2];
}
开发者ID:EvaBr,项目名称:CFD-Lab,代码行数:6,代码来源:BufferStencils.cpp

示例5: applyBottomWall

void PressureBufferReadStencil::applyBottomWall (FlowField & flowField, int i, int j, int k){
    const int index = i + (flowField.getNx()+3) * k;
    flowField.getPressure().getScalar(i, 1, k) = _bottomBufferIn[index];
}
开发者ID:EvaBr,项目名称:CFD-Lab,代码行数:4,代码来源:BufferStencils.cpp

示例6: applyTopWall

void VelocityBufferFillStencil::applyTopWall (FlowField & flowField, int i, int j){
    _topBufferOut[ 2*i ] = flowField.getVelocity().getVector(i, flowField.getNy()+1)[0];
    _topBufferOut[2*i+1] = flowField.getVelocity().getVector(i, flowField.getNy()  )[1];
}
开发者ID:EvaBr,项目名称:CFD-Lab,代码行数:4,代码来源:BufferStencils.cpp

示例7: apply

void VelocityStencil::apply ( FlowField & flowField, int i, int j, int k ){

    const FLOAT dt = _parameters.timestep.dt;
    const int obstacle = flowField.getFlags().getValue(i, j, k);
    VectorField & velocity = flowField.getVelocity();

    if ((obstacle & OBSTACLE_SELF) == 0) {
        if ((obstacle & OBSTACLE_RIGHT) == 0) {
            const FLOAT dx = 0.5*(_parameters.meshsize->getDx(i,j,k)+_parameters.meshsize->getDx(i+1,j,k));
            velocity.getVector(i,j,k)[0] = flowField.getFGH().getVector(i,j,k)[0] - dt/dx *
                (flowField.getPressure().getScalar(i+1,j,k) - flowField.getPressure().getScalar(i,j,k));
        } else {
            velocity.getVector(i, j, k)[0] = 0.0;
        }
        if ((obstacle & OBSTACLE_TOP) == 0) {
            const FLOAT dy = 0.5*(_parameters.meshsize->getDy(i,j,k)+_parameters.meshsize->getDy(i,j+1,k));
            velocity.getVector(i,j,k)[1] = flowField.getFGH().getVector(i,j,k)[1] - dt/dy *
                (flowField.getPressure().getScalar(i,j+1,k) - flowField.getPressure().getScalar(i,j,k));
        } else {
            velocity.getVector(i, j, k)[1] = 0.0;
        }
        if ((obstacle & OBSTACLE_BACK) == 0) {
            const FLOAT dz = 0.5*(_parameters.meshsize->getDz(i,j,k)+_parameters.meshsize->getDz(i,j,k+1));
            velocity.getVector(i,j,k)[2] = flowField.getFGH().getVector(i,j,k)[2] - dt/dz *
                (flowField.getPressure().getScalar(i,j,k+1) - flowField.getPressure().getScalar(i,j,k));
        } else {
            velocity.getVector(i, j, k)[2] = 0.0;
        }
    }
}
开发者ID:muyan93,项目名称:Euler-EOF,代码行数:30,代码来源:VelocityStencil.cpp


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