本文整理汇总了C++中FlowField::getViscosity方法的典型用法代码示例。如果您正苦于以下问题:C++ FlowField::getViscosity方法的具体用法?C++ FlowField::getViscosity怎么用?C++ FlowField::getViscosity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FlowField
的用法示例。
在下文中一共展示了FlowField::getViscosity方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: applyBottomWall
void ViscosityBufferReadStencil::applyBottomWall(FlowField & flowField, int i,
int j, int k) {
if( _parameters.parallel.bottomNb >= 0){
// With normal lowoffset = 1 and highoffset = -1
if ((i >= 2) & (k >= 2)) {
(flowField.getViscosity().getScalar(i, j, k)) =
bottomViscosityReadBuffer[(i - 2) * localSize[2] + (k - 2)];
}
}
}
示例2: applyBackWall
void ViscosityBufferReadStencil::applyBackWall(FlowField & flowField, int i,
int j, int k) {
if( _parameters.parallel.backNb >= 0){
// lowoffset = 1 ands highoffset = -1
if ((i >= 2) & (j >= 2)) {
(flowField.getViscosity().getScalar(i, j, k + 1)) =
backViscosityReadBuffer[(i - 2) * localSize[1] + (j - 2)];
}
}
}
示例3: applyFrontWall
void ViscosityBufferReadStencil::applyFrontWall(FlowField & flowField, int i,
int j, int k) {
if( _parameters.parallel.frontNb >= 0){
// Remains the same with the lowoffset = 1 and highoffset = -1
if ((i >= 2) & (j >= 2)) {
(flowField.getViscosity().getScalar(i, j, k)) =
frontViscosityReadBuffer[(i - 2) * localSize[1] + (j - 2)];
}
}
}
示例4: applyRightWall
void ViscosityBufferReadStencil::applyRightWall(FlowField & flowField, int i,
int j, int k) {
if( _parameters.parallel.rightNb >= 0){
// First internal layer of the sub-domain
// Iterate with lowoffset = 1, and highoffset = -1
if ((j >= 2) & (k >= 2)) {
(flowField.getViscosity().getScalar(i + 1, j, k)) =
rightViscosityReadBuffer[(j - 2) + (k - 2) * localSize[1]];
}
}
}
示例5: applyLeftWall
void ViscosityBufferReadStencil::applyLeftWall(FlowField & flowField, int i,
int j, int k) {
if( _parameters.parallel.leftNb >= 0){
// With lowoffset = 1 and highoffset = -1 since (i-1) array
if ((j >= 2) & (k >= 2)) {
(flowField.getViscosity().getScalar(i, j, k)) = leftViscosityReadBuffer[(j
- 2) + (k - 2) * localSize[1]];
}
}
}
示例6: apply
void MaxViscosityStencil::apply (FlowField & flowField, int i, int j, int k){
if (flowField.getViscosity().getScalar(i,j,k) > _maxViscosity){
_maxViscosity = flowField.getViscosity().getScalar(i,j,k);
}
}
示例7: applyTopWall
void ViscosityBufferFillStencil::applyTopWall ( FlowField & flowField, int i, int j) {
topViscosityFillBuffer[i] = flowField.getViscosity().getScalar(i,j-1);
}
示例8: applyRightWall
void ViscosityBufferFillStencil::applyRightWall ( FlowField & flowField, int i, int j) {
rightViscosityFillBuffer[j] = flowField.getViscosity().getScalar(i-1,j);
}
示例9: applyBottomWall
void ViscosityBufferFillStencil::applyBottomWall ( FlowField & flowField, int i, int j) {
bottomViscosityFillBuffer[i] = flowField.getViscosity().getScalar(i,j+2);
}
示例10: applyBackWall
void ViscosityBufferFillStencil::applyBackWall ( FlowField & flowField, int i, int j, int k) {
/* _lowOffset = 2; _highOffset = -1;
* from ParallelBoundaryIterater: i = _lowOffset ; j = _lowOffset ; k = Iterator<FlowField>::_flowField.getCellsZ()+_highOffset-1 ;
*/
backViscosityFillBuffer[(j)+(localSize[1]+3)*(i)] = flowField.getViscosity().getScalar(i,j,k-1);
}
示例11: applyLeftWall
/*2D
*/
void ViscosityBufferFillStencil::applyLeftWall ( FlowField & flowField, int i, int j) {
leftViscosityFillBuffer[j] = flowField.getViscosity().getScalar(i+2,j);
}
示例12: applyFrontWall
void ViscosityBufferFillStencil::applyFrontWall ( FlowField & flowField, int i, int j, int k) {
/* _lowOffset = 2; _highOffset = -1;
* from ParallelBoundaryIterater: i = _lowOffset ; j = _lowOffset ; k = _lowOffset;
*/
frontViscosityFillBuffer[(j)+(localSize[1]+3)*(i)] = flowField.getViscosity().getScalar(i,j,k+2);
}
示例13: main
//.........这里部分代码省略.........
MPI_Comm_size(PETSC_COMM_WORLD, &nproc);
MPI_Comm_rank(PETSC_COMM_WORLD, &rank);
std::cout << "Rank: " << rank << ", Nproc: " << nproc << std::endl;
//----------------------------------------------------
// read configuration and store information in parameters object
Configuration configuration(argv[1]);
Parameters parameters;
configuration.loadParameters(parameters);
PetscParallelConfiguration parallelConfiguration(parameters);
MeshsizeFactory::getInstance().initMeshsize(parameters);
FlowField *flowField = NULL;
Simulation *simulation = NULL;
#ifdef DEBUG
std::cout << "Processor " << parameters.parallel.rank << " with index ";
std::cout << parameters.parallel.indices[0] << ",";
std::cout << parameters.parallel.indices[1] << ",";
std::cout << parameters.parallel.indices[2];
std::cout << " is computing the size of its subdomain and obtains ";
std::cout << parameters.parallel.localSize[0] << ", ";
std::cout << parameters.parallel.localSize[1] << " and ";
std::cout << parameters.parallel.localSize[2];
std::cout << ". Left neighbour: " << parameters.parallel.leftNb;
std::cout << ", right neighbour: " << parameters.parallel.rightNb;
std::cout << std::endl;
std::cout << "Min. meshsizes: " << parameters.meshsize->getDxMin() << ", " << parameters.meshsize->getDyMin() << ", " << parameters.meshsize->getDzMin() << std::endl;
#endif
// initialise simulation
if (parameters.simulation.type=="turbulence"){
// TODO WS2: initialise turbulent flow field and turbulent simulation object
if(rank==0){ std::cout << "Start DNS turbulence simulation in " << parameters.geometry.dim << "D" << std::endl; }
flowField = new FlowField(parameters);
if(flowField == NULL){ handleError(1, "flowField==NULL!"); }
simulation = new Simulation(parameters,*flowField);
handleError(1,"Turbulence currently not supported yet!");
} else if (parameters.simulation.type=="dns"){
if(rank==0){ std::cout << "Start DNS simulation in " << parameters.geometry.dim << "D" << std::endl; }
flowField = new FlowField(parameters);
if(flowField == NULL){ handleError(1, "flowField==NULL!"); }
simulation = new Simulation(parameters,*flowField);
} else {
handleError(1, "Unknown simulation type! Currently supported: dns, turbulence");
}
// call initialization of simulation (initialize flow field)
if(simulation == NULL){ handleError(1, "simulation==NULL!"); }
simulation->initializeFlowField();
// flowField->getFlags().show();
// flowField->getNearWallDis().show();
// std::cout<<flowField->getNx()<<std::endl;
// std::cout<<parameters.geometry.lengthX<<std::endl;
// return 0;
FLOAT time = 0.0;
FLOAT timeStdOut=parameters.stdOut.interval;
FLOAT VTKtime=0.0;
int timeSteps = 0;
// TODO WS1: plot initial state
simulation->plotVTK(timeSteps);
// time loop
while (time < parameters.simulation.finalTime){
simulation->solveTimestep();
time += parameters.timestep.dt;
// std-out: terminal info
if ( (rank==0) && (timeStdOut <= time) ){
std::cout << "Current time: " << time << "\ttimestep: " <<
parameters.timestep.dt << std::endl;
timeStdOut += parameters.stdOut.interval;
}
timeSteps++;
// TODO WS1: trigger VTK output
if(VTKtime <= time){
simulation->plotVTK(timeSteps);
VTKtime += parameters.vtk.interval;
}
}
// TODO WS1: plot final output
simulation->plotVTK(timeSteps);
flowField->getViscosity().show();
delete simulation; simulation=NULL;
delete flowField; flowField= NULL;
PetscFinalize();
}