20 #undef _MINIMUM_GHOSTS_ 25 #define _MINIMUM_GHOSTS_ 3 124 double *ww1LF, *ww2LF, *ww3LF, *ww1RF, *ww2RF, *ww3RF;
125 double *ww1LU, *ww2LU, *ww3LU, *ww1RU, *ww2RU, *ww3RU;
127 int ghosts = solver->
ghosts;
128 int ndims = solver->
ndims;
129 int nvars = solver->
nvars;
134 static const double thirteen_by_twelve = 13.0/12.0;
135 static const double one_fourth = 1.0/4.0;
138 int offset = weno->
offset[dir];
142 int indexC[ndims], indexI[ndims], index_outer[ndims], bounds_outer[ndims], bounds_inter[ndims];
143 _ArrayCopy1D_(dim,bounds_outer,ndims); bounds_outer[dir] = 1;
144 _ArrayCopy1D_(dim,bounds_inter,ndims); bounds_inter[dir] += 1;
147 ww1LF = weno->
w1 + offset;
148 ww2LF = weno->
w2 + offset;
149 ww3LF = weno->
w3 + offset;
150 ww1RF = weno->
w1 + 2*weno->
size + offset;
151 ww2RF = weno->
w2 + 2*weno->
size + offset;
152 ww3RF = weno->
w3 + 2*weno->
size + offset;
153 ww1LU = weno->
w1 + weno->
size + offset;
154 ww2LU = weno->
w2 + weno->
size + offset;
155 ww3LU = weno->
w3 + weno->
size + offset;
156 ww1RU = weno->
w1 + 2*weno->
size + weno->
size + offset;
157 ww2RU = weno->
w2 + 2*weno->
size + weno->
size + offset;
158 ww3RU = weno->
w3 + 2*weno->
size + weno->
size + offset;
159 #pragma omp parallel for schedule(auto) default(shared) private(i,index_outer,indexC,indexI) 160 for (i=0; i<N_outer; i++) {
164 for (indexI[dir] = 0; indexI[dir] < dim[dir]+1; indexI[dir]++) {
165 int qm1L,qm2L,qm3L,qp1L,qp2L,p,qm1R,qm2R,qm3R,qp1R,qp2R;
167 indexC[dir] = indexI[dir]-1;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm1L);
168 qm3L = qm1L - 2*stride[dir];
169 qm2L = qm1L - stride[dir];
170 qp1L = qm1L + stride[dir];
171 qp2L = qm1L + 2*stride[dir];
173 indexC[dir] = indexI[dir] ;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm1R);
174 qm3R = qm1R + 2*stride[dir];
175 qm2R = qm1R + stride[dir];
176 qp1R = qm1R - stride[dir];
177 qp2R = qm1R - 2*stride[dir];
180 double *m3LF, *m2LF, *m1LF, *p1LF, *p2LF;
181 m3LF = (fC+qm3L*nvars);
182 m2LF = (fC+qm2L*nvars);
183 m1LF = (fC+qm1L*nvars);
184 p1LF = (fC+qp1L*nvars);
185 p2LF = (fC+qp2L*nvars);
186 double *m3RF, *m2RF, *m1RF, *p1RF, *p2RF;
187 m3RF = (fC+qm3R*nvars);
188 m2RF = (fC+qm2R*nvars);
189 m1RF = (fC+qm1R*nvars);
190 p1RF = (fC+qp1R*nvars);
191 p2RF = (fC+qp2R*nvars);
192 double *m3LU, *m2LU, *m1LU, *p1LU, *p2LU;
193 m3LU = (uC+qm3L*nvars);
194 m2LU = (uC+qm2L*nvars);
195 m1LU = (uC+qm1L*nvars);
196 p1LU = (uC+qp1L*nvars);
197 p2LU = (uC+qp2L*nvars);
198 double *m3RU, *m2RU, *m1RU, *p1RU, *p2RU;
199 m3RU = (uC+qm3R*nvars);
200 m2RU = (uC+qm2R*nvars);
201 m1RU = (uC+qm1R*nvars);
202 p1RU = (uC+qp1R*nvars);
203 p2RU = (uC+qp2R*nvars);
208 if ( ((mpi->ip[dir] == 0 ) && (indexI[dir] == 0 ))
209 || ((mpi->ip[dir] == mpi->iproc[dir]-1) && (indexI[dir] == dim[dir])) ) {
228 _WENOWeights_v_JS_((ww1LF+p*nvars),(ww2LF+p*nvars),(ww3LF+p*nvars),c1,c2,c3,m3LF,m2LF,m1LF,p1LF,p2LF,weno->
eps,nvars);
229 _WENOWeights_v_JS_((ww1RF+p*nvars),(ww2RF+p*nvars),(ww3RF+p*nvars),c1,c2,c3,m3RF,m2RF,m1RF,p1RF,p2RF,weno->
eps,nvars);
230 _WENOWeights_v_JS_((ww1LU+p*nvars),(ww2LU+p*nvars),(ww3LU+p*nvars),c1,c2,c3,m3LU,m2LU,m1LU,p1LU,p2LU,weno->
eps,nvars);
231 _WENOWeights_v_JS_((ww1RU+p*nvars),(ww2RU+p*nvars),(ww3RU+p*nvars),c1,c2,c3,m3RU,m2RU,m1RU,p1RU,p2RU,weno->
eps,nvars);
278 double *ww1LF, *ww2LF, *ww3LF, *ww1RF, *ww2RF, *ww3RF;
279 double *ww1LU, *ww2LU, *ww3LU, *ww1RU, *ww2RU, *ww3RU;
281 int ghosts = solver->
ghosts;
282 int ndims = solver->
ndims;
283 int nvars = solver->
nvars;
288 static const double thirteen_by_twelve = 13.0/12.0;
289 static const double one_fourth = 1.0/4.0;
292 int offset = weno->
offset[dir];
296 int indexC[ndims], indexI[ndims], index_outer[ndims], bounds_outer[ndims], bounds_inter[ndims];
297 _ArrayCopy1D_(dim,bounds_outer,ndims); bounds_outer[dir] = 1;
298 _ArrayCopy1D_(dim,bounds_inter,ndims); bounds_inter[dir] += 1;
301 ww1LF = weno->
w1 + offset;
302 ww2LF = weno->
w2 + offset;
303 ww3LF = weno->
w3 + offset;
304 ww1RF = weno->
w1 + 2*weno->
size + offset;
305 ww2RF = weno->
w2 + 2*weno->
size + offset;
306 ww3RF = weno->
w3 + 2*weno->
size + offset;
307 ww1LU = weno->
w1 + weno->
size + offset;
308 ww2LU = weno->
w2 + weno->
size + offset;
309 ww3LU = weno->
w3 + weno->
size + offset;
310 ww1RU = weno->
w1 + 2*weno->
size + weno->
size + offset;
311 ww2RU = weno->
w2 + 2*weno->
size + weno->
size + offset;
312 ww3RU = weno->
w3 + 2*weno->
size + weno->
size + offset;
314 #if defined(CPU_STAT) 315 clock_t startTime, endTime;
316 double copyTime = 0.0;
320 #pragma omp parallel for schedule(auto) default(shared) private(i,index_outer,indexC,indexI) 321 for (i=0; i<N_outer; i++) {
325 for (indexI[dir] = 0; indexI[dir] < dim[dir]+1; indexI[dir]++) {
326 int qm1L,qm2L,qm3L,qp1L,qp2L,p,qm1R,qm2R,qm3R,qp1R,qp2R;
328 indexC[dir] = indexI[dir]-1;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm1L);
329 qm3L = qm1L - 2*stride[dir];
330 qm2L = qm1L - stride[dir];
331 qp1L = qm1L + stride[dir];
332 qp2L = qm1L + 2*stride[dir];
334 indexC[dir] = indexI[dir] ;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm1R);
335 qm3R = qm1R + 2*stride[dir];
336 qm2R = qm1R + stride[dir];
337 qp1R = qm1R - stride[dir];
338 qp2R = qm1R - 2*stride[dir];
341 double *m3LF, *m2LF, *m1LF, *p1LF, *p2LF;
342 m3LF = (fC+qm3L*nvars);
343 m2LF = (fC+qm2L*nvars);
344 m1LF = (fC+qm1L*nvars);
345 p1LF = (fC+qp1L*nvars);
346 p2LF = (fC+qp2L*nvars);
347 double *m3RF, *m2RF, *m1RF, *p1RF, *p2RF;
348 m3RF = (fC+qm3R*nvars);
349 m2RF = (fC+qm2R*nvars);
350 m1RF = (fC+qm1R*nvars);
351 p1RF = (fC+qp1R*nvars);
352 p2RF = (fC+qp2R*nvars);
353 double *m3LU, *m2LU, *m1LU, *p1LU, *p2LU;
354 m3LU = (uC+qm3L*nvars);
355 m2LU = (uC+qm2L*nvars);
356 m1LU = (uC+qm1L*nvars);
357 p1LU = (uC+qp1L*nvars);
358 p2LU = (uC+qp2L*nvars);
359 double *m3RU, *m2RU, *m1RU, *p1RU, *p2RU;
360 m3RU = (uC+qm3R*nvars);
361 m2RU = (uC+qm2R*nvars);
362 m1RU = (uC+qm1R*nvars);
363 p1RU = (uC+qp1R*nvars);
364 p2RU = (uC+qp2R*nvars);
369 if ( ((mpi->ip[dir] == 0 ) && (indexI[dir] == 0 ))
370 || ((mpi->ip[dir] == mpi->iproc[dir]-1) && (indexI[dir] == dim[dir])) ) {
389 _WENOWeights_v_M_((ww1LF+p*nvars),(ww2LF+p*nvars),(ww3LF+p*nvars),c1,c2,c3,m3LF,m2LF,m1LF,p1LF,p2LF,weno->
eps,nvars);
390 _WENOWeights_v_M_((ww1RF+p*nvars),(ww2RF+p*nvars),(ww3RF+p*nvars),c1,c2,c3,m3RF,m2RF,m1RF,p1RF,p2RF,weno->
eps,nvars);
391 _WENOWeights_v_M_((ww1LU+p*nvars),(ww2LU+p*nvars),(ww3LU+p*nvars),c1,c2,c3,m3LU,m2LU,m1LU,p1LU,p2LU,weno->
eps,nvars);
392 _WENOWeights_v_M_((ww1RU+p*nvars),(ww2RU+p*nvars),(ww3RU+p*nvars),c1,c2,c3,m3RU,m2RU,m1RU,p1RU,p2RU,weno->
eps,nvars);
396 #if defined(CPU_STAT) 398 printf(
"WENOFifthOrderCalculateWeightsM CPU time = %8.6f dir = %d\n",
399 (
double)(endTime - startTime) / CLOCKS_PER_SEC, dir);
447 double *ww1LF, *ww2LF, *ww3LF, *ww1RF, *ww2RF, *ww3RF;
448 double *ww1LU, *ww2LU, *ww3LU, *ww1RU, *ww2RU, *ww3RU;
450 int ghosts = solver->
ghosts;
451 int ndims = solver->
ndims;
452 int nvars = solver->
nvars;
457 static const double thirteen_by_twelve = 13.0/12.0;
458 static const double one_fourth = 1.0/4.0;
461 int offset = weno->
offset[dir];
465 int indexC[ndims], indexI[ndims], index_outer[ndims], bounds_outer[ndims], bounds_inter[ndims];
466 _ArrayCopy1D_(dim,bounds_outer,ndims); bounds_outer[dir] = 1;
467 _ArrayCopy1D_(dim,bounds_inter,ndims); bounds_inter[dir] += 1;
470 ww1LF = weno->
w1 + offset;
471 ww2LF = weno->
w2 + offset;
472 ww3LF = weno->
w3 + offset;
473 ww1RF = weno->
w1 + 2*weno->
size + offset;
474 ww2RF = weno->
w2 + 2*weno->
size + offset;
475 ww3RF = weno->
w3 + 2*weno->
size + offset;
476 ww1LU = weno->
w1 + weno->
size + offset;
477 ww2LU = weno->
w2 + weno->
size + offset;
478 ww3LU = weno->
w3 + weno->
size + offset;
479 ww1RU = weno->
w1 + 2*weno->
size + weno->
size + offset;
480 ww2RU = weno->
w2 + 2*weno->
size + weno->
size + offset;
481 ww3RU = weno->
w3 + 2*weno->
size + weno->
size + offset;
482 #pragma omp parallel for schedule(auto) default(shared) private(i,index_outer,indexC,indexI) 483 for (i=0; i<N_outer; i++) {
487 for (indexI[dir] = 0; indexI[dir] < dim[dir]+1; indexI[dir]++) {
488 int qm1L,qm2L,qm3L,qp1L,qp2L,p,qm1R,qm2R,qm3R,qp1R,qp2R;
490 indexC[dir] = indexI[dir]-1;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm1L);
491 qm3L = qm1L - 2*stride[dir];
492 qm2L = qm1L - stride[dir];
493 qp1L = qm1L + stride[dir];
494 qp2L = qm1L + 2*stride[dir];
496 indexC[dir] = indexI[dir] ;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm1R);
497 qm3R = qm1R + 2*stride[dir];
498 qm2R = qm1R + stride[dir];
499 qp1R = qm1R - stride[dir];
500 qp2R = qm1R - 2*stride[dir];
503 double *m3LF, *m2LF, *m1LF, *p1LF, *p2LF;
504 m3LF = (fC+qm3L*nvars);
505 m2LF = (fC+qm2L*nvars);
506 m1LF = (fC+qm1L*nvars);
507 p1LF = (fC+qp1L*nvars);
508 p2LF = (fC+qp2L*nvars);
509 double *m3RF, *m2RF, *m1RF, *p1RF, *p2RF;
510 m3RF = (fC+qm3R*nvars);
511 m2RF = (fC+qm2R*nvars);
512 m1RF = (fC+qm1R*nvars);
513 p1RF = (fC+qp1R*nvars);
514 p2RF = (fC+qp2R*nvars);
515 double *m3LU, *m2LU, *m1LU, *p1LU, *p2LU;
516 m3LU = (uC+qm3L*nvars);
517 m2LU = (uC+qm2L*nvars);
518 m1LU = (uC+qm1L*nvars);
519 p1LU = (uC+qp1L*nvars);
520 p2LU = (uC+qp2L*nvars);
521 double *m3RU, *m2RU, *m1RU, *p1RU, *p2RU;
522 m3RU = (uC+qm3R*nvars);
523 m2RU = (uC+qm2R*nvars);
524 m1RU = (uC+qm1R*nvars);
525 p1RU = (uC+qp1R*nvars);
526 p2RU = (uC+qp2R*nvars);
531 if ( ((mpi->ip[dir] == 0 ) && (indexI[dir] == 0 ))
532 || ((mpi->ip[dir] == mpi->iproc[dir]-1) && (indexI[dir] == dim[dir])) ) {
551 _WENOWeights_v_Z_((ww1LF+p*nvars),(ww2LF+p*nvars),(ww3LF+p*nvars),c1,c2,c3,m3LF,m2LF,m1LF,p1LF,p2LF,weno->
eps,nvars);
552 _WENOWeights_v_Z_((ww1RF+p*nvars),(ww2RF+p*nvars),(ww3RF+p*nvars),c1,c2,c3,m3RF,m2RF,m1RF,p1RF,p2RF,weno->
eps,nvars);
553 _WENOWeights_v_Z_((ww1LU+p*nvars),(ww2LU+p*nvars),(ww3LU+p*nvars),c1,c2,c3,m3LU,m2LU,m1LU,p1LU,p2LU,weno->
eps,nvars);
554 _WENOWeights_v_Z_((ww1RU+p*nvars),(ww2RU+p*nvars),(ww3RU+p*nvars),c1,c2,c3,m3RU,m2RU,m1RU,p1RU,p2RU,weno->
eps,nvars);
603 double *ww1LF, *ww2LF, *ww3LF, *ww1RF, *ww2RF, *ww3RF;
604 double *ww1LU, *ww2LU, *ww3LU, *ww1RU, *ww2RU, *ww3RU;
606 int ghosts = solver->
ghosts;
607 int ndims = solver->
ndims;
608 int nvars = solver->
nvars;
613 static const double thirteen_by_twelve = 13.0/12.0;
614 static const double one_fourth = 1.0/4.0;
617 int offset = weno->
offset[dir];
621 int indexC[ndims], indexI[ndims], index_outer[ndims], bounds_outer[ndims], bounds_inter[ndims];
622 _ArrayCopy1D_(dim,bounds_outer,ndims); bounds_outer[dir] = 1;
623 _ArrayCopy1D_(dim,bounds_inter,ndims); bounds_inter[dir] += 1;
626 ww1LF = weno->
w1 + offset;
627 ww2LF = weno->
w2 + offset;
628 ww3LF = weno->
w3 + offset;
629 ww1RF = weno->
w1 + 2*weno->
size + offset;
630 ww2RF = weno->
w2 + 2*weno->
size + offset;
631 ww3RF = weno->
w3 + 2*weno->
size + offset;
632 ww1LU = weno->
w1 + weno->
size + offset;
633 ww2LU = weno->
w2 + weno->
size + offset;
634 ww3LU = weno->
w3 + weno->
size + offset;
635 ww1RU = weno->
w1 + 2*weno->
size + weno->
size + offset;
636 ww2RU = weno->
w2 + 2*weno->
size + weno->
size + offset;
637 ww3RU = weno->
w3 + 2*weno->
size + weno->
size + offset;
639 #if defined(CPU_STAT) 640 clock_t cpu_start, cpu_end;
644 #pragma omp parallel for schedule(auto) default(shared) private(i,index_outer,indexC,indexI) 645 for (i=0; i<N_outer; i++) {
649 for (indexI[dir] = 0; indexI[dir] < dim[dir]+1; indexI[dir]++) {
650 int qm1L,qm2L,qm3L,qp1L,qp2L,p,qm1R,qm2R,qm3R,qp1R,qp2R;
652 indexC[dir] = indexI[dir]-1;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm1L);
653 qm3L = qm1L - 2*stride[dir];
654 qm2L = qm1L - stride[dir];
655 qp1L = qm1L + stride[dir];
656 qp2L = qm1L + 2*stride[dir];
658 indexC[dir] = indexI[dir] ;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm1R);
659 qm3R = qm1R + 2*stride[dir];
660 qm2R = qm1R + stride[dir];
661 qp1R = qm1R - stride[dir];
662 qp2R = qm1R - 2*stride[dir];
665 double *m3LF, *m2LF, *m1LF, *p1LF, *p2LF;
666 m3LF = (fC+qm3L*nvars);
667 m2LF = (fC+qm2L*nvars);
668 m1LF = (fC+qm1L*nvars);
669 p1LF = (fC+qp1L*nvars);
670 p2LF = (fC+qp2L*nvars);
671 double *m3RF, *m2RF, *m1RF, *p1RF, *p2RF;
672 m3RF = (fC+qm3R*nvars);
673 m2RF = (fC+qm2R*nvars);
674 m1RF = (fC+qm1R*nvars);
675 p1RF = (fC+qp1R*nvars);
676 p2RF = (fC+qp2R*nvars);
677 double *m3LU, *m2LU, *m1LU, *p1LU, *p2LU;
678 m3LU = (uC+qm3L*nvars);
679 m2LU = (uC+qm2L*nvars);
680 m1LU = (uC+qm1L*nvars);
681 p1LU = (uC+qp1L*nvars);
682 p2LU = (uC+qp2L*nvars);
683 double *m3RU, *m2RU, *m1RU, *p1RU, *p2RU;
684 m3RU = (uC+qm3R*nvars);
685 m2RU = (uC+qm2R*nvars);
686 m1RU = (uC+qm1R*nvars);
687 p1RU = (uC+qp1R*nvars);
688 p2RU = (uC+qp2R*nvars);
693 if ( ((mpi->ip[dir] == 0 ) && (indexI[dir] == 0 ))
694 || ((mpi->ip[dir] == mpi->iproc[dir]-1) && (indexI[dir] == dim[dir])) ) {
713 _WENOWeights_v_YC_((ww1LF+p*nvars),(ww2LF+p*nvars),(ww3LF+p*nvars),c1,c2,c3,m3LF,m2LF,m1LF,p1LF,p2LF,weno->
eps,nvars);
714 _WENOWeights_v_YC_((ww1RF+p*nvars),(ww2RF+p*nvars),(ww3RF+p*nvars),c1,c2,c3,m3RF,m2RF,m1RF,p1RF,p2RF,weno->
eps,nvars);
715 _WENOWeights_v_YC_((ww1LU+p*nvars),(ww2LU+p*nvars),(ww3LU+p*nvars),c1,c2,c3,m3LU,m2LU,m1LU,p1LU,p2LU,weno->
eps,nvars);
716 _WENOWeights_v_YC_((ww1RU+p*nvars),(ww2RU+p*nvars),(ww3RU+p*nvars),c1,c2,c3,m3RU,m2RU,m1RU,p1RU,p2RU,weno->
eps,nvars);
720 #if defined(CPU_STAT) 722 printf(
"WENOFifthOrderCalculateWeightsYC:\n");
723 printf(
" CPU time = %8.6lf dir = %d\n", (
double)(cpu_end - cpu_start) / CLOCKS_PER_SEC, dir);
773 double *ww1LF, *ww2LF, *ww3LF, *ww1RF, *ww2RF, *ww3RF;
774 double *ww1LU, *ww2LU, *ww3LU, *ww1RU, *ww2RU, *ww3RU;
776 int ghosts = solver->
ghosts;
777 int ndims = solver->
ndims;
778 int nvars = solver->
nvars;
783 static const double thirteen_by_twelve = 13.0/12.0;
784 static const double one_fourth = 1.0/4.0;
787 int offset = weno->
offset[dir];
791 int indexC[ndims], indexI[ndims], index_outer[ndims], bounds_outer[ndims], bounds_inter[ndims];
792 _ArrayCopy1D_(dim,bounds_outer,ndims); bounds_outer[dir] = 1;
793 _ArrayCopy1D_(dim,bounds_inter,ndims); bounds_inter[dir] += 1;
797 double L[nvars*nvars], uavg[nvars];
799 ww1LF = weno->
w1 + offset;
800 ww2LF = weno->
w2 + offset;
801 ww3LF = weno->
w3 + offset;
802 ww1RF = weno->
w1 + 2*weno->
size + offset;
803 ww2RF = weno->
w2 + 2*weno->
size + offset;
804 ww3RF = weno->
w3 + 2*weno->
size + offset;
805 ww1LU = weno->
w1 + weno->
size + offset;
806 ww2LU = weno->
w2 + weno->
size + offset;
807 ww3LU = weno->
w3 + weno->
size + offset;
808 ww1RU = weno->
w1 + 2*weno->
size + weno->
size + offset;
809 ww2RU = weno->
w2 + 2*weno->
size + weno->
size + offset;
810 ww3RU = weno->
w3 + 2*weno->
size + weno->
size + offset;
811 #pragma omp parallel for schedule(auto) default(shared) private(i,index_outer,indexC,indexI) 812 for (i=0; i<N_outer; i++) {
816 for (indexI[dir] = 0; indexI[dir] < dim[dir]+1; indexI[dir]++) {
817 int qm1L,qm2L,qm3L,qp1L,qp2L,p,qm1R,qm2R,qm3R,qp1R,qp2R;
819 indexC[dir] = indexI[dir]-1;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm1L);
820 qm3L = qm1L - 2*stride[dir];
821 qm2L = qm1L - stride[dir];
822 qp1L = qm1L + stride[dir];
823 qp2L = qm1L + 2*stride[dir];
825 indexC[dir] = indexI[dir] ;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm1R);
826 qm3R = qm1R + 2*stride[dir];
827 qm2R = qm1R + stride[dir];
828 qp1R = qm1R - stride[dir];
829 qp2R = qm1R - 2*stride[dir];
836 double m3LF[nvars], m2LF[nvars], m1LF[nvars], p1LF[nvars], p2LF[nvars];
837 double m3RF[nvars], m2RF[nvars], m1RF[nvars], p1RF[nvars], p2RF[nvars];
838 double m3LU[nvars], m2LU[nvars], m1LU[nvars], p1LU[nvars], p2LU[nvars];
839 double m3RU[nvars], m2RU[nvars], m1RU[nvars], p1RU[nvars], p2RU[nvars];
868 if ( ((mpi->ip[dir] == 0 ) && (indexI[dir] == 0 ))
869 || ((mpi->ip[dir] == mpi->iproc[dir]-1) && (indexI[dir] == dim[dir])) ) {
888 _WENOWeights_v_JS_((ww1LF+p*nvars),(ww2LF+p*nvars),(ww3LF+p*nvars),c1,c2,c3,m3LF,m2LF,m1LF,p1LF,p2LF,weno->
eps,nvars);
889 _WENOWeights_v_JS_((ww1RF+p*nvars),(ww2RF+p*nvars),(ww3RF+p*nvars),c1,c2,c3,m3RF,m2RF,m1RF,p1RF,p2RF,weno->
eps,nvars);
890 _WENOWeights_v_JS_((ww1LU+p*nvars),(ww2LU+p*nvars),(ww3LU+p*nvars),c1,c2,c3,m3LU,m2LU,m1LU,p1LU,p2LU,weno->
eps,nvars);
891 _WENOWeights_v_JS_((ww1RU+p*nvars),(ww2RU+p*nvars),(ww3RU+p*nvars),c1,c2,c3,m3RU,m2RU,m1RU,p1RU,p2RU,weno->
eps,nvars);
943 double *ww1LF, *ww2LF, *ww3LF, *ww1RF, *ww2RF, *ww3RF;
944 double *ww1LU, *ww2LU, *ww3LU, *ww1RU, *ww2RU, *ww3RU;
946 int ghosts = solver->
ghosts;
947 int ndims = solver->
ndims;
948 int nvars = solver->
nvars;
953 static const double thirteen_by_twelve = 13.0/12.0;
954 static const double one_fourth = 1.0/4.0;
957 int offset = weno->
offset[dir];
961 int indexC[ndims], indexI[ndims], index_outer[ndims], bounds_outer[ndims], bounds_inter[ndims];
962 _ArrayCopy1D_(dim,bounds_outer,ndims); bounds_outer[dir] = 1;
963 _ArrayCopy1D_(dim,bounds_inter,ndims); bounds_inter[dir] += 1;
967 double L[nvars*nvars], uavg[nvars];
969 ww1LF = weno->
w1 + offset;
970 ww2LF = weno->
w2 + offset;
971 ww3LF = weno->
w3 + offset;
972 ww1RF = weno->
w1 + 2*weno->
size + offset;
973 ww2RF = weno->
w2 + 2*weno->
size + offset;
974 ww3RF = weno->
w3 + 2*weno->
size + offset;
975 ww1LU = weno->
w1 + weno->
size + offset;
976 ww2LU = weno->
w2 + weno->
size + offset;
977 ww3LU = weno->
w3 + weno->
size + offset;
978 ww1RU = weno->
w1 + 2*weno->
size + weno->
size + offset;
979 ww2RU = weno->
w2 + 2*weno->
size + weno->
size + offset;
980 ww3RU = weno->
w3 + 2*weno->
size + weno->
size + offset;
981 #pragma omp parallel for schedule(auto) default(shared) private(i,index_outer,indexC,indexI) 982 for (i=0; i<N_outer; i++) {
986 for (indexI[dir] = 0; indexI[dir] < dim[dir]+1; indexI[dir]++) {
987 int qm1L,qm2L,qm3L,qp1L,qp2L,p,qm1R,qm2R,qm3R,qp1R,qp2R;
989 indexC[dir] = indexI[dir]-1;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm1L);
990 qm3L = qm1L - 2*stride[dir];
991 qm2L = qm1L - stride[dir];
992 qp1L = qm1L + stride[dir];
993 qp2L = qm1L + 2*stride[dir];
995 indexC[dir] = indexI[dir] ;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm1R);
996 qm3R = qm1R + 2*stride[dir];
997 qm2R = qm1R + stride[dir];
998 qp1R = qm1R - stride[dir];
999 qp2R = qm1R - 2*stride[dir];
1006 double m3LF[nvars], m2LF[nvars], m1LF[nvars], p1LF[nvars], p2LF[nvars];
1007 double m3RF[nvars], m2RF[nvars], m1RF[nvars], p1RF[nvars], p2RF[nvars];
1008 double m3LU[nvars], m2LU[nvars], m1LU[nvars], p1LU[nvars], p2LU[nvars];
1009 double m3RU[nvars], m2RU[nvars], m1RU[nvars], p1RU[nvars], p2RU[nvars];
1038 if ( ((mpi->ip[dir] == 0 ) && (indexI[dir] == 0 ))
1039 || ((mpi->ip[dir] == mpi->iproc[dir]-1) && (indexI[dir] == dim[dir])) ) {
1058 _WENOWeights_v_M_((ww1LF+p*nvars),(ww2LF+p*nvars),(ww3LF+p*nvars),c1,c2,c3,m3LF,m2LF,m1LF,p1LF,p2LF,weno->
eps,nvars);
1059 _WENOWeights_v_M_((ww1RF+p*nvars),(ww2RF+p*nvars),(ww3RF+p*nvars),c1,c2,c3,m3RF,m2RF,m1RF,p1RF,p2RF,weno->
eps,nvars);
1060 _WENOWeights_v_M_((ww1LU+p*nvars),(ww2LU+p*nvars),(ww3LU+p*nvars),c1,c2,c3,m3LU,m2LU,m1LU,p1LU,p2LU,weno->
eps,nvars);
1061 _WENOWeights_v_M_((ww1RU+p*nvars),(ww2RU+p*nvars),(ww3RU+p*nvars),c1,c2,c3,m3RU,m2RU,m1RU,p1RU,p2RU,weno->
eps,nvars);
1114 double *ww1LF, *ww2LF, *ww3LF, *ww1RF, *ww2RF, *ww3RF;
1115 double *ww1LU, *ww2LU, *ww3LU, *ww1RU, *ww2RU, *ww3RU;
1117 int ghosts = solver->
ghosts;
1118 int ndims = solver->
ndims;
1119 int nvars = solver->
nvars;
1124 static const double thirteen_by_twelve = 13.0/12.0;
1125 static const double one_fourth = 1.0/4.0;
1128 int offset = weno->
offset[dir];
1132 int indexC[ndims], indexI[ndims], index_outer[ndims], bounds_outer[ndims], bounds_inter[ndims];
1133 _ArrayCopy1D_(dim,bounds_outer,ndims); bounds_outer[dir] = 1;
1134 _ArrayCopy1D_(dim,bounds_inter,ndims); bounds_inter[dir] += 1;
1138 double L[nvars*nvars], uavg[nvars];
1140 ww1LF = weno->
w1 + offset;
1141 ww2LF = weno->
w2 + offset;
1142 ww3LF = weno->
w3 + offset;
1143 ww1RF = weno->
w1 + 2*weno->
size + offset;
1144 ww2RF = weno->
w2 + 2*weno->
size + offset;
1145 ww3RF = weno->
w3 + 2*weno->
size + offset;
1146 ww1LU = weno->
w1 + weno->
size + offset;
1147 ww2LU = weno->
w2 + weno->
size + offset;
1148 ww3LU = weno->
w3 + weno->
size + offset;
1149 ww1RU = weno->
w1 + 2*weno->
size + weno->
size + offset;
1150 ww2RU = weno->
w2 + 2*weno->
size + weno->
size + offset;
1151 ww3RU = weno->
w3 + 2*weno->
size + weno->
size + offset;
1152 #pragma omp parallel for schedule(auto) default(shared) private(i,index_outer,indexC,indexI) 1153 for (i=0; i<N_outer; i++) {
1157 for (indexI[dir] = 0; indexI[dir] < dim[dir]+1; indexI[dir]++) {
1158 int qm1L,qm2L,qm3L,qp1L,qp2L,p,qm1R,qm2R,qm3R,qp1R,qp2R;
1160 indexC[dir] = indexI[dir]-1;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm1L);
1161 qm3L = qm1L - 2*stride[dir];
1162 qm2L = qm1L - stride[dir];
1163 qp1L = qm1L + stride[dir];
1164 qp2L = qm1L + 2*stride[dir];
1166 indexC[dir] = indexI[dir] ;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm1R);
1167 qm3R = qm1R + 2*stride[dir];
1168 qm2R = qm1R + stride[dir];
1169 qp1R = qm1R - stride[dir];
1170 qp2R = qm1R - 2*stride[dir];
1177 double m3LF[nvars], m2LF[nvars], m1LF[nvars], p1LF[nvars], p2LF[nvars];
1178 double m3RF[nvars], m2RF[nvars], m1RF[nvars], p1RF[nvars], p2RF[nvars];
1179 double m3LU[nvars], m2LU[nvars], m1LU[nvars], p1LU[nvars], p2LU[nvars];
1180 double m3RU[nvars], m2RU[nvars], m1RU[nvars], p1RU[nvars], p2RU[nvars];
1209 if ( ((mpi->ip[dir] == 0 ) && (indexI[dir] == 0 ))
1210 || ((mpi->ip[dir] == mpi->iproc[dir]-1) && (indexI[dir] == dim[dir])) ) {
1229 _WENOWeights_v_Z_((ww1LF+p*nvars),(ww2LF+p*nvars),(ww3LF+p*nvars),c1,c2,c3,m3LF,m2LF,m1LF,p1LF,p2LF,weno->
eps,nvars);
1230 _WENOWeights_v_Z_((ww1RF+p*nvars),(ww2RF+p*nvars),(ww3RF+p*nvars),c1,c2,c3,m3RF,m2RF,m1RF,p1RF,p2RF,weno->
eps,nvars);
1231 _WENOWeights_v_Z_((ww1LU+p*nvars),(ww2LU+p*nvars),(ww3LU+p*nvars),c1,c2,c3,m3LU,m2LU,m1LU,p1LU,p2LU,weno->
eps,nvars);
1232 _WENOWeights_v_Z_((ww1RU+p*nvars),(ww2RU+p*nvars),(ww3RU+p*nvars),c1,c2,c3,m3RU,m2RU,m1RU,p1RU,p2RU,weno->
eps,nvars);
1285 double *ww1LF, *ww2LF, *ww3LF, *ww1RF, *ww2RF, *ww3RF;
1286 double *ww1LU, *ww2LU, *ww3LU, *ww1RU, *ww2RU, *ww3RU;
1288 int ghosts = solver->
ghosts;
1289 int ndims = solver->
ndims;
1290 int nvars = solver->
nvars;
1295 static const double thirteen_by_twelve = 13.0/12.0;
1296 static const double one_fourth = 1.0/4.0;
1299 int offset = weno->
offset[dir];
1303 int indexC[ndims], indexI[ndims], index_outer[ndims], bounds_outer[ndims], bounds_inter[ndims];
1304 _ArrayCopy1D_(dim,bounds_outer,ndims); bounds_outer[dir] = 1;
1305 _ArrayCopy1D_(dim,bounds_inter,ndims); bounds_inter[dir] += 1;
1309 double L[nvars*nvars], uavg[nvars];
1311 ww1LF = weno->
w1 + offset;
1312 ww2LF = weno->
w2 + offset;
1313 ww3LF = weno->
w3 + offset;
1314 ww1RF = weno->
w1 + 2*weno->
size + offset;
1315 ww2RF = weno->
w2 + 2*weno->
size + offset;
1316 ww3RF = weno->
w3 + 2*weno->
size + offset;
1317 ww1LU = weno->
w1 + weno->
size + offset;
1318 ww2LU = weno->
w2 + weno->
size + offset;
1319 ww3LU = weno->
w3 + weno->
size + offset;
1320 ww1RU = weno->
w1 + 2*weno->
size + weno->
size + offset;
1321 ww2RU = weno->
w2 + 2*weno->
size + weno->
size + offset;
1322 ww3RU = weno->
w3 + 2*weno->
size + weno->
size + offset;
1323 #pragma omp parallel for schedule(auto) default(shared) private(i,index_outer,indexC,indexI) 1324 for (i=0; i<N_outer; i++) {
1328 for (indexI[dir] = 0; indexI[dir] < dim[dir]+1; indexI[dir]++) {
1329 int qm1L,qm2L,qm3L,qp1L,qp2L,p,qm1R,qm2R,qm3R,qp1R,qp2R;
1331 indexC[dir] = indexI[dir]-1;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm1L);
1332 qm3L = qm1L - 2*stride[dir];
1333 qm2L = qm1L - stride[dir];
1334 qp1L = qm1L + stride[dir];
1335 qp2L = qm1L + 2*stride[dir];
1337 indexC[dir] = indexI[dir] ;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm1R);
1338 qm3R = qm1R + 2*stride[dir];
1339 qm2R = qm1R + stride[dir];
1340 qp1R = qm1R - stride[dir];
1341 qp2R = qm1R - 2*stride[dir];
1348 double m3LF[nvars], m2LF[nvars], m1LF[nvars], p1LF[nvars], p2LF[nvars];
1349 double m3RF[nvars], m2RF[nvars], m1RF[nvars], p1RF[nvars], p2RF[nvars];
1350 double m3LU[nvars], m2LU[nvars], m1LU[nvars], p1LU[nvars], p2LU[nvars];
1351 double m3RU[nvars], m2RU[nvars], m1RU[nvars], p1RU[nvars], p2RU[nvars];
1380 if ( ((mpi->ip[dir] == 0 ) && (indexI[dir] == 0 ))
1381 || ((mpi->ip[dir] == mpi->iproc[dir]-1) && (indexI[dir] == dim[dir])) ) {
1400 _WENOWeights_v_YC_((ww1LF+p*nvars),(ww2LF+p*nvars),(ww3LF+p*nvars),c1,c2,c3,m3LF,m2LF,m1LF,p1LF,p2LF,weno->
eps,nvars);
1401 _WENOWeights_v_YC_((ww1RF+p*nvars),(ww2RF+p*nvars),(ww3RF+p*nvars),c1,c2,c3,m3RF,m2RF,m1RF,p1RF,p2RF,weno->
eps,nvars);
1402 _WENOWeights_v_YC_((ww1LU+p*nvars),(ww2LU+p*nvars),(ww3LU+p*nvars),c1,c2,c3,m3LU,m2LU,m1LU,p1LU,p2LU,weno->
eps,nvars);
1403 _WENOWeights_v_YC_((ww1RU+p*nvars),(ww2RU+p*nvars),(ww3RU+p*nvars),c1,c2,c3,m3RU,m2RU,m1RU,p1RU,p2RU,weno->
eps,nvars);
#define _WENOWeights_v_M_(w1, w2, w3, c1, c2, c3, m3, m2, m1, p1, p2, eps, N)
#define _CRWENO_OPTIMAL_WEIGHT_1_
MPI related function definitions.
Contains function definitions for common array operations on GPU.
Contains function definitions for common mathematical functions.
static int WENOFifthOrderCalculateWeightsZ(double *, double *, double *, int, void *, void *)
int(* AveragingFunction)(double *, double *, double *, void *)
Some basic definitions and macros.
static int WENOFifthOrderCalculateWeightsCharJS(double *, double *, double *, int, void *, void *)
#define _WENO_OPTIMAL_WEIGHT_2_
#define _WENOWeights_v_Z_(w1, w2, w3, c1, c2, c3, m3, m2, m1, p1, p2, eps, N)
static int WENOFifthOrderCalculateWeightsM(double *, double *, double *, int, void *, void *)
#define _ArrayIndexnD_(N, index, imax, i, ghost)
static int WENOFifthOrderCalculateWeightsCharZ(double *, double *, double *, int, void *, void *)
static int WENOFifthOrderCalculateWeightsJS(double *, double *, double *, int, void *, void *)
#define _CRWENO_OPTIMAL_WEIGHT_2_
static int WENOFifthOrderCalculateWeightsYC(double *, double *, double *, int, void *, void *)
#define _CRWENO_OPTIMAL_WEIGHT_3_
Structure containing all solver-specific variables and functions.
static int WENOFifthOrderCalculateWeightsCharM(double *, double *, double *, int, void *, void *)
#define _WENOWeights_v_JS_(w1, w2, w3, c1, c2, c3, m3, m2, m1, p1, p2, eps, N)
char spatial_scheme_hyp[_MAX_STRING_SIZE_]
int WENOFifthOrderCalculateWeightsChar(double *fC, double *uC, double *x, int dir, void *s, void *m)
#define _WENO_OPTIMAL_WEIGHT_1_
Contains structure definition for hypar.
static int WENOFifthOrderCalculateWeightsCharYC(double *, double *, double *, int, void *, void *)
#define _ArrayIndex1D_(N, imax, i, ghost, index)
#define _WENOWeights_v_YC_(w1, w2, w3, c1, c2, c3, m3, m2, m1, p1, p2, eps, N)
Structure of variables/parameters needed by the WENO-type scheme.
int WENOFifthOrderCalculateWeights(double *fC, double *uC, double *x, int dir, void *s, void *m)
#define _FIFTH_ORDER_CRWENO_
Contains macros and function definitions for common matrix multiplication.
#define _WENO_OPTIMAL_WEIGHT_3_
Structure of MPI-related variables.
Definitions for the functions computing the interpolated value of the primitive at the cell interface...
#define MatVecMult(N, y, A, x)
#define _ArrayCopy1D_(x, y, size)
Contains macros and function definitions for common array operations.
#define _ArrayProduct1D_(x, size, p)
int(* GetLeftEigenvectors)(double *, double *, void *, int)