2821 {
2822 TRACE();
2823
2824
2825
2826 static_assert(std::is_same<uint_t, uint32_t>::value || std::is_same<uint_t, uint64_t>::value,
2827 "Invalid template type specified.");
2828 static_assert(sizeof(float) == 4, "VTU output will fail since float has an unexpected size on this architecture.");
2829 const char* const uIDataType = (std::is_same<uint_t, uint64_t>::value) ? "UInt64" : "UInt32";
2830 const char* const uI8DataType = "UInt8";
2831 const char* const uI64DataType = "UInt64";
2832 const char* const dataType = "Float32";
2833 const uint64_t noNodes =
IPOW2(nDim);
2834 const uint8_t baseCellType = (nDim == 3) ? 11 : 8;
2835 const uint8_t polyCellType = 42;
2836
2837 NEW_TIMER_GROUP_STATIC(t_vtuTimer, "writeVtuOutputParallel");
2838 NEW_TIMER_STATIC(t_vtutotal, "VtuOutputParallel", t_vtuTimer);
2839 NEW_SUB_TIMER_STATIC(t_faces, "faces", t_vtutotal);
2840 NEW_SUB_TIMER_STATIC(t_init, "init", t_vtutotal);
2841 NEW_SUB_TIMER_STATIC(t_prepare, "prepare", t_vtutotal);
2842 NEW_SUB_TIMER_STATIC(t_cells, "cells", t_vtutotal);
2843 NEW_SUB_TIMER_STATIC(t_variables, "variables", t_vtutotal);
2844 NEW_SUB_TIMER_STATIC(t_geometry, "geometry", t_vtutotal);
2845 RECORD_TIMER_START(t_vtutotal);
2846 RECORD_TIMER_START(t_faces);
2847
2850 auto connSize = (uint64_t)(noNodes * noCells);
2851 auto facesSize = (uint64_t)0;
2852 vector<uint_t>* facestream = nullptr;
2853 vector<uint_t>* conn = nullptr;
2855 MInt noPolyhedra = 0;
2856 polyhedralCell.fill(-1);
2857 const MBool getInternalPolyhedra =
true;
2859 connSize =
vtuAssembleFaceStream(facestream, conn, facesSize, polyhedralCell, noPolyhedra, getInternalPolyhedra);
2860 if(facestream ==
nullptr || conn ==
nullptr)
mTerm(1, AT_,
"empty stream");
2861 }
2863 RECORD_TIMER_STOP(t_faces);
2864 RECORD_TIMER_START(t_init);
2865
2866
2867 const MBool mergeGridPoints =
true;
2868 const uint64_t noPoints0 = noPoints;
2872 pointRemapId.fill(-1);
2873 if(mergeGridPoints) {
2877 cellMap.fill(-1);
2878 MInt noSendDat0 = 0;
2879 MInt noRecvDat0 = 0;
2880 MInt noSendDatTotal = 0;
2884 }
2889 noCellPoints.fill(0);
2890 noSendDat.fill(0);
2891 noRecvDat.fill(0);
2892 for(
MInt c = 0; c < (signed)noCells; c++) {
2894 }
2896 noSendDatTotal = 0;
2898 noSendDat[i] = 0;
2901 MInt pc = (c > -1) ? polyhedralCell[c] : -1;
2903 if(c > -1) np = (pc > -1) ? conn[pc].size() : noNodes;
2904 noCellPoints(scnt0) = np;
2905 noSendDatTotal += np;
2906 noSendDat[i] += np;
2907 scnt0++;
2908 }
2909 }
2911 sendReq.fill(MPI_REQUEST_NULL);
2912 scnt0 = 0;
2915 mpiComm(), &sendReq[i], AT_,
"(noCellPoints[scnt0])");
2917 }
2921 mpiComm(), MPI_STATUS_IGNORE, AT_,
"(noCellPointsRecv[rcnt0])");
2923 }
2926 MInt noRecvDatTotal = 0;
2927 rcnt0 = 0;
2929 noRecvDat[i] = 0;
2931 noRecvDat[i] += noCellPointsRecv[rcnt0];
2932 noRecvDatTotal += noCellPointsRecv[rcnt0];
2933 rcnt0++;
2934 }
2935 }
2940 scnt0 = 0;
2945 if(noCellPoints(scnt0) > 0) {
2946 if(c < 0) {
2947 cerr << "case should not occur" << endl;
2948 continue;
2949 }
2950 MInt pc = polyhedralCell[c];
2951 MInt noGridPoints = (pc > -1) ? conn[pc].size() : noNodes;
2952 for(
MInt p = 0;
p < noGridPoints;
p++) {
2954 if(gridPointId < 0) cerr << "negative grid point id " << endl;
2955 sendGridPoints(scnt) = gridPointId;
2956 for(
MInt k = 0; k < nDim; k++) {
2958 }
2959 scnt++;
2960 }
2961 }
2962 scnt0++;
2963 }
2964 }
2965
2966 sendReq.fill(MPI_REQUEST_NULL);
2967 scnt = 0;
2970 &sendReq[i], AT_, "(sendGridPoints[scnt])");
2971 scnt += noSendDat[i];
2972 }
2976 MPI_STATUS_IGNORE, AT_, "(recvGridPoints[rcnt])");
2977 rcnt += noRecvDat[i];
2978 }
2981
2982 sendReq.fill(MPI_REQUEST_NULL);
2983 scnt = 0;
2986 mpiComm(), &sendReq[i], AT_,
"(sendGridPointsCoord[scnt])");
2987 scnt += 3 * noSendDat[i];
2988 }
2989 rcnt = 0;
2992 MPI_STATUS_IGNORE, AT_, "(recvGridPointsCoord[rcnt])");
2993 rcnt += 3 * noRecvDat[i];
2994 }
2997
2998 rcnt0 = 0;
2999 rcnt = 0;
3000 map<MInt, MInt> haloMap;
3004 MInt noRecvPoints = noCellPointsRecv[rcnt0];
3005 if(noRecvPoints > 0) {
3006
3008 for(
MInt n = 0; n < counter; n++) {
3009 MInt nghbrId = nghbrList[n];
3010 if(nghbrId < 0) continue;
3012 MInt ncell = cellMap[nghbrId];
3013 if(ncell < 0) continue;
3014 MInt pc = polyhedralCell[ncell];
3017 MInt noPointsNghbr = (pc > -1) ? conn[pc].size() : noNodes;
3018 for(
MInt p = 0;
p < noRecvPoints;
p++) {
3019 for(
MInt q = 0; q < noPointsNghbr; q++) {
3021 if(gridPointId < 0) cerr << "negative grid point id " << endl;
3026 if(delta < delta0) {
3029 pointRemapId[gridPointId] = recvGridPoints[rcnt +
p];
3030 haloMap[gridPointId] = rcnt +
p;
3031 }
3032 }
3033 }
3034 }
3035 }
3036 }
3037 rcnt += noRecvPoints;
3038 rcnt0++;
3039 }
3040 }
3041
3042
3043 noPoints = 0;
3044 for(uint64_t p = 0;
p < noPoints0;
p++) {
3045 if(pointRemapId[p] < 0) {
3046 pointRemapId[
p] = noPoints;
3047 if(pointDomainId[p] !=
domainId()) cerr <<
"unexpected case" << endl;
3048 noPoints++;
3049 }
3050 if(pointRemapId[p] < 0) {
3051 cerr << "unexpected case 2" << endl;
3052 }
3053 }
3054
3055
3056
3057 scnt0 = 0;
3058 scnt = 0;
3062 if(noCellPoints(scnt0) > 0) {
3063 if(c < 0) {
3064 cerr << "case should not occur" << endl;
3065 continue;
3066 }
3067 MInt pc = polyhedralCell[c];
3068 MInt noGridPoints = (pc > -1) ? conn[pc].size() : noNodes;
3069 for(
MInt p = 0;
p < noGridPoints;
p++) {
3071 if(gridPointId < 0) cerr << "negative grid point id " << endl;
3072 sendGridPoints(scnt) = (pointDomainId[gridPointId] ==
domainId()) ? pointRemapId[gridPointId] : -1;
3073 scnt++;
3074 }
3075 }
3076 scnt0++;
3077 }
3078 }
3079 sendReq.fill(MPI_REQUEST_NULL);
3080 scnt = 0;
3083 &sendReq[i], AT_, "(sendGridPoints[scnt])");
3084 scnt += noSendDat[i];
3085 }
3086 rcnt = 0;
3089 MPI_STATUS_IGNORE, AT_, "(recvGridPoints[rcnt])");
3090 rcnt += noRecvDat[i];
3091 }
3094
3095 for(auto& it : haloMap) {
3096 MInt gridPointId = it.first;
3097 MInt otherId = recvGridPoints[it.second];
3098 if(gridPointId < 0 || gridPointId >= (signed)noPoints0) cerr << "point out of range" << endl;
3099 pointRemapId[gridPointId] = otherId;
3100 if(otherId < 0 || (pointDomainId[gridPointId] >=
domainId())) {
3101 cerr << "inconsistent point shifts " << gridPointId << " " << otherId << " " << pointDomainId[gridPointId]
3103 continue;
3104 }
3105 }
3106
3107
3108 } else {
3109 for(uint64_t p = 0;
p < noPoints;
p++) {
3110 pointRemapId[
p] =
p;
3111 }
3112 }
3113
3120 dataPerDomain(
domainId(), 0) = noPoints;
3121 dataPerDomain(
domainId(), 1) = noCells;
3122 dataPerDomain(
domainId(), 2) = connSize;
3123 dataPerDomain(
domainId(), 3) = facesSize;
3124 MPI_Allgather(MPI_IN_PLACE, 4, MPI_UINT64_T, &dataPerDomain[0], 4, MPI_UINT64_T,
mpiComm(), AT_,
"MPI_IN_PLACE",
3125 "dataPerDomain[0]");
3126 pointOffsetsGlobal[0] = 0;
3128 pointOffsetsGlobal[d + 1] = pointOffsetsGlobal[d] + dataPerDomain(d, 0);
3129 noPointsPerDomain[d] = dataPerDomain(d, 0);
3130 noCellsPerDomain[d] = dataPerDomain(d, 1);
3131 connSizePerDomain[d] = dataPerDomain(d, 2);
3132 facesPerDomain[d] = dataPerDomain(d, 3);
3133 }
3134
3135 uint64_t globalNoPoints = 0;
3136 uint64_t globalNoCells = 0;
3137 uint64_t globalConnSize = 0;
3138 uint64_t globalFacesSize = 0;
3139 uint64_t globalPointOffset = 0;
3140 uint64_t globalCellOffset = 0;
3141 uint64_t globalConnSizeOffset = 0;
3142 uint64_t globalFacesOffset = 0;
3143 uint64_t offset = 0;
3145 globalNoPoints += noPointsPerDomain[d];
3146 globalNoCells += noCellsPerDomain[d];
3147 globalConnSize += connSizePerDomain[d];
3148 globalFacesSize += facesPerDomain[d];
3149 }
3151 globalPointOffset += noPointsPerDomain[d];
3152 globalCellOffset += noCellsPerDomain[d];
3153 globalConnSizeOffset += connSizePerDomain[d];
3154 globalFacesOffset += facesPerDomain[d];
3155 }
3156
3157
3158 if(std::is_same<uint_t, uint32_t>::value) {
3159 if(globalNoCells > (uint64_t)std::numeric_limits<uint_t>::max()
3160 || globalNoPoints > (uint64_t)std::numeric_limits<uint_t>::max()) {
3161 return writeVtuOutputParallel<uint64_t>(fileName, geomFileName);
3162 }
3163 }
3164
3165 RECORD_TIMER_STOP(t_init);
3166 RECORD_TIMER_START(t_prepare);
3167
3169
3170
3171 uint64_t pointsMemsize = 3 * noPoints * sizeof(float);
3172 uint64_t pointsMemsizeGlobal = 3 * globalNoPoints * sizeof(float);
3173 uint64_t pointsOffset = 3 * globalPointOffset * sizeof(float);
3176 uint_t cnt = 0;
3177 for(uint_t p = 0;
p < noPoints0;
p++) {
3178 if(pointDomainId[p] !=
domainId())
continue;
3179 for(
MInt i = 0; i < nDim; i++) {
3181 }
3182 IF_CONSTEXPR(nDim == 2) points((
MInt)cnt, 2) = (
float)0.0;
3183 cnt++;
3184 }
3185 insertDataHeader(reinterpret_cast<
char*>(&points(0)), pointsMemsize, pointsMemsizeGlobal, pointsOffset);
3186
3187
3188
3189 uint64_t connectivityMemsize = connSize * sizeof(uint_t);
3190 uint64_t connectivityOffset = globalConnSizeOffset * sizeof(uint_t);
3191 uint64_t connectivityMemsizeGlobal = globalConnSize * sizeof(uint_t);
3193 ScratchSpace<uint_t> connectivity(
mMax(connectivityMaxSize * noNodes, connSize + 20), AT_, "connectivity");
3194 cnt = 0;
3195 for(
MInt c = 0; c < (
signed)noCells; c++) {
3196 MInt pc = polyhedralCell[c];
3197 if(pc < 0) {
3198 for(
MInt p = 0;
p < (signed)noNodes;
p++) {
3203 connectivity(cnt) =
3204 (uint_t)pointOffsetsGlobal[pointDomainId[gridPointId]] + (uint_t)pointRemapId[gridPointId];
3205 cnt++;
3206 }
3207 } else {
3208 ASSERT(cnt + conn[pc].size() <= connectivity.size(), "");
3209 for(
MUint i = 0; i < conn[pc].size(); i++) {
3210 uint_t gridPointId = conn[pc][i];
3211 connectivity(cnt) =
3212 (uint_t)pointOffsetsGlobal[pointDomainId[gridPointId]] + (uint_t)pointRemapId[gridPointId];
3213 cnt++;
3214 }
3215 }
3216 }
3217 for(
MUint i = 0; i < connSize; i++) {
3218 if(connectivity[i] >= globalNoPoints) {
3219 cerr <<
domainId() <<
": invalid grid point " << i <<
" " << connectivity[i] <<
" " << globalPointOffset <<
" "
3220 << noPoints <<
" " << globalNoPoints <<
" " <<
globalTimeStep << endl;
3221 connectivity[i] = 0;
3222 }
3223 }
3224 insertDataHeader(
reinterpret_cast<char*
>(&connectivity(0)), connectivityMemsize, connectivityMemsizeGlobal,
3225 connectivityOffset);
3226
3227
3228
3229 uint64_t offsetsMemsize = noCells * sizeof(uint64_t);
3230 uint64_t offsetsOffset = globalCellOffset * sizeof(uint64_t);
3231 uint64_t offsetsMemsizeGlobal = globalNoCells * sizeof(uint64_t);
3234 uint64_t offs = globalConnSizeOffset;
3235 for(uint64_t c = 0; c < noCells; c++) {
3236 MInt pc = polyhedralCell[c];
3237 if(pc < 0)
3238 offs += (uint64_t)noNodes;
3239 else
3240 offs += (uint64_t)conn[pc].size();
3241 offsets(c) = offs;
3242 if(offsets(c) - globalConnSizeOffset > connSize || offsets(c) > globalConnSize) {
3243 cerr <<
domainId() <<
": invalid offset: " << offsets(c) <<
" " << connSize <<
" " << globalConnSizeOffset
3244 << " " << globalConnSize << endl;
3245 }
3246 }
3247 insertDataHeader(
reinterpret_cast<char*
>(&offsets(0)), offsetsMemsize, offsetsMemsizeGlobal, offsetsOffset);
3248
3249
3250
3251 uint64_t typesMemsize = noCells * sizeof(uint8_t);
3252 uint64_t typesOffset = globalCellOffset * sizeof(uint8_t);
3253 uint64_t typesMemsizeGlobal = globalNoCells * sizeof(uint8_t);
3256 for(
MInt c = 0; c < (signed)noCells; c++) {
3257 MInt pc = polyhedralCell[c];
3258 types(c) = (pc < 0) ? baseCellType : polyCellType;
3259 }
3260 insertDataHeader(
reinterpret_cast<char*
>(&types(0)), typesMemsize, typesMemsizeGlobal, typesOffset);
3261
3262
3263
3264 uint64_t facesMemsize = facesSize * sizeof(uint_t);
3265 uint64_t facesOffset = globalFacesOffset * sizeof(uint_t);
3266 uint64_t facesMemsizeGlobal = globalFacesSize * sizeof(uint_t);
3269 cnt = 0;
3270 for(
MInt c = 0; c < (signed)noCells; c++) {
3271 MInt pc = polyhedralCell[c];
3272 if(pc < 0) {
3273 faces(cnt) = 0;
3274 cnt++;
3275 } else {
3276 if(facestream[pc].empty())
mTerm(1, AT_,
"empty face stream");
3277 if(conn[pc].empty())
mTerm(1, AT_,
"empty conn stream");
3278
3280 const MInt noFaces = facestream[pc][fcnt];
3281 faces(cnt) = facestream[pc][fcnt];
3282 cnt++;
3283 fcnt++;
3284 for(
MInt face = 0; face < noFaces; face++) {
3285 MInt pointCnt = facestream[pc][fcnt];
3286 faces(cnt) = facestream[pc][fcnt];
3287 cnt++;
3288 fcnt++;
3289 for(
MInt p = 0;
p < pointCnt;
p++) {
3290 uint_t gridPointId = facestream[pc][fcnt];
3291 faces(cnt) = (uint_t)pointOffsetsGlobal[pointDomainId[gridPointId]] + (uint_t)pointRemapId[gridPointId];
3292 cnt++;
3293 fcnt++;
3294 }
3295 }
3296 }
3297 }
3298
3299 insertDataHeader(
reinterpret_cast<char*
>(&faces(0)), facesMemsize, facesMemsizeGlobal, facesOffset);
3300
3301
3302
3303 uint64_t faceoffsetsMemsize = noCells * sizeof(uint64_t);
3304 uint64_t faceoffsetsOffset = globalCellOffset * sizeof(uint64_t);
3305 uint64_t faceoffsetsMemsizeGlobal = globalNoCells * sizeof(uint64_t);
3308 offs = globalFacesOffset;
3309 for(
MInt c = 0; c < (signed)noCells; c++) {
3310 MInt pc = polyhedralCell[c];
3311 if(pc < 0)
3312 offs++;
3313 else
3314 offs += (uint64_t)facestream[pc].size();
3315 faceoffsets(c) = offs;
3316 }
3317 insertDataHeader(
reinterpret_cast<char*
>(&faceoffsets(0)), faceoffsetsMemsize, faceoffsetsMemsizeGlobal,
3318 faceoffsetsOffset);
3319
3320
3321
3323 uint64_t globalIdOffset = globalCellOffset * sizeof(uint_t);
3324 uint64_t globalIdMemsizeGlobal = globalNoCells * sizeof(uint_t);
3328 for(uint_t c = 0; c < noCells; c++) {
3333 }
3334 insertDataHeader(
reinterpret_cast<char*
>(&globalId(0)), globalIdMemsize, globalIdMemsizeGlobal, globalIdOffset);
3335 }
3336
3337
3338
3340 uint64_t domainIdsOffset = globalCellOffset * sizeof(uint_t);
3341 uint64_t domainIdsMemsizeGlobal = globalNoCells * sizeof(uint_t);
3345 for(uint_t c = 0; c < noCells; c++) {
3347 }
3348
3349 insertDataHeader(
reinterpret_cast<char*
>(&domainIds(0)), domainIdsMemsize, domainIdsMemsizeGlobal,
3350 domainIdsOffset);
3351 }
3352
3353
3354
3359 uint64_t velocityMemsize = 3 * dataSize * sizeof(float);
3362 uint64_t pressureMemsize = dataSize * sizeof(float);
3368 uint64_t solverSpecificVarsMemsize = noSolverSpecificVars > 0 ? dataSize * sizeof(float) * noSolverSpecificVars : 0;
3369 uint64_t userVarsMemsize = noUserVars > 0 ? dataSize * sizeof(float) * noUserVars : 0;
3370 uint64_t velocityOffset = 3 * globalDataOffset * sizeof(float);
3373 uint64_t pressureOffset = globalDataOffset * sizeof(float);
3379 uint64_t solverSpecificVarsOffset =
3380 noSolverSpecificVars > 0 ? globalDataOffset * sizeof(float) * noSolverSpecificVars : 0;
3381 uint64_t userVarsOffset = noUserVars > 0 ? globalDataOffset * sizeof(float) * noUserVars : 0;
3382 uint64_t userVarsMemsizeGlobal = noUserVars > 0 ? globalDataSize * noUserVars * sizeof(float) : 0;
3383 uint64_t solverSpecificVarsMemsizeGlobal =
3384 noSolverSpecificVars > 0 ? globalDataSize * noSolverSpecificVars * sizeof(float) : 0;
3385 uint64_t velocityMemsizeGlobal = 3 * globalDataSize * sizeof(float);
3388 uint64_t pressureMemsizeGlobal = globalDataSize * sizeof(float);
3405 ScratchSpace<float> solverSpecificVarsOut(noSolverSpecificVars > 0 ? scalarMaxSize * noSolverSpecificVars : 0, AT_,
3406 "solverSpecificVars");
3407 ScratchSpace<float> userVarsOut(noUserVars > 0 ? scalarMaxSize * noUserVars : 0, AT_,
"userVars");
3409 for(
MInt p = 0;
p < (signed)noPoints;
p++) {
3410 for(
MInt i = 0; i < 3; i++)
3411 velocity(p, i) = (float)0.0;
3412 for(
MInt i = 0; i < noUserVars; i++)
3413 userVarsOut[p * noUserVars + i] = (float)0.0;
3414 for(
MInt i = 0; i < noSolverSpecificVars; i++)
3415 solverSpecificVarsOut[p * noSolverSpecificVars + i] = (float)0.0;
3417 for(
MInt i = 0; i < nDim; i++)
3418 vorticity(p, i) = (float)0.0;
3420 for(
MInt i = 0; i < nDim * nDim; i++)
3421 velGrad(p, i) = (float)0.0;
3422 pressure(p) = (float)0.0;
3432 for(
MInt i = 0; i < nDim; i++) {
3434 }
3437 float q = F0;
3438 IF_CONSTEXPR(nDim == 3) {
3439 for(
MInt i = 0; i < nDim; i++)
3440 for(
MInt j = 0; j < nDim; j++)
3447 q *= F1B2;
3448 }
3449 else {
3450 q += dx * F1B2
3453 }
3454 Q(p) += dx * q;
3455 }
3456 for(
MInt i = 0; i < nDim; i++)
3459 ASSERT(nDim == 3, "");
3460 vorticity(p, 0) +=
3461 dx * F1B2
3463 vorticity(p, 1) +=
3464 dx * F1B2
3466 vorticity(p, 2) +=
3467 dx * F1B2
3469 }
3471 for(
MInt i = 0; i < nDim; i++) {
3472 for(
MInt j = 0; j < nDim; j++) {
3474 }
3475 }
3476 }
3482 for(
MInt i = 0; i < nDim; i++) {
3483 for(
MInt j = 0; j < nDim; j++) {
3484 O[i][j] = F1B2
3488 S[i][j] = F1B2
3492 }
3493 }
3494 for(
MInt i = 0; i < nDim; i++) {
3495 for(
MInt j = 0; j < nDim; j++) {
3496 vGrad[i][j] = F0;
3497 for(
MInt k = 0; k < nDim; k++) {
3498 vGrad[i][j] += O[i][k] * O[k][j];
3499 vGrad[i][j] += S[i][k] * S[k][j];
3500 }
3501 }
3502 }
3504 sort(eigenVal, eigenVal + 3);
3505 lambda2(p) += dx * eigenVal[1];
3506 }
3514 }
3515 sum += dx;
3516 }
3517 for(
MInt i = 0; i < nDim; i++)
3518 velocity(p, i) /= sum;
3520 for(
MInt i = 0; i < nDim; i++)
3521 vorticity(p, i) /= sum;
3523 for(
MInt i = 0; i < nDim * nDim; i++)
3524 velGrad(p, i) /= sum;
3525 pressure(p) /= sum;
3530 }
3531 } else {
3532 for(
MInt c = 0; c < (signed)noCells; c++) {
3534 for(
MInt i = 0; i < nDim; i++)
3536 for(
MInt i = 0; i < noUserVars; i++)
3537 userVarsOut[c * noUserVars + i] = userVars[noUserVars * cellId + i];
3538 for(
MInt i = 0; i < noSolverSpecificVars; i++)
3539 solverSpecificVarsOut[c * noSolverSpecificVars + i] = solverSpecificVars[noSolverSpecificVars * cellId + i];
3549 if(noSolverSpecificVars > 0) {
3550 levelSet(c) = solverSpecificVars[noSolverSpecificVars *
cellId];
3551 } else {
3552 ASSERT(false, "levelSet output failed for levelSetMb with constructGField.");
3553 levelSet(c) = F0;
3554
3555 }
3556 } else {
3559 }
3560 }
3562 Q(c) = F0;
3563 IF_CONSTEXPR(nDim == 3) {
3564 for(
MInt i = 0; i < nDim; i++)
3565 for(
MInt j = 0; j < nDim; j++)
3572 Q(c) *= F1B2;
3573 }
3574 else {
3575 Q(c) =
3576 F1B2
3578 }
3579 }
3585 for(
MInt i = 0; i < nDim; i++) {
3586 for(
MInt j = 0; j < nDim; j++) {
3587 O[i][j] = F1B2
3591 S[i][j] = F1B2
3595 }
3596 }
3597 for(
MInt i = 0; i < nDim; i++) {
3598 for(
MInt j = 0; j < nDim; j++) {
3599 vGrad[i][j] = F0;
3600 for(
MInt k = 0; k < nDim; k++) {
3601 vGrad[i][j] += O[i][k] * O[k][j];
3602 vGrad[i][j] += S[i][k] * S[k][j];
3603 }
3604 }
3605 }
3607 sort(eigenVal, eigenVal + 3);
3608 lambda2(c) = eigenVal[1];
3609 }
3611 ASSERT(nDim == 3, "");
3612 vorticity(c, 0) =
3613 F1B2
3615 vorticity(c, 1) =
3616 F1B2
3618 vorticity(c, 2) =
3619 F1B2
3621 }
3623 for(
MInt i = 0; i < nDim; i++) {
3624 for(
MInt j = 0; j < nDim; j++) {
3626 }
3627 }
3628 }
3629 }
3630 }
3631 IF_CONSTEXPR(nDim == 2)
3632 for(
MInt c = 0; c < (
signed)noCells; c++)
3633 velocity(c, 2) = (float)0.0;
3634
3635 insertDataHeader(reinterpret_cast<
char*>(&velocity(0)), velocityMemsize, velocityMemsizeGlobal, velocityOffset);
3637 insertDataHeader(reinterpret_cast<
char*>(&vorticity(0)), vorticityMemsize, vorticityMemsizeGlobal,
3638 vorticityOffset);
3639 if(
m_solver->m_vtuVelocityGradientOutput)
3640 insertDataHeader(reinterpret_cast<
char*>(&velGrad(0)), velGradMemsize, velGradMemsizeGlobal, velGradOffset);
3641 insertDataHeader(reinterpret_cast<
char*>(&pressure(0)), pressureMemsize, pressureMemsizeGlobal, pressureOffset);
3643 insertDataHeader(reinterpret_cast<
char*>(&density(0)), densityMemsize, densityMemsizeGlobal, densityOffset);
3645 insertDataHeader(reinterpret_cast<
char*>(&progress(0)), progressMemsize, progressMemsizeGlobal, progressOffset);
3647 insertDataHeader(reinterpret_cast<
char*>(&levelSet(0)), levelSetMemsize, levelSetMemsizeGlobal, levelSetOffset);
3648 if(
m_solver->m_vtuQCriterionOutput)
3649 insertDataHeader(reinterpret_cast<
char*>(&Q(0)), QMemsize, QMemsizeGlobal, QOffset);
3651 insertDataHeader(reinterpret_cast<
char*>(&lambda2(0)), L2Memsize, L2MemsizeGlobal, L2Offset);
3652 if(noUserVars > 0)
3653 insertDataHeader(reinterpret_cast<
char*>(&userVarsOut(0)), userVarsMemsize, userVarsMemsizeGlobal,
3654 userVarsOffset);
3655 if(noSolverSpecificVars > 0)
3656 insertDataHeader(reinterpret_cast<
char*>(&solverSpecificVarsOut(0)), solverSpecificVarsMemsize,
3657 solverSpecificVarsMemsizeGlobal, solverSpecificVarsOffset);
3658
3659
3660 RECORD_TIMER_STOP(t_prepare);
3661 RECORD_TIMER_START(t_cells);
3662
3664 ofstream ofl;
3665 ofl.open(fileName.c_str(), ios_base::out | ios_base::trunc);
3666 if(ofl.is_open() && ofl.good()) {
3667
3668 ofl << "<?xml version=\"1.0\"?>" << endl;
3669 ofl << R"(<VTKFile type="UnstructuredGrid" version="1.0" byte_order="LittleEndian" header_type="UInt64">)"
3670 << endl;
3671 ofl << "<UnstructuredGrid>" << endl;
3672
3673
3674 ofl << "<Piece NumberOfPoints=\"" << globalNoPoints << "\" NumberOfCells=\"" << globalNoCells << "\">" << endl;
3675
3676
3677
3678 ofl << "<Points>" << endl;
3679 ofl << "<DataArray type=\"" << dataType << R"(" NumberOfComponents="3" format="appended" offset=")" << offset
3680 << "\"/>" << endl;
3681 offset += pointsMemsizeGlobal;
3682 ofl << "</Points>" << endl;
3683
3684
3685
3686 ofl << "<Cells>" << endl;
3687 ofl << "<DataArray type=\"" << uIDataType << R"(" Name="connectivity" format="appended" offset=")" << offset
3688 << "\"/>" << endl;
3689 offset += connectivityMemsizeGlobal;
3690 ofl << "<DataArray type=\"" << uI64DataType << R"(" Name="offsets" format="appended" offset=")" << offset
3691 << "\"/>" << endl;
3692 offset += offsetsMemsizeGlobal;
3693 ofl << "<DataArray type=\"" << uI8DataType << R"(" Name="types" format="appended" offset=")" << offset << "\"/>"
3694 << endl;
3695 offset += typesMemsizeGlobal;
3697 ofl << "<DataArray type=\"" << uIDataType << R"(" Name="faces" format="appended" offset=")" << offset
3698 << "\"/>" << endl;
3699 offset += facesMemsizeGlobal;
3700 ofl << "<DataArray type=\"" << uI64DataType << R"(" Name="faceoffsets" format="appended" offset=")" << offset
3701 << "\"/>" << endl;
3702 offset += faceoffsetsMemsizeGlobal;
3703 }
3704 ofl << "</Cells>" << endl;
3705
3706
3707
3708 ofl << "<CellData Scalars=\"scalars\">" << endl;
3710 ofl << "<DataArray type=\"" << uIDataType << R"(" Name="globalId" format="appended" offset=")" << offset
3711 << "\"/>" << endl;
3712 offset += globalIdMemsizeGlobal;
3713 }
3715 ofl << "<DataArray type=\"" << uIDataType << R"(" Name="domainId" format="appended" offset=")" << offset
3716 << "\"/>" << endl;
3717 offset += domainIdsMemsizeGlobal;
3718 }
3721 ofl << "<DataArray type=\"" << dataType
3722 << R"(" Name="velocity" NumberOfComponents="3" format="appended" offset=")" << offset << "\"/>" << endl;
3723 offset += velocityMemsizeGlobal;
3725 ofl << "<DataArray type=\"" << dataType
3726 << R"(" Name="vorticity" NumberOfComponents="3" format="appended" offset=")" << offset << "\"/>" << endl;
3729 ofl << "<DataArray type=\"" << dataType
3730 << R"(" Name="velocityGradient" NumberOfComponents="9" format="appended" offset=")" << offset << "\"/>"
3731 << endl;
3733 ofl << "<DataArray type=\"" << dataType << R"(" Name="pressure" format="appended" offset=")" << offset << "\"/>"
3734 << endl;
3735 offset += pressureMemsizeGlobal;
3737 ofl << "<DataArray type=\"" << dataType << R"(" Name="density" format="appended" offset=")" << offset
3738 << "\"/>" << endl;
3739 offset += densityMemsizeGlobal;
3740 }
3742 ofl << "<DataArray type=\"" << dataType << R"(" Name="C" format="appended" offset=")" << offset << "\"/>"
3743 << endl;
3744 offset += progressMemsizeGlobal;
3745 }
3747 ofl << "<DataArray type=\"" << dataType << R"(" Name="levelSet" format="appended" offset=")" << offset
3748 << "\"/>" << endl;
3749 offset += levelSetMemsizeGlobal;
3750 }
3752 IF_CONSTEXPR(nDim == 3)
3753 ofl << "<DataArray type=\"" << dataType << R"(" Name="Q" format="appended" offset=")" << offset << "\"/>"
3754 << endl;
3755 IF_CONSTEXPR(nDim == 2)
3756 ofl << "<DataArray type=\"" << dataType << R"(" Name="vorticity" format="appended" offset=")" << offset
3757 << "\"/>" << endl;
3758 offset += QMemsizeGlobal;
3759 }
3761 ofl << "<DataArray type=\"" << dataType << R"(" Name="lambda2" format="appended" offset=")" << offset
3762 << "\"/>" << endl;
3763 offset += L2MemsizeGlobal;
3764 }
3766 ofl << "</PointData>" << endl;
3767 else
3768 ofl << "</CellData>" << endl;
3769
3771 : noSolverSpecificVars > 0) {
3772 ofl << "<DataArray type=\"" << dataType << "\" Name=\"userVars\" NumberOfComponents=\""
3773 << noSolverSpecificVars << "\" format=\"appended\" offset=\"" << offset << "\"/>" << endl;
3774 offset += solverSpecificVarsMemsizeGlobal;
3775 }
3776
3777 if(noUserVars > 0) {
3778 ofl << "<DataArray type=\"" << dataType << "\" Name=\"userVars\" NumberOfComponents=\"" << noUserVars
3779 << "\" format=\"appended\" offset=\"" << offset << "\"/>" << endl;
3780 offset += userVarsMemsizeGlobal;
3781 }
3782
3783
3784 ofl << "</Piece>" << endl;
3785
3786
3787 ofl << "<FieldData>" << endl;
3788
3789 ofl << "<DataArray type=\"" << uIDataType << R"(" Name="globalTimeStep" format="ascii" NumberOfTuples="1" > )"
3792 ofl << "<DataArray type=\"" << dataType << R"(" Name="time" format="ascii" NumberOfTuples="1" > )"
3794 ofl << "<DataArray type=\"" << dataType << R"(" Name="internalTime" format="ascii" NumberOfTuples="1" > )"
3796 } else {
3797 ofl << "<DataArray type=\"" << dataType << R"(" Name="time" format="ascii" NumberOfTuples="1" > )"
3799 ofl << "<DataArray type=\"" << dataType << R"(" Name="physicalTime" format="ascii" NumberOfTuples="1" > )"
3801 }
3802 ofl << "<DataArray type=\"" << dataType << R"(" Name="timeStep" format="ascii" NumberOfTuples="1" > )"
3804 ofl << "<DataArray type=\"" << dataType << R"(" Name="timeRef" format="ascii" NumberOfTuples="1" > )"
3806 ofl << "<DataArray type=\"" << dataType << R"(" Name="Ma" format="ascii" NumberOfTuples="1" > )"
3808 ofl << "<DataArray type=\"" << dataType << R"(" Name="Re" format="ascii" NumberOfTuples="1" > )"
3810 ofl << "<DataArray type=\"" << dataType << R"(" Name="Re0" format="ascii" NumberOfTuples="1" > )"
3811 << sysEqn().m_Re0 << " </DataArray>" << endl;
3812 ofl << "<DataArray type=\"" << dataType << R"(" Name="Pr" format="ascii" NumberOfTuples="1" > )"
3814 ofl << "<DataArray type=\"" << dataType << R"(" Name="gamma" format="ascii" NumberOfTuples="1" > )"
3816 ofl << "<DataArray type=\"" << dataType << R"(" Name="Tref" format="ascii" NumberOfTuples="1" > )"
3818 ofl << "<DataArray type=\"" << dataType << R"(" Name="Lref" format="ascii" NumberOfTuples="1" > )"
3820 ofl << "<DataArray type=\"" << dataType << R"(" Name="LrefPhys" format="ascii" NumberOfTuples="1" > )" << F1
3821 << " </DataArray>" << endl;
3822 ofl << "<DataArray type=\"" << dataType << R"(" Name="CFL" format="ascii" NumberOfTuples="1" > )"
3824 ofl << "<DataArray type=\"" << dataType << R"(" Name="uInf" format="ascii" NumberOfTuples="1" > )"
3826 ofl << "<DataArray type=\"" << dataType << R"(" Name="vInf" format="ascii" NumberOfTuples="1" > )"
3828 IF_CONSTEXPR(nDim == 3)
3829 ofl << "<DataArray type=\"" << dataType << R"(" Name="wInf" format="ascii" NumberOfTuples="1" > )"
3830 <<
m_solver->m_WInfinity << " </DataArray>" << endl;
3831 ofl << "<DataArray type=\"" << dataType << R"(" Name="pInf" format="ascii" NumberOfTuples="1" > )"
3832 <<
m_solver->m_PInfinity << " </DataArray>" << endl;
3833 ofl << "<DataArray type=\"" << dataType << R"(" Name="rhoInf" format="ascii" NumberOfTuples="1" > )"
3834 <<
m_solver->m_rhoInfinity << " </DataArray>" << endl;
3835 ofl << "<DataArray type=\"" << dataType << R"(" Name="TInf" format="ascii" NumberOfTuples="1" > )"
3836 <<
m_solver->m_TInfinity << " </DataArray>" << endl;
3837 ofl << "<DataArray type=\"" << dataType << R"(" Name="muInf" format="ascii" NumberOfTuples="1" > )"
3838 <<
sysEqn().m_muInfinity << " </DataArray>" << endl;
3839 ofl << "<DataArray type=\"" << dataType << R"(" Name="length0" format="ascii" NumberOfTuples="1" > )"
3840 <<
m_solver->c_cellLengthAtLevel(0) << " </DataArray>" << endl;
3841 ofl << "<DataArray type=\"" << dataType << R"(" Name="lengthMax" format="ascii" NumberOfTuples="1" > )"
3842 <<
m_solver->c_cellLengthAtLevel(
m_solver->minLevel()) << " </DataArray>" << endl;
3843 ofl << "<DataArray type=\"" << dataType << R"(" Name="lengthMin" format="ascii" NumberOfTuples="1" > )"
3844 <<
m_solver->c_cellLengthAtLevel(
m_solver->maxLevel()) << " </DataArray>" << endl;
3845 ofl << "<DataArray type=\"" << uIDataType << R"(" Name="minLevel" format="ascii" NumberOfTuples="1" > )"
3846 <<
m_solver->minLevel() << " </DataArray>" << endl;
3847 ofl << "<DataArray type=\"" << uIDataType << R"(" Name="maxLevel" format="ascii" NumberOfTuples="1" > )"
3848 <<
m_solver->maxLevel() << " </DataArray>" << endl;
3850 ofl << "<DataArray type=\"" << uIDataType << R"(" Name="domainOffsets" format="ascii" NumberOfTuples=")"
3854 }
3855 ofl << " </DataArray>" << endl;
3856 }
3857 ofl << "</FieldData>" << endl;
3858
3859
3860 ofl << "</UnstructuredGrid>" << endl;
3861
3862
3863 ofl << "<AppendedData encoding=\"raw\">" << endl;
3864 ofl << "_";
3865 ofl.close();
3866 ofl.clear();
3867
3869 cout << system(("cp " + fileName + " " + fileName + "_header_testing").c_str());
3870 }
3871 } else {
3872 cerr << "ERROR! COULD NOT OPEN FILE " << fileName << " for writing! (1)" << endl;
3873 }
3874 }
3875
3876
3877
3878 MPI_File file = nullptr;
3880 MPI_INFO_NULL, &file, AT_);
3881 if(rcode != MPI_SUCCESS)
mTerm(1, AT_,
"Error opening file " + fileName);
3882
3883
3885 if(rcode != MPI_SUCCESS)
mTerm(1, AT_,
"Error (1) writing to file " + fileName);
3886
3887
3889 connectivityMemsizeGlobal);
3890 if(rcode != MPI_SUCCESS) {
3891 mTerm(1, AT_,
"Error (2) writing to file " + fileName);
3892 }
3893
3894
3895 rcode =
writeVtuArrayParallel(file, &offsets(0), offsetsOffset, offsetsMemsize, offsetsMemsizeGlobal);
3896 if(rcode != MPI_SUCCESS) {
3897 mTerm(1, AT_,
"Error (3) writing to file " + fileName);
3898 }
3899
3900
3902 if(rcode != MPI_SUCCESS)
mTerm(1, AT_,
"Error (4) writing to file " + fileName);
3903
3904
3907 if(rcode != MPI_SUCCESS)
mTerm(1, AT_,
"Error (5) writing to file " + fileName);
3908
3909
3911 rcode =
3912 writeVtuArrayParallel(file, &faceoffsets(0), faceoffsetsOffset, faceoffsetsMemsize, faceoffsetsMemsizeGlobal);
3913 if(rcode != MPI_SUCCESS)
mTerm(1, AT_,
"Error (5) writing to file " + fileName);
3914
3915 RECORD_TIMER_STOP(t_cells);
3916 RECORD_TIMER_START(t_variables);
3917
3918
3920 rcode =
writeVtuArrayParallel(file, &globalId(0), globalIdOffset, globalIdMemsize, globalIdMemsizeGlobal);
3921 if(rcode != MPI_SUCCESS)
mTerm(1, AT_,
"Error (5) writing to file " + fileName);
3922
3923
3925 rcode =
writeVtuArrayParallel(file, &domainIds(0), domainIdsOffset, domainIdsMemsize, domainIdsMemsizeGlobal);
3926 if(rcode != MPI_SUCCESS)
mTerm(1, AT_,
"Error (5) writing to file " + fileName);
3927
3928
3929 rcode =
writeVtuArrayParallel(file, &velocity(0), velocityOffset, velocityMemsize, velocityMemsizeGlobal);
3930 if(rcode != MPI_SUCCESS)
mTerm(1, AT_,
"Error (6) writing to file " + fileName);
3931
3932
3934 rcode =
writeVtuArrayParallel(file, &vorticity(0), vorticityOffset, vorticityMemsize, vorticityMemsizeGlobal);
3935 if(rcode != MPI_SUCCESS)
mTerm(1, AT_,
"Error (7) writing to file " + fileName);
3936
3937
3939 rcode =
writeVtuArrayParallel(file, &velGrad(0), velGradOffset, velGradMemsize, velGradMemsizeGlobal);
3940 if(rcode != MPI_SUCCESS)
mTerm(1, AT_,
"Error (7) writing to file " + fileName);
3941
3942
3943 rcode =
writeVtuArrayParallel(file, &pressure(0), pressureOffset, pressureMemsize, pressureMemsizeGlobal);
3944 if(rcode != MPI_SUCCESS) {
3945 mTerm(1, AT_,
"Error (8) writing to file " + fileName);
3946 }
3947
3948
3950 rcode =
writeVtuArrayParallel(file, &density(0), densityOffset, densityMemsize, densityMemsizeGlobal);
3951 if(rcode != MPI_SUCCESS)
mTerm(1, AT_,
"Error (9) writing to file " + fileName);
3952
3954
3955 rcode =
writeVtuArrayParallel(file, &progress(0), progressOffset, progressMemsize, progressMemsizeGlobal);
3956 if(rcode != MPI_SUCCESS) {
3957 mTerm(1, AT_,
"Error (9) writing to file " + fileName);
3958 }
3959 }
3960
3962 rcode =
writeVtuArrayParallel(file, &levelSet(0), levelSetOffset, levelSetMemsize, levelSetMemsizeGlobal);
3963 if(rcode != MPI_SUCCESS)
mTerm(1, AT_,
"Error (9) writing to file " + fileName);
3964 }
3965
3967 if(rcode != MPI_SUCCESS)
mTerm(1, AT_,
"Error (10) writing to file " + fileName);
3968
3969
3972 if(rcode != MPI_SUCCESS) {
3973 mTerm(1, AT_,
"Error (11) writing to file " + fileName);
3974 }
3975
3976
3979 solverSpecificVarsMemsize, solverSpecificVarsMemsizeGlobal);
3980 if(rcode != MPI_SUCCESS) {
3981 mTerm(1, AT_,
"Error (12) writing to file " + fileName);
3982 }
3983
3984
3985 if(noUserVars > 0)
3986 rcode =
writeVtuArrayParallel(file, &userVarsOut(0), userVarsOffset, userVarsMemsize, userVarsMemsizeGlobal);
3987 if(rcode != MPI_SUCCESS) {
3988 mTerm(1, AT_,
"Error (13) writing to file " + fileName);
3989 }
3990
3992
3993
3994
3996 ofstream ofl;
3997 ofl.open(fileName.c_str(), ios_base::out | ios_base::app);
3998 if(ofl.is_open() && ofl.good()) {
3999 ofl << endl;
4000 ofl << "</AppendedData>" << endl;
4001 ofl << "</VTKFile>" << endl;
4002 ofl.close();
4003 ofl.clear();
4004
4005
4006 } else {
4007 cerr << "ERROR! COULD NOT OPEN FILE " << fileName << " for writing! (2)" << endl;
4008 }
4009 }
4010
4011
4012
4013
4014
4018 }
4019 ofstream ofile;
4020 ofstream ofile2;
4022 ofile.open("out/QOUT.pvd.tmp", ios_base::out | ios_base::trunc);
4023 else
4024 ofile.open("out/QOUT.pvd.tmp", ios_base::out | ios_base::app);
4025 if(ofile.is_open() && ofile.good()) {
4027 ofile << R"(<VTKFile type="Collection" version="0.1" byte_order="LittleEndian">)" << endl;
4028 ofile << "<Collection>" << endl;
4029 }
4033 ofile <<
"<DataSet part=\"" << 0 <<
"\" timestep=\"" <<
globalTimeStep <<
"\" file=\""
4034 << "./" << fname << "\"/>" << endl;
4035 ofile.close();
4036 ofile.clear();
4037 } else {
4038 cerr << "Error opening file out/QOUT.pvd.tmp" << endl;
4039 }
4040 m_log <<
"Command executed with return value: " << system(
"cp out/QOUT.pvd.tmp out/QOUT.pvd") <<
" at " << AT_
4041 << endl;
4042
4043 ofile2.
open(
"out/QOUT.pvd", ios_base::out | ios_base::app);
4044 if(ofile2.is_open() && ofile2.good()) {
4045 ofile2 << "</Collection>" << endl;
4046 ofile2 << "</VTKFile>" << endl;
4047 ofile2.close();
4048 ofile2.clear();
4049 } else {
4050 cerr << "Error opening file out/QOUT.pvd" << endl;
4051 }
4053 }
4054
4055 RECORD_TIMER_STOP(t_variables);
4056 RECORD_TIMER_START(t_geometry);
4057 }
4058
4059
4066 }
4070 }
4074 facesSize = 0;
4075 noPolyhedra = 0;
4079 if(bndryId > -1) {
4080 polyhedralCell[c] = noPolyhedra;
4081 noPolyhedra++;
4082 }
4083 }
4085 }
4086
4087 if(!(facestream == nullptr || conn == nullptr)) {
4088 uint64_t noPolygons = 0;
4089 uint64_t geomConnSize = 0;
4092 const MInt pc = polyhedralCell[c];
4093 if(bndryId < 0) continue;
4094 uint_t cnt = 1;
4097 continue;
4098 noPolygons++;
4099 geomConnSize += (uint64_t)facestream[pc][cnt];
4100 cnt += (uint_t)(facestream[pc][cnt] + 1);
4101 }
4102 }
4103
4108 cutPoints.fill(std::numeric_limits<uint_t>::max());
4109 uint64_t noGeomPoints = 0;
4110 geomConnSize = 0;
4111 noPolygons = 0;
4114 const MInt pc = polyhedralCell[c];
4115 if(pc < 0) continue;
4116 if(bndryId < 0) continue;
4117 if(facestream[pc].empty()) continue;
4119 uint_t cnt = 1;
4122 continue;
4123 ASSERT(cnt < facestream[pc].size(), "");
4124 MInt noCutPoints = (signed)facestream[pc][cnt];
4125 cnt++;
4126 for(
MInt cp = 0; cp < noCutPoints; cp++) {
4127 ASSERT(cnt < facestream[pc].size(), "");
4128 uint_t gridPointId = (uint_t)facestream[pc][cnt];
4129 uint_t pId = cutPoints[gridPointId];
4131 pId = noGeomPoints;
4132 cutPoints[gridPointId] = pId;
4133 for(
MInt i = 0; i < nDim; i++) {
4135 }
4136 noGeomPoints++;
4137 }
4138 geomConn[geomConnSize] = pId;
4139 cnt++;
4140 geomConnSize++;
4141 }
4142 geomOffsets[noPolygons] = geomConnSize;
4143 noPolygons++;
4144 }
4145 }
4146
4151 geomDataPerDomain(
domainId(), 0) = noGeomPoints;
4152 geomDataPerDomain(
domainId(), 1) = noPolygons;
4153 geomDataPerDomain(
domainId(), 2) = geomConnSize;
4154 MPI_Allgather(MPI_IN_PLACE, 3, MPI_UINT64_T, &geomDataPerDomain[0], 3, MPI_UINT64_T,
mpiComm(), AT_,
4155 "MPI_IN_PLACE", "geomDataPerDomain[0]");
4157 noGeomPointsPerDomain[d] = geomDataPerDomain(d, 0);
4158 noPolygonsPerDomain[d] = geomDataPerDomain(d, 1);
4159 geomConnSizePerDomain[d] = geomDataPerDomain(d, 2);
4160 }
4161 uint64_t globalNoGeomPoints = 0;
4162 uint64_t globalGeomPointOffset = 0;
4163 uint64_t globalNoPolygons = 0;
4164 uint64_t globalPolygonsOffset = 0;
4165 uint64_t globalGeomConnSize = 0;
4166 uint64_t globalGeomConnSizeOffset = 0;
4168 globalNoGeomPoints += noGeomPointsPerDomain[d];
4169 globalNoPolygons += noPolygonsPerDomain[d];
4170 globalGeomConnSize += geomConnSizePerDomain[d];
4171 }
4173 globalGeomPointOffset += noGeomPointsPerDomain[d];
4174 globalPolygonsOffset += noPolygonsPerDomain[d];
4175 globalGeomConnSizeOffset += geomConnSizePerDomain[d];
4176 }
4177
4178 for(
MUint p = 0;
p < noPolygons;
p++) {
4179 geomOffsets[
p] += globalGeomConnSizeOffset;
4180 }
4181 for(
MUint c = 0; c < geomConnSize; c++) {
4182 geomConn[c] += globalGeomPointOffset;
4183 }
4184
4185 if(globalNoPolygons == 0) {
4186 RECORD_TIMER_STOP(t_geometry);
4187 RECORD_TIMER_STOP(t_vtutotal);
4188 DISPLAY_TIMER_INTERM(t_vtutotal);
4189 return;
4190 }
4191
4192
4193
4194
4195 uint64_t geomPointsMemsize = 3 * noGeomPoints * sizeof(float);
4196 uint64_t geomPointsMemsizeGlobal = 3 * globalNoGeomPoints * sizeof(float);
4197 uint64_t geomPointsOffset = 3 * globalGeomPointOffset * sizeof(float);
4198 insertDataHeader(
reinterpret_cast<char*
>(&geomPoints(0)), geomPointsMemsize, geomPointsMemsizeGlobal,
4199 geomPointsOffset);
4200
4201
4202
4203 uint64_t geomConnMemsize = geomConnSize * sizeof(uint_t);
4204 uint64_t geomConnOffset = globalGeomConnSizeOffset * sizeof(uint_t);
4205 uint64_t geomConnMemsizeGlobal = globalGeomConnSize * sizeof(uint_t);
4206 insertDataHeader(
reinterpret_cast<char*
>(&geomConn(0)), geomConnMemsize, geomConnMemsizeGlobal, geomConnOffset);
4207
4208
4209
4210 uint64_t geomOffsetsMemsize = noPolygons * sizeof(uint_t);
4211 uint64_t geomOffsetsOffset = globalPolygonsOffset * sizeof(uint_t);
4212 uint64_t geomOffsetsMemsizeGlobal = globalNoPolygons * sizeof(uint_t);
4213 insertDataHeader(
reinterpret_cast<char*
>(&geomOffsets(0)), geomOffsetsMemsize, geomOffsetsMemsizeGlobal,
4214 geomOffsetsOffset);
4215
4216
4217
4218 uint64_t bodyIdMemsize = noPolygons * sizeof(uint_t);
4219 uint64_t velocityMemsize = 3 * noPolygons * sizeof(float);
4220 uint64_t domainIdsMemsize = noPolygons * sizeof(uint_t);
4221 uint64_t pressureMemsize = noPolygons * sizeof(float);
4222 uint64_t densityMemsize = noPolygons * sizeof(float);
4223 uint64_t normalsMemsize = 3 * noPolygons * sizeof(float);
4224 uint64_t shearMemsize = 3 * noPolygons * sizeof(float);
4225 uint64_t bodyIdOffset = globalPolygonsOffset * sizeof(uint_t);
4226 uint64_t velocityOffset = 3 * globalPolygonsOffset * sizeof(float);
4227 uint64_t domainIdsOffset = globalPolygonsOffset * sizeof(uint_t);
4228 uint64_t pressureOffset = globalPolygonsOffset * sizeof(float);
4229 uint64_t densityOffset = globalPolygonsOffset * sizeof(float);
4230 uint64_t normalsOffset = 3 * globalPolygonsOffset * sizeof(float);
4231 uint64_t shearOffset = 3 * globalPolygonsOffset * sizeof(float);
4232 uint64_t bodyIdMemsizeGlobal = globalNoPolygons * sizeof(uint_t);
4233 uint64_t velocityMemsizeGlobal = 3 * globalNoPolygons * sizeof(float);
4234 uint64_t domainIdsMemsizeGlobal = globalNoPolygons * sizeof(uint_t);
4235 uint64_t pressureMemsizeGlobal = globalNoPolygons * sizeof(float);
4236 uint64_t densityMemsizeGlobal = globalNoPolygons * sizeof(float);
4237 uint64_t normalsMemsizeGlobal = 3 * globalNoPolygons * sizeof(float);
4238 uint64_t shearMemsizeGlobal = 3 * globalNoPolygons * sizeof(float);
4253 MInt pc = polyhedralCell[c];
4254 if(pc < 0) continue;
4255 if(bndryId < 0) continue;
4258 continue;
4264 bodyId(cnt) = std::numeric_limits<uint_t>::max();
4265 for(
MInt i = 0; i < nDim; i++) {
4266 velocity(cnt, i) =
4268 }
4269
4271 domainIds(cnt) = (uint_t)
domainId();
4273 density(cnt) =
4278 for(
MInt i = 0; i < nDim; i++) {
4280 shear(cnt, i) = (float)(F1BRe * mue
4282 .m_srfcVariables[srfc]
4283 ->m_normalDeriv[
sysEqn().PV->VV[i]]);
4284 }
4285 }
4286 cnt++;
4287 }
4288 }
4289 insertDataHeader(
reinterpret_cast<char*
>(&bodyId(0)), bodyIdMemsize, bodyIdMemsizeGlobal, bodyIdOffset);
4290 insertDataHeader(
reinterpret_cast<char*
>(&velocity(0)), velocityMemsize, velocityMemsizeGlobal, velocityOffset);
4292 insertDataHeader(
reinterpret_cast<char*
>(&domainIds(0)), domainIdsMemsize, domainIdsMemsizeGlobal,
4293 domainIdsOffset);
4294 insertDataHeader(
reinterpret_cast<char*
>(&pressure(0)), pressureMemsize, pressureMemsizeGlobal, pressureOffset);
4295 insertDataHeader(
reinterpret_cast<char*
>(&density(0)), densityMemsize, densityMemsizeGlobal, densityOffset);
4296 insertDataHeader(
reinterpret_cast<char*
>(&normals(0)), normalsMemsize, normalsMemsizeGlobal, normalsOffset);
4297 insertDataHeader(
reinterpret_cast<char*
>(&shear(0)), shearMemsize, shearMemsizeGlobal, shearOffset);
4298 }
4299
4302 offset = 0;
4303 ofstream ofl;
4304 ofl.open(geomFileName.c_str(), ios_base::out | ios_base::trunc);
4305 if(ofl.is_open() && ofl.good()) {
4306
4307 ofl << "<?xml version=\"1.0\"?>" << endl;
4308 ofl << R"(<VTKFile type="PolyData" version="1.0" byte_order="LittleEndian" header_type="UInt64">)" << endl;
4309 ofl << "<PolyData>" << endl;
4310
4311
4312 ofl << "<FieldData>" << endl;
4313
4314 ofl << "<DataArray type=\"" << uIDataType
4315 << R
"(" Name="globalTimeStep" format="ascii" NumberOfTuples="1" > )" << globalTimeStep
4316 << " </DataArray>" << endl;
4318 ofl << "<DataArray type=\"" << dataType << R"(" Name="time" format="ascii" NumberOfTuples="1" > )"
4320 ofl << "<DataArray type=\"" << dataType << R"(" Name="internalTime" format="ascii" NumberOfTuples="1" > )"
4322 } else {
4323 ofl << "<DataArray type=\"" << dataType << R"(" Name="time" format="ascii" NumberOfTuples="1" > )"
4325 ofl << "<DataArray type=\"" << dataType << R"(" Name="physicalTime" format="ascii" NumberOfTuples="1" > )"
4327 }
4328 ofl << "<DataArray type=\"" << dataType << R"(" Name="timeStep" format="ascii" NumberOfTuples="1" > )"
4330 ofl << "<DataArray type=\"" << dataType << R"(" Name="timeRef" format="ascii" NumberOfTuples="1" > )"
4332 ofl << "<DataArray type=\"" << dataType << R"(" Name="Ma" format="ascii" NumberOfTuples="1" > )"
4334 ofl << "<DataArray type=\"" << dataType << R"(" Name="Re" format="ascii" NumberOfTuples="1" > )"
4336 ofl << "<DataArray type=\"" << dataType << R"(" Name="Re0" format="ascii" NumberOfTuples="1" > )"
4337 << sysEqn().m_Re0 << " </DataArray>" << endl;
4338 ofl << "<DataArray type=\"" << dataType << R"(" Name="Pr" format="ascii" NumberOfTuples="1" > )"
4340 ofl << "<DataArray type=\"" << dataType << R"(" Name="gamma" format="ascii" NumberOfTuples="1" > )"
4342 ofl << "<DataArray type=\"" << dataType << R"(" Name="Tref" format="ascii" NumberOfTuples="1" > )"
4344 ofl << "<DataArray type=\"" << dataType << R"(" Name="Lref" format="ascii" NumberOfTuples="1" > )"
4346 ofl << "<DataArray type=\"" << dataType << R"(" Name="LrefPhys" format="ascii" NumberOfTuples="1" > )" << F1
4347 << " </DataArray>" << endl;
4348 ofl << "<DataArray type=\"" << dataType << R"(" Name="CFL" format="ascii" NumberOfTuples="1" > )"
4350 ofl << "<DataArray type=\"" << dataType << R"(" Name="uInf" format="ascii" NumberOfTuples="1" > )"
4352 ofl << "<DataArray type=\"" << dataType << R"(" Name="vInf" format="ascii" NumberOfTuples="1" > )"
4354 IF_CONSTEXPR(nDim == 3)
4355 ofl << "<DataArray type=\"" << dataType << R"(" Name="wInf" format="ascii" NumberOfTuples="1" > )"
4356 <<
m_solver->m_WInfinity << " </DataArray>" << endl;
4357 ofl << "<DataArray type=\"" << dataType << R"(" Name="pInf" format="ascii" NumberOfTuples="1" > )"
4358 <<
m_solver->m_PInfinity << " </DataArray>" << endl;
4359 ofl << "<DataArray type=\"" << dataType << R"(" Name="rhoInf" format="ascii" NumberOfTuples="1" > )"
4360 <<
m_solver->m_rhoInfinity << " </DataArray>" << endl;
4361 ofl << "<DataArray type=\"" << dataType << R"(" Name="TInf" format="ascii" NumberOfTuples="1" > )"
4362 <<
m_solver->m_TInfinity << " </DataArray>" << endl;
4363 ofl << "<DataArray type=\"" << dataType << R"(" Name="muInf" format="ascii" NumberOfTuples="1" > )"
4364 <<
sysEqn().m_muInfinity << " </DataArray>" << endl;
4365 ofl << "<DataArray type=\"" << dataType << R"(" Name="length0" format="ascii" NumberOfTuples="1" > )"
4366 <<
m_solver->c_cellLengthAtLevel(0) << " </DataArray>" << endl;
4367 ofl << "<DataArray type=\"" << dataType << R"(" Name="lengthMax" format="ascii" NumberOfTuples="1" > )"
4368 <<
m_solver->c_cellLengthAtLevel(
m_solver->minLevel()) << " </DataArray>" << endl;
4369 ofl << "<DataArray type=\"" << dataType << R"(" Name="lengthMin" format="ascii" NumberOfTuples="1" > )"
4370 <<
m_solver->c_cellLengthAtLevel(
m_solver->maxLevel()) << " </DataArray>" << endl;
4371 ofl << "<DataArray type=\"" << uIDataType << R"(" Name="minLevel" format="ascii" NumberOfTuples="1" > )"
4372 <<
m_solver->minLevel() << " </DataArray>" << endl;
4373 ofl << "<DataArray type=\"" << uIDataType << R"(" Name="maxLevel" format="ascii" NumberOfTuples="1" > )"
4374 <<
m_solver->maxLevel() << " </DataArray>" << endl;
4376 ofl << "<DataArray type=\"" << uIDataType << R"(" Name="domainOffsets" format="ascii" NumberOfTuples=")"
4380 }
4381 ofl << " </DataArray>" << endl;
4382 }
4383
4384 ofl << "</FieldData>" << endl;
4385
4386
4387
4388
4389 ofl << "<Piece NumberOfPoints=\"" << globalNoGeomPoints << "\" NumberOfPolys=\"" << globalNoPolygons
4390 << "\">" << endl;
4391
4392
4393
4394
4395 ofl << "<Points>" << endl;
4396 ofl << "<DataArray type=\"" << dataType << R"(" NumberOfComponents="3" format="appended" offset=")"
4397 << offset << "\"/>" << endl;
4398 offset += geomPointsMemsizeGlobal;
4399 ofl << "</Points>" << endl;
4400
4401
4402
4403
4404 ofl << "<Polys>" << endl;
4405
4406 ofl << "<DataArray type=\"" << uIDataType << R"(" Name="connectivity" format="appended" offset=")" << offset
4407 << "\"/>" << endl;
4408 offset += geomConnMemsizeGlobal;
4409
4410 ofl << "<DataArray type=\"" << uIDataType << R"(" Name="offsets" format="appended" offset=")" << offset
4411 << "\"/>" << endl;
4412 offset += geomOffsetsMemsizeGlobal;
4413
4414 ofl << "</Polys>" << endl;
4415
4416
4417
4418
4419 ofl << "<CellData Scalars=\"scalars\">" << endl;
4420
4421 ofl << "<DataArray type=\"" << uIDataType << R"(" Name="bodyId" format="appended" offset=")" << offset
4422 << "\"/>" << endl;
4423 offset += bodyIdMemsizeGlobal;
4424
4425 ofl << "<DataArray type=\"" << dataType
4426 << R"(" Name="velocity" NumberOfComponents="3" format="appended" offset=")" << offset << "\"/>" << endl;
4427 offset += velocityMemsizeGlobal;
4428
4430 ofl << "<DataArray type=\"" << uIDataType << R"(" Name="domainId" format="appended" offset=")" << offset
4431 << "\"/>" << endl;
4432 offset += domainIdsMemsizeGlobal;
4433
4434 ofl << "<DataArray type=\"" << dataType << R"(" Name="pressure" format="appended" offset=")" << offset
4435 << "\"/>" << endl;
4436 offset += pressureMemsizeGlobal;
4437
4438 ofl << "<DataArray type=\"" << dataType << R"(" Name="density" format="appended" offset=")" << offset
4439 << "\"/>" << endl;
4440 offset += densityMemsizeGlobal;
4441
4442 ofl << "<DataArray type=\"" << dataType
4443 << R"(" Name="cell_normals" NumberOfComponents="3" format="appended" offset=")" << offset << "\"/>"
4444 << endl;
4445 offset += normalsMemsizeGlobal;
4446
4447 ofl << "<DataArray type=\"" << dataType
4448 << R"(" Name="shear" NumberOfComponents="3" format="appended" offset=")" << offset << "\"/>" << endl;
4449 offset += shearMemsizeGlobal;
4450 }
4451
4452 ofl << "</CellData>" << endl;
4453
4454
4455
4456 ofl << "</Piece>" << endl;
4457 ofl << "</PolyData>" << endl;
4458
4459
4460
4461 ofl << "<AppendedData encoding=\"raw\">" << endl;
4462 ofl << "_";
4463
4464 ofl.close();
4465 ofl.clear();
4466
4467 } else {
4468 cerr << "ERROR! COULD NOT OPEN FILE " << geomFileName << " for writing! (1)" << endl;
4469 }
4470 }
4471
4472
4473
4474
4475 MPI_File gfile = nullptr;
4477 MPI_MODE_APPEND | MPI_MODE_WRONLY, MPI_INFO_NULL, &gfile, AT_);
4478 if(rcode != MPI_SUCCESS)
mTerm(1, AT_,
"Error opening file " + geomFileName);
4479
4480
4481 rcode =
4482 writeVtuArrayParallel(gfile, &geomPoints(0), geomPointsOffset, geomPointsMemsize, geomPointsMemsizeGlobal);
4483 if(rcode != MPI_SUCCESS)
mTerm(1, AT_,
"Error (1) writing to file " + geomFileName);
4484
4485
4486 rcode =
writeVtuArrayParallel(gfile, &geomConn(0), geomConnOffset, geomConnMemsize, geomConnMemsizeGlobal);
4487 if(rcode != MPI_SUCCESS)
mTerm(1, AT_,
"Error (2) writing to file " + geomFileName);
4488
4489
4491 geomOffsetsMemsizeGlobal);
4492 if(rcode != MPI_SUCCESS)
mTerm(1, AT_,
"Error (3) writing to file " + geomFileName);
4493
4494
4496 if(rcode != MPI_SUCCESS)
mTerm(1, AT_,
"Error (4) writing to file " + geomFileName);
4497
4498
4499 rcode =
writeVtuArrayParallel(gfile, &velocity(0), velocityOffset, velocityMemsize, velocityMemsizeGlobal);
4500 if(rcode != MPI_SUCCESS)
mTerm(1, AT_,
"Error (9) writing to file " + geomFileName);
4501
4503
4504 rcode =
4505 writeVtuArrayParallel(gfile, &domainIds(0), domainIdsOffset, domainIdsMemsize, domainIdsMemsizeGlobal);
4506 if(rcode != MPI_SUCCESS)
mTerm(1, AT_,
"Error (4) writing to file " + geomFileName);
4507
4508
4509 rcode =
writeVtuArrayParallel(gfile, &pressure(0), pressureOffset, pressureMemsize, pressureMemsizeGlobal);
4510 if(rcode != MPI_SUCCESS)
mTerm(1, AT_,
"Error (5) writing to file " + geomFileName);
4511
4512
4513 rcode =
writeVtuArrayParallel(gfile, &density(0), densityOffset, densityMemsize, densityMemsizeGlobal);
4514 if(rcode != MPI_SUCCESS)
mTerm(1, AT_,
"Error (6) writing to file " + geomFileName);
4515
4516
4517 rcode =
writeVtuArrayParallel(gfile, &normals(0), normalsOffset, normalsMemsize, normalsMemsizeGlobal);
4518 if(rcode != MPI_SUCCESS)
mTerm(1, AT_,
"Error (7) writing to file " + geomFileName);
4519
4520
4522 if(rcode != MPI_SUCCESS)
mTerm(1, AT_,
"Error (8) writing to file " + geomFileName);
4523 }
4524
4526
4527
4528
4529
4531 ofstream ofl;
4532 ofl.open(geomFileName.c_str(), ios_base::out | ios_base::app);
4533 if(ofl.is_open() && ofl.good()) {
4534 ofl << endl;
4535 ofl << "</AppendedData>" << endl;
4536
4537
4538 ofl << "</VTKFile>" << endl;
4539 ofl.close();
4540 ofl.clear();
4541
4542 } else {
4543 cerr << "ERROR! COULD NOT OPEN FILE " << geomFileName << " for writing! (3)" << endl;
4544 }
4545 }
4546
4547
4548
4549
4550
4551
4555 }
4556 ofstream ofile;
4557 ofstream ofile2;
4559 ofile.open("out/GEOM.pvd.tmp", ios_base::out | ios_base::trunc);
4560 else
4561 ofile.open("out/GEOM.pvd.tmp", ios_base::out | ios_base::app);
4562 if(ofile.is_open() && ofile.good()) {
4564 ofile << R"(<VTKFile type="Collection" version="0.1" byte_order="LittleEndian">)" << endl;
4565 ofile << "<Collection>" << endl;
4566 }
4568 MString fname = (pos == string::npos)
4569 ? geomFileName
4571 ofile <<
"<DataSet part=\"" << 0 <<
"\" timestep=\"" <<
globalTimeStep <<
"\" file=\""
4572 << "./" << fname << "\"/>" << endl;
4573 ofile.close();
4574 ofile.clear();
4575 } else {
4576 cerr << "Error opening file out/GEOM.pvd.tmp" << endl;
4577 }
4578 m_log <<
"Command executed with return value: " << system(
"cp out/GEOM.pvd.tmp out/GEOM.pvd") <<
" at " << AT_
4579 << endl;
4580
4581 ofile2.
open(
"out/GEOM.pvd", ios_base::out | ios_base::app);
4582 if(ofile2.is_open() && ofile2.good()) {
4583 ofile2 << "</Collection>" << endl;
4584 ofile2 << "</VTKFile>" << endl;
4585 ofile2.close();
4586 ofile2.clear();
4587 } else {
4588 cerr << "Error opening file out/GEOM.pvd" << endl;
4589 }
4591 }
4592 }
4593
4595 offset = 0;
4596 ofstream ofl;
4598 ofl.open(partFileName.c_str(), ios_base::out | ios_base::trunc);
4599 if(ofl.is_open() && ofl.good()) {
4600
4601 ofl << "<?xml version=\"1.0\"?>" << endl;
4602 ofl << R"(<VTKFile type="PolyData" version="1.0" byte_order="LittleEndian" header_type="UInt64">)" << endl;
4603 ofl << "<PolyData>" << endl;
4604
4605
4606 ofl << "<FieldData>" << endl;
4607 ofl << "<DataArray type=\"" << uIDataType << R"(" Name="globalTimeStep" format="ascii" NumberOfTuples="1" > )"
4610 ofl << "<DataArray type=\"" << dataType << R"(" Name="time" format="ascii" NumberOfTuples="1" > )"
4612 ofl << "<DataArray type=\"" << dataType << R"(" Name="internalTime" format="ascii" NumberOfTuples="1" > )"
4614 } else {
4615 ofl << "<DataArray type=\"" << dataType << R"(" Name="time" format="ascii" NumberOfTuples="1" > )"
4617 ofl << "<DataArray type=\"" << dataType << R"(" Name="physicalTime" format="ascii" NumberOfTuples="1" > )"
4619 }
4620 ofl << "</FieldData>" << endl;
4621
4622
4623
4626
4627
4628
4629 ofl << "<Points>" << endl;
4630
4631 ofl << setprecision(12);
4632 ofl << "<DataArray type=\"" << dataType << R"(" NumberOfComponents="3" format="ascii">)" << endl;
4634 for(
MInt i = 0; i < nDim; i++) {
4636 }
4637 ofl << endl;
4638 }
4639 ofl << "</DataArray>" << endl;
4640 ofl << "</Points>" << endl;
4641
4642
4643
4644
4645 ofl << "<Verts>" << endl;
4646 ofl << "<DataArray type=\"" << uIDataType << R"(" Name="connectivity" format="ascii">)" << endl;
4648 ofl << k << " ";
4649 }
4650 ofl << endl;
4651 ofl << "</DataArray>" << endl;
4652 ofl << "<DataArray type=\"" << uIDataType << R"(" Name="offsets" format="ascii">)" << endl;
4654 ofl << k + 1 << " ";
4655 }
4656 ofl << endl;
4657 ofl << "</DataArray>" << endl;
4658 ofl << "</Verts>" << endl;
4659
4660
4661
4662 ofl << "<PointData Scalars=\"scalars\">" << endl;
4663 ofl << "<DataArray type=\"" << dataType << R"(" Name="velocity" NumberOfComponents="3" format="ascii">)"
4664 << endl;
4666 for(
MInt i = 0; i < nDim; i++) {
4668 }
4669 ofl << endl;
4670 }
4671 ofl << "</DataArray>" << endl;
4672 ofl << "</PointData>" << endl;
4673
4674
4675 ofl << "</Piece>" << endl;
4676 ofl << "</PolyData>" << endl;
4677 ofl << "</VTKFile>" << endl;
4678 ofl.close();
4679 ofl.clear();
4680
4681 } else {
4682 cerr << "ERROR! COULD NOT OPEN FILE " << partFileName << " for writing! (1)" << endl;
4683 }
4684 }
4685 }
4686 }
4687
4688 if(facestream != nullptr) {
4689 delete[] facestream;
4690 facestream = nullptr;
4691 }
4692 if(conn != nullptr) {
4693 delete[] conn;
4694 conn = nullptr;
4695 }
4696
4697 RECORD_TIMER_STOP(t_geometry);
4698 RECORD_TIMER_STOP(t_vtutotal);
4699 DISPLAY_TIMER_INTERM(t_vtutotal);
4700}
MBool m_vtuVelocityGradientOutput
MFloat m_referenceTemperature
MBool m_vtuWritePointData
MBool m_firstUseWriteVtuOutputParallelQout
MBool m_vtuGeometryOutputExtended
MBool m_firstUseWriteVtuOutputParallelGeom
std::map< MInt, MInt > m_splitChildToSplitCell
MBool m_vtuWriteGeometryFile
std::set< MInt > m_vtuGeometryOutput
MBool m_vtuVorticityOutput
MBool m_vtuQCriterionOutput
MBool m_vtuWriteParticleFile
MBool m_vtuLevelSetOutput
MBool m_vtuSaveHeaderTesting
MBool m_vtuGlobalIdOutput
MFloat * m_vtuCoordinatesThreshold
MBool m_vtuDomainIdOutput
void open(const MString &filename, const MString &projectName, MInt fileType=0, MPI_Comm mpiComm=MPI_COMM_WORLD, MBool rootOnlyHardwired=false)
Opens a file by passing the parameters to InfoOut_<xyz>FileBuffer::open(...).
void insertDataHeader(char *data, uint64_t &memsize, uint64_t &memsizeGlobal, uint64_t &offset)
The zeroth domain stores the header for an uncompressed vtu file appended data array specifying its n...
MInt writeVtuArrayParallel(MPI_File &, void *, MPI_Offset, MPI_Offset, MPI_Offset)
uint64_t vtuAssembleFaceStream(std::vector< T > *&, std::vector< T > *&, uint64_t &, ScratchSpace< MInt > &, MInt &, const MBool)
MInt estimateMemorySizeSolverwise(uint64_t, ScratchSpace< uint64_t > &, uint64_t)
MInt noWindowCells(const MInt domainId) const
MLong domainOffset(const MInt id) const
void extractPointIdsFromGrid(Collector< PointBasedCell< nDim > > *&, Collector< CartesianGridPoint< nDim > > *&, const MBool, const std::map< MInt, MInt > &, MInt levelThreshold=999999, MFloat *bBox=nullptr, MBool levelSetMb=false) const
Creates a list of unique corner points for all cells using a hash map levelThreshold optionally speci...
MInt noHaloCells(const MInt domainId) const
MInt windowCellId(const MInt domainId, const MInt cellId) const
MInt noNeighborDomains() const
MInt haloCellId(const MInt domainId, const MInt cellId) const
MInt neighborDomain(const MInt id) const
MInt string2enum(MString theString)
This global function translates strings in their corresponding enum values (integer values)....
int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status *status, const MString &name, const MString &varname)
same as MPI_Recv
int MPI_Issend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request, const MString &name, const MString &varname)
same as MPI_Issend
int MPI_File_open(MPI_Comm comm, const char *filename, int amode, MPI_Info info, MPI_File *mpi_fh, const MString &name)
same as MPI_File_open
int MPI_Waitall(int count, MPI_Request *request, MPI_Status *status, const MString &name)
same as MPI_Waitall
int MPI_File_close(MPI_File *mpi_fh, const MString &name)
same as MPI_File_close
void calcEigenValues(MFloat A[3][3], MFloat w[3])