diff --git a/src/CartBlock.C b/src/CartBlock.C index 95e45ed..50e9241 100644 --- a/src/CartBlock.C +++ b/src/CartBlock.C @@ -111,11 +111,9 @@ void CartBlock::getInterpolatedData( } for (i = 0; i < listptr->nweights; i++) { - int const cell_index = - static_cast(cart_utils::get_cell_index( - dims[0], dims[1], nf, - listptr->inode[static_cast(3 * i)], - listptr->inode[3 * i + 1], listptr->inode[3 * i + 2])); + int const cell_index = (cart_utils::get_cell_index( + dims[0], dims[1], nf, listptr->inode[3 * i], + listptr->inode[3 * i + 1], listptr->inode[3 * i + 2])); for (n = 0; n < nvar_cell; n++) { weight = listptr->weights[i]; qq[n] += qcell[cell_index + ncell_nf * n] * weight; @@ -171,8 +169,7 @@ void CartBlock::preprocess(CartGrid* cg) for (int n = 0; n < 3; n++) { dx[n] = cg->dx[3 * global_id + n]; } - dims[0] = cg->ihi[static_cast(3 * global_id)] - - cg->ilo[static_cast(3 * global_id)] + 1; + dims[0] = cg->ihi[3 * global_id] - cg->ilo[3 * global_id] + 1; dims[1] = cg->ihi[3 * global_id + 1] - cg->ilo[3 * global_id + 1] + 1; dims[2] = cg->ihi[3 * global_id + 2] - cg->ilo[3 * global_id + 2] + 1; nf = cg->nf; @@ -260,10 +257,10 @@ void CartBlock::insertInInterpList( } if (donor_frac == nullptr) { listptr->nweights = 8; - listptr->weights = (double*)malloc( - sizeof(double) * (static_cast(listptr->nweights * 2))); - listptr->inode = (int*)malloc( - sizeof(int) * (static_cast(listptr->nweights * 2 * 3))); + listptr->weights = + (double*)malloc(sizeof(double) * (listptr->nweights * 2)); + listptr->inode = + (int*)malloc(sizeof(int) * (listptr->nweights * 2 * 3)); cart_interp::linear_interpolation( nf, ix, dims, rst, &(listptr->nweights), listptr->inode, diff --git a/src/CartGrid.C b/src/CartGrid.C index f18e0bf..a473097 100644 --- a/src/CartGrid.C +++ b/src/CartGrid.C @@ -217,17 +217,15 @@ void CartGrid::search(double* x, int* donorid, int npts) } } } - if (myid == 2 && abs(x[static_cast(3 * i)] - 0.739573) < 1e-5 && + if (myid == 2 && abs(x[3 * i] - 0.739573) < 1e-5 && abs(x[3 * i + 1] + 0.259310) < 1e-5 && abs(x[3 * i + 2] + 0.639614) < 1e-5) { printf( - "%d %d %f %f %f %d\n", myid, i, x[static_cast(3 * i)], - x[3 * i + 1], x[3 * i + 2], donorid[i]); + "%d %d %f %f %f %d\n", myid, i, x[3 * i], x[3 * i + 1], + x[3 * i + 2], donorid[i]); } if (donorid[i] == -1) { - printf( - "%d %f %f %f\n", myid, x[static_cast(3 * i)], x[3 * i + 1], - x[3 * i + 2]); + printf("%d %f %f %f\n", myid, x[3 * i], x[3 * i + 1], x[3 * i + 2]); } } // printf("CartGrid::search Processor %d located %d of %d diff --git a/src/MeshBlock.C b/src/MeshBlock.C index 49b3b1a..44903c8 100644 --- a/src/MeshBlock.C +++ b/src/MeshBlock.C @@ -627,11 +627,11 @@ void MeshBlock::tagBoundaryFaces() } // allocate wall face node list - wbcfacenode.resize(static_cast(4 * nwbcface)); + wbcfacenode.resize(4 * nwbcface); wbcfacebox.resize(nwbcface); // allocate outer face node list - obcfacenode.resize(static_cast(4 * nobcface)); + obcfacenode.resize(4 * nobcface); obcfacebox.resize(nobcface); /* ====================== */ @@ -780,8 +780,8 @@ void MeshBlock::writeGridFile(int bid) ncells); for (i = 0; i < nnodes; i++) { fprintf( - fp, "%.14e %.14e %.14e %d\n", x[static_cast(3 * i)], - x[3 * i + 1], x[3 * i + 2], iblank[i]); + fp, "%.14e %.14e %.14e %d\n", x[3 * i], x[3 * i + 1], x[3 * i + 2], + iblank[i]); } ba = 1 - BASE; @@ -790,32 +790,28 @@ void MeshBlock::writeGridFile(int bid) for (i = 0; i < nc[n]; i++) { if (nvert == 4) { fprintf( - fp, "%d %d %d %d %d %d %d %d\n", - vconn[n][static_cast(nvert * i)] + ba, + fp, "%d %d %d %d %d %d %d %d\n", vconn[n][nvert * i] + ba, vconn[n][nvert * i + 1] + ba, vconn[n][nvert * i + 2] + ba, vconn[n][nvert * i + 2] + ba, vconn[n][nvert * i + 3] + ba, vconn[n][nvert * i + 3] + ba, vconn[n][nvert * i + 3] + ba, vconn[n][nvert * i + 3] + ba); } else if (nvert == 5) { fprintf( - fp, "%d %d %d %d %d %d %d %d\n", - vconn[n][static_cast(nvert * i)] + ba, + fp, "%d %d %d %d %d %d %d %d\n", vconn[n][nvert * i] + ba, vconn[n][nvert * i + 1] + ba, vconn[n][nvert * i + 2] + ba, vconn[n][nvert * i + 3] + ba, vconn[n][nvert * i + 4] + ba, vconn[n][nvert * i + 4] + ba, vconn[n][nvert * i + 4] + ba, vconn[n][nvert * i + 4] + ba); } else if (nvert == 6) { fprintf( - fp, "%d %d %d %d %d %d %d %d\n", - vconn[n][static_cast(nvert * i)] + ba, + fp, "%d %d %d %d %d %d %d %d\n", vconn[n][nvert * i] + ba, vconn[n][nvert * i + 1] + ba, vconn[n][nvert * i + 2] + ba, vconn[n][nvert * i + 2] + ba, vconn[n][nvert * i + 3] + ba, vconn[n][nvert * i + 4] + ba, vconn[n][nvert * i + 5] + ba, vconn[n][nvert * i + 5] + ba); } else if (nvert == 8) { fprintf( - fp, "%d %d %d %d %d %d %d %d\n", - vconn[n][static_cast(nvert * i)] + ba, + fp, "%d %d %d %d %d %d %d %d\n", vconn[n][nvert * i] + ba, vconn[n][nvert * i + 1] + ba, vconn[n][nvert * i + 2] + ba, vconn[n][nvert * i + 3] + ba, vconn[n][nvert * i + 4] + ba, vconn[n][nvert * i + 5] + ba, vconn[n][nvert * i + 6] + ba, @@ -851,7 +847,7 @@ void MeshBlock::writeCellFile(int bid) fp, "VARLOCATION = (1=NODAL, 2=NODAL, 3=NODAL, 4=NODAL,5=CELLCENTERED)\n"); for (i = 0; i < nnodes; i++) { - fprintf(fp, "%lf\n", x[static_cast(3 * i)]); + fprintf(fp, "%lf\n", x[3 * i]); } for (i = 0; i < nnodes; i++) { fprintf(fp, "%lf\n", x[3 * i + 1]); @@ -871,32 +867,28 @@ void MeshBlock::writeCellFile(int bid) for (i = 0; i < nc[n]; i++) { if (nvert == 4) { fprintf( - fp, "%d %d %d %d %d %d %d %d\n", - vconn[n][static_cast(nvert * i)] + ba, + fp, "%d %d %d %d %d %d %d %d\n", vconn[n][nvert * i] + ba, vconn[n][nvert * i + 1] + ba, vconn[n][nvert * i + 2] + ba, vconn[n][nvert * i + 2] + ba, vconn[n][nvert * i + 3] + ba, vconn[n][nvert * i + 3] + ba, vconn[n][nvert * i + 3] + ba, vconn[n][nvert * i + 3] + ba); } else if (nvert == 5) { fprintf( - fp, "%d %d %d %d %d %d %d %d\n", - vconn[n][static_cast(nvert * i)] + ba, + fp, "%d %d %d %d %d %d %d %d\n", vconn[n][nvert * i] + ba, vconn[n][nvert * i + 1] + ba, vconn[n][nvert * i + 2] + ba, vconn[n][nvert * i + 3] + ba, vconn[n][nvert * i + 4] + ba, vconn[n][nvert * i + 4] + ba, vconn[n][nvert * i + 4] + ba, vconn[n][nvert * i + 4] + ba); } else if (nvert == 6) { fprintf( - fp, "%d %d %d %d %d %d %d %d\n", - vconn[n][static_cast(nvert * i)] + ba, + fp, "%d %d %d %d %d %d %d %d\n", vconn[n][nvert * i] + ba, vconn[n][nvert * i + 1] + ba, vconn[n][nvert * i + 2] + ba, vconn[n][nvert * i + 2] + ba, vconn[n][nvert * i + 3] + ba, vconn[n][nvert * i + 4] + ba, vconn[n][nvert * i + 5] + ba, vconn[n][nvert * i + 5] + ba); } else if (nvert == 8) { fprintf( - fp, "%d %d %d %d %d %d %d %d\n", - vconn[n][static_cast(nvert * i)] + ba, + fp, "%d %d %d %d %d %d %d %d\n", vconn[n][nvert * i] + ba, vconn[n][nvert * i + 1] + ba, vconn[n][nvert * i + 2] + ba, vconn[n][nvert * i + 3] + ba, vconn[n][nvert * i + 4] + ba, vconn[n][nvert * i + 5] + ba, vconn[n][nvert * i + 6] + ba, @@ -946,8 +938,8 @@ void MeshBlock::writeFlowFile(int bid, double* q, int nvar, int type) if (type == 0) { for (i = 0; i < nnodes; i++) { fprintf( - fp, "%lf %lf %lf %d %d ", x[static_cast(3 * i)], - x[3 * i + 1], x[3 * i + 2], ibl[i], meshtag); + fp, "%lf %lf %lf %d %d ", x[3 * i], x[3 * i + 1], x[3 * i + 2], + ibl[i], meshtag); for (j = 0; j < nvar; j++) { fprintf(fp, "%lf ", q[i * nvar + j]); } @@ -958,8 +950,8 @@ void MeshBlock::writeFlowFile(int bid, double* q, int nvar, int type) } else { for (i = 0; i < nnodes; i++) { fprintf( - fp, "%lf %lf %lf %d %d ", x[static_cast(3 * i)], - x[3 * i + 1], x[3 * i + 2], ibl[i], meshtag); + fp, "%lf %lf %lf %d %d ", x[3 * i], x[3 * i + 1], x[3 * i + 2], + ibl[i], meshtag); for (j = 0; j < nvar; j++) { fprintf(fp, "%lf ", q[j * nnodes + i]); } @@ -972,32 +964,28 @@ void MeshBlock::writeFlowFile(int bid, double* q, int nvar, int type) for (i = 0; i < nc[n]; i++) { if (nvert == 4) { fprintf( - fp, "%d %d %d %d %d %d %d %d\n", - vconn[n][static_cast(nvert * i)] + ba, + fp, "%d %d %d %d %d %d %d %d\n", vconn[n][nvert * i] + ba, vconn[n][nvert * i + 1] + ba, vconn[n][nvert * i + 2] + ba, vconn[n][nvert * i + 2] + ba, vconn[n][nvert * i + 3] + ba, vconn[n][nvert * i + 3] + ba, vconn[n][nvert * i + 3] + ba, vconn[n][nvert * i + 3] + ba); } else if (nvert == 5) { fprintf( - fp, "%d %d %d %d %d %d %d %d\n", - vconn[n][static_cast(nvert * i)] + ba, + fp, "%d %d %d %d %d %d %d %d\n", vconn[n][nvert * i] + ba, vconn[n][nvert * i + 1] + ba, vconn[n][nvert * i + 2] + ba, vconn[n][nvert * i + 3] + ba, vconn[n][nvert * i + 4] + ba, vconn[n][nvert * i + 4] + ba, vconn[n][nvert * i + 4] + ba, vconn[n][nvert * i + 4] + ba); } else if (nvert == 6) { fprintf( - fp, "%d %d %d %d %d %d %d %d\n", - vconn[n][static_cast(nvert * i)] + ba, + fp, "%d %d %d %d %d %d %d %d\n", vconn[n][nvert * i] + ba, vconn[n][nvert * i + 1] + ba, vconn[n][nvert * i + 2] + ba, vconn[n][nvert * i + 2] + ba, vconn[n][nvert * i + 3] + ba, vconn[n][nvert * i + 4] + ba, vconn[n][nvert * i + 5] + ba, vconn[n][nvert * i + 5] + ba); } else if (nvert == 8) { fprintf( - fp, "%d %d %d %d %d %d %d %d\n", - vconn[n][static_cast(nvert * i)] + ba, + fp, "%d %d %d %d %d %d %d %d\n", vconn[n][nvert * i] + ba, vconn[n][nvert * i + 1] + ba, vconn[n][nvert * i + 2] + ba, vconn[n][nvert * i + 3] + ba, vconn[n][nvert * i + 4] + ba, vconn[n][nvert * i + 5] + ba, vconn[n][nvert * i + 6] + ba, @@ -1374,14 +1362,13 @@ void MeshBlock::markBoundaryAdaptiveMapSurfaceIntersect( /* possible overlap: use face intersection test */ // load face boundary nodes: set pointer to nodes - inode = - &bcfacenode[static_cast(4 * i)]; // last node may be -1 + inode = &bcfacenode[4 * i]; // last node may be -1 // get node indices and coordinates for this boundary face // load 1st three nodes - double* pt1 = &x[static_cast(3 * inode[0])]; - double* pt2 = &x[static_cast(3 * inode[1])]; - double* pt3 = &x[static_cast(3 * inode[2])]; + double* pt1 = &x[3 * inode[0]]; + double* pt2 = &x[3 * inode[1]]; + double* pt3 = &x[3 * inode[2]]; // test triangle 1: pass first 3 triangles if (triBoxOverlap(boxcenter, halfdx, pt1, pt2, pt3) != 0) { @@ -1392,7 +1379,7 @@ void MeshBlock::markBoundaryAdaptiveMapSurfaceIntersect( // if quad, test second triangle using last node nvert = (inode[3] == -1) ? 3 : 4; // number of face vertices if (nvert == 4) { - double* pt4 = &x[static_cast(3 * inode[3])]; + double* pt4 = &x[3 * inode[3]]; if (triBoxOverlap(boxcenter, halfdx, pt1, pt2, pt4) != 0) { tagList[j] = 1; break; // jump to next octant (break from inner BC loop) @@ -1493,14 +1480,13 @@ void MeshBlock::markBoundaryAdaptiveMapSurfaceIntersect( /* possible overlap: use face intersection test */ // load face boundary nodes: set pointer to nodes - inode = - &bcfacenode[static_cast(4 * i)]; // last node may be -1 + inode = &bcfacenode[4 * i]; // last node may be -1 // get node indices and coordinates for this boundary face // load 1st three nodes - double* pt1 = &x[static_cast(3 * inode[0])]; - double* pt2 = &x[static_cast(3 * inode[1])]; - double* pt3 = &x[static_cast(3 * inode[2])]; + double* pt1 = &x[3 * inode[0]]; + double* pt2 = &x[3 * inode[1]]; + double* pt3 = &x[3 * inode[2]]; // test triangle 1: pass first 3 triangles if (triBoxOverlap(boxcenter, halfdx, pt1, pt2, pt3) != 0) { @@ -1511,7 +1497,7 @@ void MeshBlock::markBoundaryAdaptiveMapSurfaceIntersect( // if quad, test second triangle using last node nvert = (inode[3] == -1) ? 3 : 4; // number of face vertices if (nvert == 4) { - double* pt4 = &x[static_cast(3 * inode[3])]; + double* pt4 = &x[3 * inode[3]]; if (triBoxOverlap(boxcenter, halfdx, pt1, pt2, pt4) != 0) { tagList[j] = 1; break; // jump to next octant (break from inner BC loop) @@ -2239,7 +2225,7 @@ void MeshBlock::create_hex_cell_map() double xd[3]; int idx[3]; for (int j = 0; j < 3; j++) { - int const lnode = vconn[0][static_cast(8 * i)] - BASE; + int const lnode = vconn[0][8 * i] - BASE; int const tnode = vconn[0][8 * i + 6] - BASE; xc[j] = 0.5 * (x[3 * lnode + j] + x[3 * tnode + j]); } @@ -2285,8 +2271,8 @@ void MeshBlock::checkOrphans() if (nodeRes[i] >= std::numeric_limits::max()) { if (iblank[i] == 1) { fprintf( - fp, "%f %f %f %f\n", x[static_cast(3 * i)], - x[3 * i + 1], x[3 * i + 2], nodeRes[i]); + fp, "%f %f %f %f\n", x[3 * i], x[3 * i + 1], + x[3 * i + 2], nodeRes[i]); norphan++; } } diff --git a/src/MeshBlock.h b/src/MeshBlock.h index feee53f..a9e03b3 100644 --- a/src/MeshBlock.h +++ b/src/MeshBlock.h @@ -493,8 +493,7 @@ class MeshBlock void outputOrphan(FILE* fp, int i) { fprintf( - fp, "%f %f %f\n", rxyz[static_cast(3 * i)], rxyz[3 * i + 1], - rxyz[3 * i + 2]); + fp, "%f %f %f\n", rxyz[3 * i], rxyz[3 * i + 1], rxyz[3 * i + 2]); } void clearOrphans(HOLEMAP* holemap, int nmesh, const int* itmp); void clearOrphans(ADAPTIVE_HOLEMAP* holemap, int nmesh, int* itmp); diff --git a/src/bookKeeping.C b/src/bookKeeping.C index 116fa18..763d21d 100644 --- a/src/bookKeeping.C +++ b/src/bookKeeping.C @@ -42,7 +42,7 @@ void MeshBlock::getDonorPacket(PACKET* sndPack, int nsend) const // for (i = 0; i < nsearch; i++) { if (donorId[i] > -1) { - k = isearch[static_cast(2 * i)]; + k = isearch[2 * i]; sndPack[k].nints += 3; sndPack[k].nreals++; } @@ -59,7 +59,7 @@ void MeshBlock::getDonorPacket(PACKET* sndPack, int nsend) const // for (i = 0; i < nsearch; i++) { if (donorId[i] > -1) { - k = isearch[static_cast(2 * i)]; + k = isearch[2 * i]; sndPack[k].intData[icount[k]++] = meshtag; // mesh tag sndPack[k].intData[icount[k]++] = isearch[2 * i + 1]; // point id sndPack[k].intData[icount[k]++] = i; // point id on the donor side @@ -76,7 +76,7 @@ void MeshBlock::getMBDonorPktSizes( { for (int i = 0; i < nsearch; i++) { if (donorId[i] > -1) { - int const ii = isearch[static_cast(3 * i)]; + int const ii = isearch[3 * i]; nints[ii] += 4; nreals[ii] += 2; } @@ -93,7 +93,7 @@ void MeshBlock::getMBDonorPackets( continue; } - int const k = isearch[static_cast(3 * i)]; + int const k = isearch[3 * i]; int& ix = ixOffset[k]; int& rx = rxOffset[k]; @@ -180,9 +180,7 @@ void MeshBlock::processDonors( if (verbose != 0) TRACEI(iblank[i]); if (verbose != 0) TRACED(nodeRes[i]); if (verbose != 0) { - printf( - "%f %f %f\n", x[static_cast(3 * i)], x[3 * i + 1], - x[3 * i + 2]); + printf("%f %f %f\n", x[3 * i], x[3 * i + 1], x[3 * i + 2]); } if (donorList[i] == nullptr) { if (verbose != 0) { @@ -191,8 +189,8 @@ void MeshBlock::processDonors( for (j = 0; j < nmesh; j++) { if (j != (meshtag - BASE) && (holemap[j].existWall != 0)) { if (checkHoleMap( - &x[static_cast(3 * i)], holemap[j].nx, - holemap[j].sam, holemap[j].extents) != 0) { + &x[3 * i], holemap[j].nx, holemap[j].sam, + holemap[j].extents) != 0) { iblank[i] = 0; break; } @@ -220,8 +218,8 @@ void MeshBlock::processDonors( if (j != (meshtag - BASE) && (holemap[j].existWall != 0)) { if (iflag[j] == 0) { if (checkHoleMap( - &x[static_cast(3 * i)], holemap[j].nx, - holemap[j].sam, holemap[j].extents) != 0) { + &x[3 * i], holemap[j].nx, holemap[j].sam, + holemap[j].extents) != 0) { iblank[i] = 0; break; } @@ -243,8 +241,7 @@ void MeshBlock::processDonors( myid, wbcnode[i] - BASE, donorList[wbcnode[i] - BASE]); ii = wbcnode[i] - BASE; printf( - "xloc=%e %e %e\n", x[static_cast(3 * ii)], - x[3 * ii + 1], x[3 * ii + 2]); + "xloc=%e %e %e\n", x[3 * ii], x[3 * ii + 1], x[3 * ii + 2]); printf( "Computations will continue, but may suffer from accuracy " "problems\n"); @@ -408,8 +405,8 @@ void MeshBlock::processDonors( for (j = 0; j < nmesh; j++) { if (j != (meshtag - BASE) && (holemap[j].existWall != 0U)) { - int const SB_val = checkAdaptiveHoleMap( - &x[static_cast(3 * i)], &holemap[j]); + int const SB_val = + checkAdaptiveHoleMap(&x[3 * i], &holemap[j]); if (SB_val != OUTSIDE_SB) { iblank[i] = 0; break; @@ -446,8 +443,8 @@ void MeshBlock::processDonors( if (iflag[j] == 0) { // body{j} does NOT have candidate so check if point is // INSIDE SB - int const SB_val = checkAdaptiveHoleMap( - &x[static_cast(3 * i)], &holemap[j]); + int const SB_val = + checkAdaptiveHoleMap(&x[3 * i], &holemap[j]); if (SB_val != OUTSIDE_SB) { iblank[i] = 0; break; @@ -472,8 +469,8 @@ void MeshBlock::processDonors( myid, wbcnode[i] - BASE, donorList[wbcnode[i] - BASE]); ii = wbcnode[i] - BASE; fprintf( - stderr, "xloc=%e %e %e\n", x[static_cast(3 * ii)], - x[3 * ii + 1], x[3 * ii + 2]); + stderr, "xloc=%e %e %e\n", x[3 * ii], x[3 * ii + 1], + x[3 * ii + 2]); fprintf( stderr, "Computations will continue, but may suffer from accuracy " @@ -653,7 +650,7 @@ void MeshBlock::findInterpData(int* recid, int irecord, double receptorRes2) // if (myid==63 && irecord==3224) verbose=1; // if (myid==1 && irecord==158192 && meshtag==1) verbose=1; receptorRes = fabs(receptorRes2); - procid = isearch[static_cast(3 * irecord)]; + procid = isearch[3 * irecord]; pointid = isearch[3 * irecord + 1]; blockid = isearch[3 * irecord + 2]; meshtagrecv = tagsearch[irecord]; diff --git a/src/codetypes.h b/src/codetypes.h index d69398c..c737662 100644 --- a/src/codetypes.h +++ b/src/codetypes.h @@ -54,7 +54,6 @@ enum : uint8_t { BASE = 1 }; // #define RAD2DEG (180.0/PI) // #define DEG2RAD (PI/180.0) #define TOL 1.0e-10 -// #define HOLEMAPSIZE 192 enum : uint8_t { HOLEMAPSIZE = 192 }; // #define NFRINGE 3 // #define NVAR 6 @@ -107,12 +106,6 @@ enum : uint8_t { OUTSIDE_SB = 0, INSIDE_SB = 1, WALL_SB = 2 }; /*===================================================================*/ /* Code specific types */ /*===================================================================*/ -// #define XLO 0 -// #define XHI 1 -// #define YLO 2 -// #define YHI 3 -// #define ZLO 4 -// #define ZHI 5 enum : uint8_t { XLO = 0, XHI = 1, YLO = 2, YHI = 3, ZLO = 4, ZHI = 5 }; diff --git a/src/dataUpdate.C b/src/dataUpdate.C index a265998..af6d4b9 100644 --- a/src/dataUpdate.C +++ b/src/dataUpdate.C @@ -25,8 +25,6 @@ #include "codetypes.h" #include "MeshBlock.h" -// #define ROW 0 -// #define COLUMN 1 enum : uint8_t { ROW = 0, COLUMN = 1 }; void MeshBlock::getInterpolatedSolution( diff --git a/src/exchangeAMRDonors.C b/src/exchangeAMRDonors.C index 48aa4ad..35f5cc4 100644 --- a/src/exchangeAMRDonors.C +++ b/src/exchangeAMRDonors.C @@ -95,7 +95,7 @@ void tioga::exchangeAMRDonors() assert( (mb->isearch[static_cast(3 * i)] < nsend && mb->isearch[static_cast(3 * i)] >= 0)); - obreceptors[imap[mb->isearch[static_cast(3 * i)]]]++; + obreceptors[imap[mb->isearch[3 * i]]]++; } } } @@ -134,7 +134,7 @@ void tioga::exchangeAMRDonors() mb->receptorIdCart[i]; sndPack[procid].intData[intcount[procid]++] = ib; sndPack[procid].realData[realcount[procid]++] = - mb->rxyzCart[static_cast(3 * i)]; + mb->rxyzCart[3 * i]; sndPack[procid].realData[realcount[procid]++] = mb->rxyzCart[3 * i + 1]; sndPack[procid].realData[realcount[procid]++] = @@ -146,7 +146,7 @@ void tioga::exchangeAMRDonors() auto& mb = mblocks[ib]; for (i = 0; i < mb->nsearch; i++) { if (mb->donorId[i] != -1) { - procid = imap[mb->isearch[static_cast(3 * i)]]; + procid = imap[mb->isearch[3 * i]]; sndPack[procid].intData[intcount[procid]++] = mb->isearch[3 * i + 1]; sndPack[procid].intData[intcount[procid]++] = @@ -257,7 +257,7 @@ void tioga::exchangeAMRDonors() cancelledData = (int*)malloc(sizeof(int) * 4 * ncancel); cb[i].getCancellationData(cancelledData, &ncancel); for (j = 0; j < ncancel; j++) { - procid = cancelledData[static_cast(4 * j)]; + procid = cancelledData[4 * j]; ctype = cancelledData[4 * j + 1]; remoteid = cancelledData[4 * j + 2]; remoteblockid = cancelledData[4 * j + 3]; diff --git a/src/exchangeBoxes.C b/src/exchangeBoxes.C index 518d7d3..ab9addd 100644 --- a/src/exchangeBoxes.C +++ b/src/exchangeBoxes.C @@ -85,7 +85,7 @@ void tioga::exchangeBoxes() displs[i] = displs[i - 1] + nbPerProc[i - 1] * 16; } - std::vector myOBBdata(static_cast(nblocks * 16)); + std::vector myOBBdata(nblocks * 16); std::vector allOBBdata(static_cast(ntotalblks * 16)); int m = 0; diff --git a/src/exchangeDonors.C b/src/exchangeDonors.C index b7ca20b..cc2637e 100644 --- a/src/exchangeDonors.C +++ b/src/exchangeDonors.C @@ -139,7 +139,7 @@ void tioga::exchangeDonors() for (int n = 0; n < nblocks; n++) { for (int i = 0; i < nrecords[n]; i++) { - int const k = donorRecords[n][static_cast(3 * i)]; + int const k = donorRecords[n][3 * i]; sndPack[k].nints += 2; sndPack[k].nreals++; } @@ -153,7 +153,7 @@ void tioga::exchangeDonors() for (int n = 0; n < nblocks; n++) { for (int i = 0; i < nrecords[n]; i++) { - int const k = donorRecords[n][static_cast(3 * i)]; + int const k = donorRecords[n][3 * i]; sndPack[k].intData[ixOffset[k]++] = donorRecords[n][3 * i + 1]; sndPack[k].intData[ixOffset[k]++] = donorRecords[n][3 * i + 2]; sndPack[k].realData[rxOffset[k]++] = receptorResolution[n][i]; @@ -213,7 +213,7 @@ void tioga::exchangeDonors() for (int n = 0; n < nblocks; n++) { for (int i = 0; i < nrecords[n]; i++) { - int const k = donorRecords[n][static_cast(3 * i)]; + int const k = donorRecords[n][3 * i]; sndPack[k].nints += 2; } } @@ -223,7 +223,7 @@ void tioga::exchangeDonors() for (int n = 0; n < nblocks; n++) { for (int i = 0; i < nrecords[n]; i++) { - int const k = donorRecords[n][static_cast(3 * i)]; + int const k = donorRecords[n][3 * i]; sndPack[k].intData[ixOffset[k]++] = donorRecords[n][3 * i + 1]; sndPack[k].intData[ixOffset[k]++] = donorRecords[n][3 * i + 2]; } @@ -264,7 +264,7 @@ void tioga::exchangeDonors() std::fill(ixOffset.begin(), ixOffset.end(), 0); for (int n = 0; n < nblocks; n++) { for (int i = 0; i < nrecords[n]; i++) { - int const k = donorRecords[n][static_cast(3 * i)]; + int const k = donorRecords[n][3 * i]; sndPack[k].nints += 2; } } @@ -273,7 +273,7 @@ void tioga::exchangeDonors() } for (int n = 0; n < nblocks; n++) { for (int i = 0; i < nrecords[n]; i++) { - int const k = donorRecords[n][static_cast(3 * i)]; + int const k = donorRecords[n][3 * i]; sndPack[k].intData[ixOffset[k]++] = donorRecords[n][3 * i + 1]; sndPack[k].intData[ixOffset[k]++] = donorRecords[n][3 * i + 2]; } diff --git a/src/getCartReceptors.C b/src/getCartReceptors.C index 91ef057..0971f70 100644 --- a/src/getCartReceptors.C +++ b/src/getCartReceptors.C @@ -61,14 +61,12 @@ void MeshBlock::getCartReceptors(CartGrid* cg, parallelComm* pc) nsearch = 0; // for (int c = 0; c < cg->ngrids; c++) { - int const cell_count = - (cg->dims[static_cast(3 * c)] + 2 * cg->nf) * - (cg->dims[3 * c + 1] + 2 * cg->nf) * - (cg->dims[3 * c + 2] + 2 * cg->nf); + int const cell_count = (cg->dims[3 * c] + 2 * cg->nf) * + (cg->dims[3 * c + 1] + 2 * cg->nf) * + (cg->dims[3 * c + 2] + 2 * cg->nf); int const vol = static_cast( - cg->dx[static_cast(3 * c)] * cg->dx[3 * c + 1] * - cg->dx[3 * c + 2]); + cg->dx[3 * c] * cg->dx[3 * c + 1] * cg->dx[3 * c + 2]); for (int n = 0; n < 3; n++) { obcart->dxc[n] = cg->dx[3 * c + n] * (cg->dims[3 * c + n]) * 0.5; @@ -86,7 +84,7 @@ void MeshBlock::getCartReceptors(CartGrid* cg, parallelComm* pc) auto* xtm = (double*)malloc(sizeof(double) * 3); - for (int j = 0; j < cg->dims[static_cast(3 * c)]; j++) { + for (int j = 0; j < cg->dims[3 * c]; j++) { for (int k = 0; k < cg->dims[3 * c + 1]; k++) { for (int l = 0; l < cg->dims[3 * c + 2]; l++) { fillReceptorDataPtr( @@ -96,7 +94,7 @@ void MeshBlock::getCartReceptors(CartGrid* cg, parallelComm* pc) } } - for (int j = 0; j < cg->dims[static_cast(3 * c)] + 1; j++) { + for (int j = 0; j < cg->dims[3 * c] + 1; j++) { for (int k = 0; k < cg->dims[3 * c + 1] + 1; k++) { for (int l = 0; l < cg->dims[3 * c + 2] + 1; l++) { fillReceptorDataPtr( @@ -187,20 +185,17 @@ void MeshBlock::fillReceptorDataPtr( int itm = -1; if (isNodal) { itm = cart_utils::get_concatenated_node_index( - cg->dims[static_cast(3 * c)], cg->dims[3 * c + 1], - cg->dims[3 * c + 2], cg->nf, j, k, l); + cg->dims[3 * c], cg->dims[3 * c + 1], cg->dims[3 * c + 2], cg->nf, + j, k, l); - xtm[0] = cg->xlo[static_cast(3 * c)] + - j * cg->dx[static_cast(3 * c)]; + xtm[0] = cg->xlo[3 * c] + j * cg->dx[3 * c]; xtm[1] = cg->xlo[3 * c + 1] + k * cg->dx[3 * c + 1]; xtm[2] = cg->xlo[3 * c + 2] + l * cg->dx[3 * c + 2]; } else { itm = cart_utils::get_cell_index( - cg->dims[static_cast(3 * c)], cg->dims[3 * c + 1], cg->nf, j, - k, l); + cg->dims[3 * c], cg->dims[3 * c + 1], cg->nf, j, k, l); - xtm[0] = cg->xlo[static_cast(3 * c)] + - (j + 0.5) * cg->dx[static_cast(3 * c)]; + xtm[0] = cg->xlo[3 * c] + (j + 0.5) * cg->dx[3 * c]; xtm[1] = cg->xlo[3 * c + 1] + (k + 0.5) * cg->dx[3 * c + 1]; xtm[2] = cg->xlo[3 * c + 2] + (l + 0.5) * cg->dx[3 * c + 2]; } diff --git a/src/highOrder.C b/src/highOrder.C index 13c4c76..1045142 100644 --- a/src/highOrder.C +++ b/src/highOrder.C @@ -158,8 +158,7 @@ void MeshBlock::clearOrphans(HOLEMAP* holemap, int nmesh, const int* itmp) if (k != (meshtag - BASE) && (holemap[k].existWall != 0)) { if (checkHoleMap( - &rxyz[static_cast(3 * m)], - holemap[k].nx, holemap[k].sam, + &rxyz[3 * m], holemap[k].nx, holemap[k].sam, holemap[k].extents) != 0) { reject = 1; break; @@ -353,16 +352,14 @@ void MeshBlock::processPointDonors() interpList2[m].inode = (int*)malloc(sizeof(int)); interpList2[m].nweights = 0; donor_frac( - &(icell), &(xsearch[static_cast(3 * i)]), - &(interpList2[m].nweights), &(interpList2[m].inode[0]), - frac, &(rst[static_cast(3 * i)]), &ndim); + &(icell), &(xsearch[3 * i]), &(interpList2[m].nweights), + &(interpList2[m].inode[0]), frac, &(rst[3 * i]), &ndim); interpList2[m].weights = (double*)malloc(sizeof(double) * interpList2[m].nweights); for (j = 0; j < interpList2[m].nweights; j++) { interpList2[m].weights[j] = frac[j]; } - interpList2[m].receptorInfo[0] = - isearch[static_cast(3 * i)]; + interpList2[m].receptorInfo[0] = isearch[3 * i]; interpList2[m].receptorInfo[1] = isearch[3 * i + 1]; interpList2[m].receptorInfo[2] = isearch[3 * i + 2]; m++; @@ -389,15 +386,14 @@ void MeshBlock::processPointDonors() xv[ivert][j] = x[i3 + j]; } } - xp[0] = xsearch[static_cast(3 * i)]; + xp[0] = xsearch[3 * i]; xp[1] = xsearch[3 * i + 1]; xp[2] = xsearch[3 * i + 2]; computeNodalWeights(xv, xp, frac2, nvert); for (j = 0; j < nvert; j++) { interpList2[m].weights[j] = frac2[j]; } - interpList2[m].receptorInfo[0] = - isearch[static_cast(3 * i)]; + interpList2[m].receptorInfo[0] = isearch[3 * i]; interpList2[m].receptorInfo[1] = isearch[3 * i + 1]; interpList2[m].receptorInfo[2] = isearch[3 * i + 2]; m++;