This function initializes the arrays to store the nonlinear weights for fifth order WENO-type schemes to their optimal values (i.e. values of the weights for a perfectly smooth solution). 5th order methods need three weights at each grid interface.
46 double *ww1, *ww2, *ww3;
49 int ndims = solver->
ndims;
50 int nvars = solver->
nvars;
54 int offset = a_offset[dir];
58 int indexI[ndims], index_outer[ndims], bounds_outer[ndims], bounds_inter[ndims];
60 _ArrayCopy1D_(dim,bounds_inter,ndims); bounds_inter[dir] += 1;
69 for (indexI[dir] = 0; indexI[dir] < dim[dir]+1; indexI[dir]++) {
72 for (v=0; v<nvars; v++) {
76 if ( ((mpi->ip[dir] == 0 ) && (indexI[dir] == 0 ))
77 || ((mpi->ip[dir] == mpi->iproc[dir]-1) && (indexI[dir] == dim[dir])) ) {
96 *(ww1+p*nvars+v) = c1;
97 *(ww2+p*nvars+v) = c2;
98 *(ww3+p*nvars+v) = c3;
104 ww1 = a_w1 + weno->
size + offset;
105 ww2 = a_w2 + weno->
size + offset;
106 ww3 = a_w3 + weno->
size + offset;
110 for (indexI[dir] = 0; indexI[dir] < dim[dir]+1; indexI[dir]++) {
113 for (v=0; v<nvars; v++) {
118 if ( ((mpi->ip[dir] == 0 ) && (indexI[dir] == 0 ))
119 || ((mpi->ip[dir] == mpi->iproc[dir]-1) && (indexI[dir] == dim[dir])) ) {
138 *(ww1+p*nvars+v) = c1;
139 *(ww2+p*nvars+v) = c2;
140 *(ww3+p*nvars+v) = c3;
147 ww1 = a_w1 + 2*weno->
size + offset;
148 ww2 = a_w2 + 2*weno->
size + offset;
149 ww3 = a_w3 + 2*weno->
size + offset;
153 for (indexI[dir] = 0; indexI[dir] < dim[dir]+1; indexI[dir]++) {
156 for (v=0; v<nvars; v++) {
161 if ( ((mpi->ip[dir] == 0 ) && (indexI[dir] == 0 ))
162 || ((mpi->ip[dir] == mpi->iproc[dir]-1) && (indexI[dir] == dim[dir])) ) {
181 *(ww1+p*nvars+v) = c1;
182 *(ww2+p*nvars+v) = c2;
183 *(ww3+p*nvars+v) = c3;
189 ww1 = a_w1 + 2*weno->
size + weno->
size + offset;
190 ww2 = a_w2 + 2*weno->
size + weno->
size + offset;
191 ww3 = a_w3 + 2*weno->
size + weno->
size + offset;
195 for (indexI[dir] = 0; indexI[dir] < dim[dir]+1; indexI[dir]++) {
198 for (v=0; v<nvars; v++) {
203 if ( ((mpi->ip[dir] == 0 ) && (indexI[dir] == 0 ))
204 || ((mpi->ip[dir] == mpi->iproc[dir]-1) && (indexI[dir] == dim[dir])) ) {
223 *(ww1+p*nvars+v) = c1;
224 *(ww2+p*nvars+v) = c2;
225 *(ww3+p*nvars+v) = c3;
char spatial_scheme_hyp[_MAX_STRING_SIZE_]
#define _ArraySetValue_(x, size, value)
#define _ArrayIncrementIndex_(N, imax, i, done)
#define _WENO_OPTIMAL_WEIGHT_2_
Structure of variables/parameters needed by the WENO-type scheme.
#define _ArrayIndex1D_(N, imax, i, ghost, index)
#define _CRWENO_OPTIMAL_WEIGHT_1_
#define _WENO_OPTIMAL_WEIGHT_3_
#define _WENO_OPTIMAL_WEIGHT_1_
#define _ArrayCopy1D_(x, y, size)
#define _CRWENO_OPTIMAL_WEIGHT_2_
#define _CRWENO_OPTIMAL_WEIGHT_3_
#define _FIFTH_ORDER_CRWENO_
Structure of MPI-related variables.
Structure containing all solver-specific variables and functions.