34 const word& fieldName,
35 const word& outputName,
48 file<< obr_.time().value();
50 writeTabbed(file, fieldName);
52 file<< token::TAB << minValue
53 << token::TAB << minC;
55 if (Pstream::parRun())
57 file<< token::TAB << minProcI;
60 file<< token::TAB << maxValue
61 << token::TAB << maxC;
63 if (Pstream::parRun())
65 file<< token::TAB << maxProcI;
71 <<
" min(" << outputName <<
") = " << minValue
72 <<
" at location " << minC;
74 if (Pstream::parRun())
76 if (log_)
Info<<
" on processor " << minProcI;
80 <<
nl <<
" max(" << outputName <<
") = " << maxValue
81 <<
" at location " << maxC;
83 if (Pstream::parRun())
85 if (log_)
Info<<
" on processor " << maxProcI;
90 file<< token::TAB << minValue << token::TAB <<
maxValue;
93 <<
" min/max(" << outputName <<
") = " 104 const word& fieldName,
110 if (obr_.foundObject<fieldType>(fieldName))
112 const label procI = Pstream::myProcNo();
114 const fieldType& field = obr_.lookupObject<fieldType>(fieldName);
117 const volVectorField::GeometricBoundaryField& CfBoundary =
118 mesh.C().boundaryField();
125 const volScalarField::GeometricBoundaryField& magFieldBoundary =
131 minVs[procI] = magField[minProcI];
132 minCs[procI] = field.mesh().C()[minProcI];
139 maxVs[procI] = magField[maxProcI];
140 maxCs[procI] = field.mesh().C()[maxProcI];
142 forAll(magFieldBoundary, patchI)
150 if (mfp[minPI] < minVs[procI])
152 minVs[procI] = mfp[minPI];
153 minCs[procI] = Cfp[minPI];
157 if (mfp[maxPI] > maxVs[procI])
159 maxVs[procI] = mfp[maxPI];
160 maxCs[procI] = Cfp[maxPI];
165 Pstream::gatherList(minVs);
166 Pstream::gatherList(minCs);
168 Pstream::gatherList(maxVs);
169 Pstream::gatherList(maxCs);
171 if (Pstream::master())
174 scalar minValue = minVs[minI];
175 const vector& minC = minCs[minI];
178 scalar maxValue = maxVs[maxI];
179 const vector& maxC = maxCs[maxI];
184 word(
"mag(" + fieldName +
")"),
197 const typename fieldType::GeometricBoundaryField&
198 fieldBoundary = field.boundaryField();
203 minVs[procI] = field[minProcI];
204 minCs[procI] = field.mesh().C()[minProcI];
206 Pstream::gatherList(minVs);
207 Pstream::gatherList(minCs);
212 maxVs[procI] = field[maxProcI];
213 maxCs[procI] = field.mesh().C()[maxProcI];
215 forAll(fieldBoundary, patchI)
223 if (fp[minPI] < minVs[procI])
225 minVs[procI] = fp[minPI];
226 minCs[procI] = Cfp[minPI];
230 if (fp[maxPI] > maxVs[procI])
232 maxVs[procI] = fp[maxPI];
233 maxCs[procI] = Cfp[maxPI];
238 Pstream::gatherList(minVs);
239 Pstream::gatherList(minCs);
241 Pstream::gatherList(maxVs);
242 Pstream::gatherList(maxCs);
244 if (Pstream::master())
247 Type minValue = minVs[minI];
248 const vector& minC = minCs[minI];
251 Type maxValue = maxVs[maxI];
252 const vector& maxC = maxCs[maxI];
272 "Foam::fieldMinMax::calcMinMaxFields" 277 ) <<
"Unknown min/max mode: " << modeTypeNames_[mode_]
Mesh data needed to do the Finite Volume discretisation.
dimensioned< scalar > mag(const dimensioned< Type > &)
GeometricBoundaryField & boundaryField()
Return reference to GeometricBoundaryField.
label findMax(const ListType &, const label start=0)
Find index of max element (and larger than given element).
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void size(const label)
Override size to be inconsistent with allocated storage.
errorManipArg< error, int > exit(error &err, const int errNo=1)
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).
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
void output(const word &fieldName, const word &outputName, const vector &minC, const vector &maxC, const label minProcI, const label maxProcI, const Type &minValue, const Type &maxValue)
Helper function to write the output.
Generic GeometricField class.
void calcMinMaxFields(const word &fieldName, const modeType &mode)
Calculate the field min/max.