34 const word& fieldName,
35 const word& outputName,
52 writeTabbed(file, fieldName);
54 file<<
tab << minValue
57 if (Pstream::parRun())
59 file<<
tab << minProci;
62 file<<
tab << maxValue
65 if (Pstream::parRun())
67 file<<
tab << maxProci;
72 Log <<
" min(" << outputName <<
") = " << minValue
73 <<
" in cell " << minCell
74 <<
" at location " << minC;
76 if (Pstream::parRun())
78 Log <<
" on processor " << minProci;
81 Log <<
nl <<
" max(" << outputName <<
") = " << maxValue
82 <<
" in cell " << maxCell
83 <<
" at location " << maxC;
85 if (Pstream::parRun())
87 Log <<
" on processor " << maxProci;
94 Log <<
" min/max(" << outputName <<
") = " 105 const word& fieldName,
111 if (obr_.foundObject<fieldType>(fieldName))
113 const label proci = Pstream::myProcNo();
115 const fieldType& field = obr_.lookupObject<fieldType>(fieldName);
117 const volVectorField::Boundary& CfBoundary =
118 mesh_.C().boundaryField();
125 const volScalarField::Boundary& magFieldBoundary =
132 minVs[proci] = magField[minProci];
133 minCells[proci] = minProci;
134 minCs[proci] = mesh_.C()[minProci];
140 maxVs[proci] = magField[maxProci];
141 maxCells[proci] = maxProci;
142 maxCs[proci] = mesh_.C()[maxProci];
152 magFieldBoundary[
patchi].patch().faceCells();
155 if (mfp[minPI] < minVs[proci])
157 minVs[proci] = mfp[minPI];
158 minCells[proci] = faceCells[minPI];
159 minCs[proci] = Cfp[minPI];
163 if (mfp[maxPI] > maxVs[proci])
165 maxVs[proci] = mfp[maxPI];
166 maxCells[proci] = faceCells[maxPI];
167 maxCs[proci] = Cfp[maxPI];
172 Pstream::gatherList(minVs);
173 Pstream::gatherList(minCells);
174 Pstream::gatherList(minCs);
176 Pstream::gatherList(maxVs);
177 Pstream::gatherList(maxCells);
178 Pstream::gatherList(maxCs);
180 if (Pstream::master())
183 const scalar minValue = minVs[minI];
184 const label minCell = minCells[minI];
185 const vector& minC = minCs[minI];
188 const scalar maxValue = maxVs[maxI];
189 const label maxCell = maxCells[maxI];
190 const vector& maxC = maxCs[maxI];
195 word(
"mag(" + fieldName +
")"),
210 const typename fieldType::Boundary&
211 fieldBoundary = field.boundaryField();
217 minVs[proci] = field[minProci];
218 minCells[proci] = minProci;
219 minCs[proci] = mesh_.C()[minProci];
225 maxVs[proci] = field[maxProci];
226 maxCells[proci] = maxProci;
227 maxCs[proci] = mesh_.C()[maxProci];
238 fieldBoundary[
patchi].patch().faceCells();
241 if (fp[minPI] < minVs[proci])
243 minVs[proci] = fp[minPI];
244 minCells[proci] = faceCells[minPI];
245 minCs[proci] = Cfp[minPI];
249 if (fp[maxPI] > maxVs[proci])
251 maxVs[proci] = fp[maxPI];
252 maxCells[proci] = faceCells[maxPI];
253 maxCs[proci] = Cfp[maxPI];
258 Pstream::gatherList(minVs);
259 Pstream::gatherList(minCells);
260 Pstream::gatherList(minCs);
262 Pstream::gatherList(maxVs);
263 Pstream::gatherList(maxCells);
264 Pstream::gatherList(maxCs);
266 if (Pstream::master())
269 Type minValue = minVs[minI];
270 const label minCell = minCells[minI];
271 const vector& minC = minCs[minI];
274 Type maxValue = maxVs[maxI];
275 const label maxCell = maxCells[maxI];
276 const vector& maxC = maxCs[maxI];
297 <<
"Unknown min/max mode: " << modeTypeNames_[mode_]
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
label findMin(const ListType &, const label start=0)
Find index of min element (and less than given element).
Generic GeometricField class.
void calcMinMaxFields(const word &fieldName, const modeType &mode)
Calculate the field min/max.
A class for handling words, derived from string.
label findMax(const ListType &, const label start=0)
Find index of max element (and larger than given element).
void output(const word &fieldName, const word &outputName, const label minCell, const label maxCell, const vector &minC, const vector &maxC, const label minProci, const label maxProci, const Type &minValue, const Type &maxValue)
Helper function to write the output.
#define Log
Report write to Foam::Info if the local log switch is true.
dimensioned< scalar > mag(const dimensioned< Type > &)