📄 stream.c
字号:
//##############################################################################//// stream.c//void stream( lattice_ptr lattice){ pdf_ptr pdf; double *f; int *nn; int n, a;#if SAY_HI printf("stream() -- Hi!\n");#endif /* SAY_HI */ // Get pointer to pdf. pdf = lattice->pdf; // Get pointer to distribution functions. f = pdf->f; // Get pointer to neighbors. nn = lattice->node->nn; // Traverse nodes. for( n=0; n<lattice->NumNodes; n++) { // Copy the rest particle f[0] to ftemp[0]. *(f+9) = *f++; for( a=1; a<=8; a++) { // S T R E A M // // - f[a] streams to ftemp[a] of its neighboring node. // if( *nn != INACTIVE_NODE) { pdf[ *nn].ftemp[a] = *f;//printf("STREAM: %d from %d to %d.\n", a, n, *nn); } /* if( *nn != INACTIVE_NODE) */ else {//printf("STREAM: Skipping %d at %d.\n", a, n); } // Move nn to neighbor of next element of f. nn++; // Move next element of f. f++; } /* for( a=1; a<=8; a++) */ // Advance nn to neighbor of first element of next node. nn+=3; // Advance to the next node. f+=18; } /* for( n=0; n<NumNodes; n++) */#if SAY_HI printf("stream() -- Bye!\n");#endif /* SAY_HI */} /* void stream( lattice_ptr lattice) */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -