52 int main(
int argc,
char *argv[])
60 "Calculate the volume of the specified cellSet"
67 "Calculate the volume of the specified cellZone"
83 const cellSet ccCellSet(mesh, cellSetName);
84 ccCells = ccCellSet.toc();
88 const cellZone& ccCellZone = mesh.cellZones()[cellZoneName];
94 const scalar eps = 1.0e-10;
98 while (runTime.userTimeValue() > ca0)
104 if (
mag(runTime.userTimeValue() - ca0) > eps)
106 const scalar t0 = runTime.userTimeToTime(ca0 - runTime.userTimeValue());
107 runTime.setDeltaT(t0);
109 Info<<
"Moving to CA = " << runTime.userTimeValue() <<
endl;
114 Info <<
"Volume at " << runTime.userTimeValue() <<
"CA = " << V0 <<
endl;
116 if (
mag(runTime.userTimeValue()-ca1) > eps)
118 const scalar t1 = runTime.userTimeToTime(ca1 - runTime.userTimeValue());
119 runTime.setDeltaT(t1);
121 Info<<
"Moving to CA = " << runTime.userTimeValue() <<
endl;
126 Info <<
"Volume at " << runTime.userTimeValue() <<
"CA = " << V1 <<
endl;
128 const scalar Vmin(
min(V0, V1));
129 const scalar Vmax(
max(V0, V1));
131 Info<<
"\nCompression ratio = " << Vmax/Vmin <<
endl;
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
A collection of cell labels.
A class for handling words, derived from string.
int main(int argc, char *argv[])
Type gSum(const FieldField< Field, Type > &f)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
dimensioned< scalar > mag(const dimensioned< Type > &)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.
Foam::argList args(argc, argv)