42 names[] = {
"cellZone",
"all"};
44 const NamedEnum<fieldValues::cellSource::sourceType, 2>
48 const char* NamedEnum<fieldValues::cellSource::operationType, 7>::
51 "none",
"sum",
"volAverage",
52 "volIntegrate",
"weightedAverage",
"min",
"max"
55 const NamedEnum<fieldValues::cellSource::operationType, 7>
63 void Foam::fieldValues::cellSource::setCellZoneCells()
73 FatalErrorIn(
"cellSource::cellSource::setCellZoneCells()")
94 <<
"Unknown source type. Valid source types are:"
113 <<
" total cells = " << nCells_ <<
nl
114 <<
" total volume = " <<
gSum(filterField(
mesh().V()))
117 if (operation_ == opWeightedAverage)
119 dict.
lookup(
"weightField") >> weightFieldName_;
122 obr().foundObject<volScalarField>(weightFieldName_)
125 Info<<
" weight field = " << weightFieldName_;
130 <<
type() <<
" " << name_ <<
": "
131 << sourceTypeNames_[source_] <<
"(" << sourceName_ <<
"):"
132 <<
nl <<
" Weight field " << weightFieldName_
144 if (outputFilePtr_.valid())
147 <<
"# Source : " << sourceTypeNames_[source_] <<
" "
148 << sourceName_ <<
nl <<
"# Cells : " << nCells_ <<
nl
149 <<
"# Time" <<
tab <<
"sum(V)";
154 << tab << operationTypeNames_[operation_]
155 <<
"(" << fields_[i] <<
")";
158 outputFilePtr_() <<
endl;
170 const bool loadFromFiles
174 source_(sourceTypeNames_.read(dict.
lookup(
"source"))),
175 operation_(operationTypeNames_.read(dict.
lookup(
"operation"))),
212 << obr_.time().value() <<
tab
213 <<
sum(filterField(
mesh().V()));
218 writeValues<scalar>(fields_[i]);
219 writeValues<vector>(fields_[i]);
220 writeValues<sphericalTensor>(fields_[i]);
221 writeValues<symmTensor>(fields_[i]);
222 writeValues<tensor>(fields_[i]);
227 outputFilePtr_()<<
endl;