| 73 | |
| 74 | |
| 75 | void Foam::functionObjects::forces::writeFileHeader(const label i) |
| 76 | { |
| 77 | switch (fileID(i)) |
| 78 | { |
| 79 | case MAIN_FILE: |
| 80 | { |
| 81 | // force data |
| 82 | |
| 83 | writeHeader(file(i), "Forces"); |
| 84 | writeHeaderValue(file(i), "CofR", coordSys_.origin()); |
| 85 | writeCommented(file(i), "Time"); |
| 86 | |
| 87 | const word forceTypes("(pressure viscous porous)"); |
| 88 | file(i) |
| 89 | << "forces" << forceTypes << tab |
| 90 | << "moments" << forceTypes; |
| 91 | |
| 92 | if (localSystem_) |
| 93 | { |
| 94 | file(i) |
| 95 | << tab |
| 96 | << "localForces" << forceTypes << tab |
| 97 | << "localMoments" << forceTypes; |
| 98 | } |
| 99 | |
| 100 | break; |
| 101 | } |
| 102 | case BINS_FILE: |
| 103 | { |
| 104 | // bin data |
| 105 | |
| 106 | writeHeader(file(i), "Force bins"); |
| 107 | writeHeaderValue(file(i), "bins", nBin_); |
| 108 | writeHeaderValue(file(i), "start", binMin_); |
| 109 | writeHeaderValue(file(i), "delta", binDx_); |
| 110 | writeHeaderValue(file(i), "direction", binDir_); |
| 111 | |
| 112 | vectorField binPoints(nBin_); |
| 113 | writeCommented(file(i), "x co-ords :"); |
| 114 | forAll(binPoints, pointi) |
| 115 | { |
| 116 | binPoints[pointi] = (binMin_ + (pointi + 1)*binDx_)*binDir_; |
| 117 | file(i) << tab << binPoints[pointi].x(); |
| 118 | } |
| 119 | file(i) << nl; |
| 120 | |
| 121 | writeCommented(file(i), "y co-ords :"); |
| 122 | forAll(binPoints, pointi) |
| 123 | { |
| 124 | file(i) << tab << binPoints[pointi].y(); |
| 125 | } |
| 126 | file(i) << nl; |
| 127 | |
| 128 | writeCommented(file(i), "z co-ords :"); |
| 129 | forAll(binPoints, pointi) |
| 130 | { |
| 131 | file(i) << tab << binPoints[pointi].z(); |
| 132 | } |
nothing calls this directly
no test coverage detected