本文整理汇总了C++中FlowField::getDim方法的典型用法代码示例。如果您正苦于以下问题:C++ FlowField::getDim方法的具体用法?C++ FlowField::getDim怎么用?C++ FlowField::getDim使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FlowField
的用法示例。
在下文中一共展示了FlowField::getDim方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
PetscParallelManager::PetscParallelManager(FlowField & flowField, const Parameters & parameters):
ParallelManager<FlowField> (flowField, parameters),
_fillVelocityStencil(parameters, _leftBufferOut, _rightBufferOut, _bottomBufferOut,
_topBufferOut, _frontBufferOut, _backBufferOut),
_readVelocityStencil(parameters, _leftBufferIn, _rightBufferIn, _bottomBufferIn,
_topBufferIn, _frontBufferIn, _backBufferIn),
_fillPressureStencil(parameters, _leftBufferOut, _rightBufferOut, _bottomBufferOut,
_topBufferOut, _frontBufferOut, _backBufferOut),
_readPressureStencil(parameters, _leftBufferIn, _rightBufferIn, _bottomBufferIn,
_topBufferIn, _frontBufferIn, _backBufferIn),
_fillVelocityIterator(_flowField, parameters, _fillVelocityStencil, 1, 0),
_readVelocityIterator(_flowField, parameters, _readVelocityStencil, 1, 0),
_fillPressureIterator(_flowField, parameters, _fillPressureStencil, 1, 0),
_readPressureIterator(_flowField, parameters, _readPressureStencil, 1, 0)
{
// Allocate buffers and set number of pressure values
if (flowField.getDim() == 2){
_bufferSize[0] = 2 * (flowField.getNy() + 3); // Allocate space for all values
_bufferSize[1] = 2 * (flowField.getNx() + 3);
_pressureSize[0] = (flowField.getNy() + 3);
_pressureSize[1] = (flowField.getNx() + 3);
_leftBufferIn = new FLOAT[_bufferSize[0]];
_leftBufferOut = new FLOAT[_bufferSize[0]];
_rightBufferIn = new FLOAT[_bufferSize[0]];
_rightBufferOut = new FLOAT[_bufferSize[0]];
_bottomBufferIn = new FLOAT[_bufferSize[1]];
_bottomBufferOut = new FLOAT[_bufferSize[1]];
_topBufferIn = new FLOAT[_bufferSize[1]];
_topBufferOut = new FLOAT[_bufferSize[1]];
} else if (flowField.getDim() == 3) {
_bufferSize[0] = 3 * ((flowField.getNy()+3) * (flowField.getNz()+3));
_bufferSize[1] = 3 * ((flowField.getNx()+3) * (flowField.getNz()+3));
_bufferSize[2] = 3 * ((flowField.getNx()+3) * (flowField.getNy()+3));
_pressureSize[0] = (flowField.getNy()+3) * (flowField.getNz()+3);
_pressureSize[1] = (flowField.getNx()+3) * (flowField.getNz()+3);
_pressureSize[2] = (flowField.getNx()+3) * (flowField.getNy()+3);
_leftBufferIn = new FLOAT[_bufferSize[0]];
_leftBufferOut = new FLOAT[_bufferSize[0]];
_rightBufferIn = new FLOAT[_bufferSize[0]];
_rightBufferOut = new FLOAT[_bufferSize[0]];
_bottomBufferIn = new FLOAT[_bufferSize[1]];
_bottomBufferOut = new FLOAT[_bufferSize[1]];
_topBufferIn = new FLOAT[_bufferSize[1]];
_topBufferOut = new FLOAT[_bufferSize[1]];
_frontBufferIn = new FLOAT[_bufferSize[2]];
_frontBufferOut = new FLOAT[_bufferSize[2]];
_backBufferIn = new FLOAT[_bufferSize[2]];
_backBufferOut = new FLOAT[_bufferSize[2]];
}
}