- as seen in #3201, using count() based on the ostringstream tellp
is not reliable since it is not updated with reset or copying.
STYLE: minor changes to string/char/span streams
- update docs to only mention string_view
- use auto return, without extra trailing 'decltype'
ENH: add IOstream size check helper methods
* checkNativeSizes() : test only
* fatalCheckNativeSizes() : an assert with FatalIOError
The solverPerformanceDict gets larger due to the addition of a SolverPerformance
data per field at every outer iteration within the same main iteration/time
step.
However, the subsequent functionalities seem to use only the first and last
element of this dictionary per field; therefore, storing the interim values
was revealed to be redundant.
The change removes the interim values by transforming the `List` container
into the `Pair` container, and modifying the relevant algorithms.
Using 'return List<T>(std::move(dynList))' for transfer of content
(with implicit shrinking) into a plain List, and leave copy elision
to do the rest. The implicit transfer (move construct List from
DynamicList) will normally invoke resize (new/delete and moving
elements).
With 'return dynList.shrink()', it will first invoke an internal
resize (new/delete and moving elements), followed by a copy
construct as a plain list.
STYLE: avoid implicit cast to 'const List&' in constructors
Accumulates function object result values and renders into a graph in SVG format
Minimal example by using system/controlDict.functions to plot the residuals from
the solverInfo function Object:
residualGraph
{
type graphFunctionObject;
libs (utilityFunctionObjects);
writeControl writeTime;
logScaleX no;
logScaleY yes;
xlabel "Iteration";
ylabel "log10(Initial residual)";
functions
{
line1
{
object solverInfo1;
entry Ux_initial;
}
line2
{
object solverInfo1;
entry Uy_initial;
}
line3
{
object solverInfo1;
entry Uz_initial;
}
line4
{
object solverInfo1;
entry p_initial;
}
}
}
Determines radiation heat flux between patches when using the viewFactor
radiation model.
Example usage
viewFactorHeatFlux1
{
// Mandatory entries (unmodifiable)
type viewFactorHeatFlux;
libs (utilityFunctionObjects);
// Optional entries (runtime modifiable)
qr qr;
}
- the ensightReadFile init() now automatically sets up binary/ascii
(for geometry files) and checks for the transient "BEGIN TIME STEP"
marker. If found, will also populate the file offsets for each of
the timesteps. If no corresponding footer is found (which would be
very inefficient), it simply pretends that there is only a single
time step instead of performing a costly file scan.
- parsing of the ensight case file now also supports the use of
filename numbers:
as an alternative to
filename start number:
filename increment:
- improved parsing robustness of "time values:" entry.
Can now also have contents on the same line as the introducer.
ENH: base-level adjustments for writing transient single-file
- beginGeometry() is now separated out from file creation.
- in append mode, ensightFile and ensightGeoFile will attempt to
parse existing time-step information.
- findStrings, findMatchingStrings now mostly covered by matching
intrinsics in wordRe and wordRes.
Add static wordRes match() and matching() variants
COMP: remove stringListOps include from objectRegistry.H
- was already noted for removal (NOV-2018)
- simplifies handling.
* enables unprotecting to avoid accidentally cloning.
* removes the need for dedicated constructor or factory forms.
* simplfies DimensionedField and GeometricField New factory methods
- update objectRegistry management method (internal use)
old: bool cacheTemporaryObject(...)
new: bool is_cacheTemporaryObject(...)
to clarify that it is a query, not a request for caching etc.
- the fields for finite-area are currently stored directly on the
polyMesh registry, but for future relocation to a sub-registry
provide a uniform accessor.
ENH: use thisDb() for faMatrix access and extrapolatedCalculated
Collects and writes case information to file in OpenFOAM dictionary or JSON
format. Data includes:
- meta: case name, path, regions, parallel etc.
- dictionaries: entries retrieved from dictionaries - registered or from file
- per region: mesh metrics, boundary and boundary field types
- function object results
Example of function object specification:
caseInfo
{
type caseInfo;
libs (utilityFunctionObjects);
// Warn when entries are not found
lookupMode warn; // none | warn | error;
// Write format
writeFormat json; // dictionary | json;
dictionaries
{
USolver // User-specified names
{
// Look up using registered name
name "fvSolution";
// Optionally limit to specific entries
include
(
"solvers/U/solver"
);
}
fvSchemes
{
name "fvSchemes";
// include all entries by default
}
timeScheme
{
name "fvSchemes";
include
(
"/ddtSchemes/default"
);
}
turbulence
{
name "turbulenceProperties";
// include all entries by default
}
controlDict
{
// Look up using file path
path "<case>/system/controlDict";
include
(
"application"
"deltaT"
"startTime"
"endTime"
);
}
}
functionObjects (minMax1);
}
- new format option keywords: timeFormat, timePrecision
CONFIG: default ensight output is now consistently BINARY
- this removes some uncertainty with the ensightWrite functionObject
which was previously dependent on the simulation writeFormat
and makes its behaviour consistent with foamToEnsight
Note: binary Ensight output is consistent with the
defaults for VTP output (inline binary)
ENH: minor adjustment of ensight writing methods
- update TimeState access methods
- use writeTime() instead of old method name outputTime()
- use deltaTValue() instead of deltaT().value()
to avoids pointless construct of intermediate
- functionality introduced by openfoam.org to support selective
caching of temporary fields. The purpose is two-fold: to enable
diagnostics and to allow more places to use unregistered fields by
default.
For example to cache the grad(k) field in
cacheTemporaryObjects
(
grad(k)
);
If the name of a field which in never constructed is added to the
cacheTemporaryObjects list a waning message is generated which
includes a useful list of ALL the temporary fields constructed
during the time step
Multiple regions are also supported by specifying individual region
names in a cacheTemporaryObjects dictionary.
cacheTemporaryObjects
{
porous
(
porosityBlockage:UNbr
);
}
functions
{
writePorousObjects
{
type writeObjects;
libs (utilityFunctionObjects);
region porous;
writeControl writeTime;
writeOption anyWrite;
objects (porosityBlockage:UNbr);
}
}
- allow reporting even when profiling is suspended
- consolidate reporting into profilingPstream itself
(avoids code scatter).
Example of possible advanced use for timing only one section of
code:
====
// Profile local operations
profilingPstream::enable();
... do something
// Don't profile elsewhere
profilingPstream::suspend();
====
- separate broadcast times from reduce/gather/scatter time
- separate wait times from all-to-all time
- support invocation counts, split off requests time/count
from others to avoid flooding the counts
- support 'detail' switch to increase the output information.
Format may change in the future
- similar to UPstream::parRun(), the setter returns the previous value.
The accessors are prefixed with 'comm':
Eg, commGlobal(), commWarn(), commWorld(), commSelf().
This distinguishes them from any existing variables (eg, worldComm)
and arguably more similar to MPI_COMM_WORLD etc...
If demand-driven communicators are added in the future, the function
call syntax can help encapsulate that.
Previously:
const label oldWarnComm = UPstream::warnComm;
const label oldWorldComm = UPstream::worldComm;
UPstream::warnComm = myComm;
UPstream::worldComm = myComm;
...
UPstream::warnComm = oldWarnComm;
UPstream::worldComm = oldWorldComm;
Now:
const label oldWarnComm = UPstream::commWarn(myComm);
const label oldWorldComm = UPstream::commWorld(myComm);
...
UPstream::commWarn(oldWarnComm);
UPstream::commWorld(oldWorldComm);
STYLE: check (warnComm >= 0) instead of (warnComm != -1)
- attempted reduction in bookkeeping (commit: 068ab8ccc7) meant that
the worldComm didn't have a group from which sub-communicators could
be spun off.
- do not force reset of PstreamBuffers positions
STYLE: UPstream::globalComm instead of '0'
- field blocking/exclusion added in commit d9ab5d54ef,
but was incorrectly doing a lookup for "blockField" for ensight
although "excludeFields" was documented (and expected).
Now corrected to use "excludeFields"
- similar to surface writing formats, also support optional
dictionary of reading options. The main beneficiary of this is the
ensight surface reader:
readOptions
{
ensight
{
masterOnly true;
}
}
This will restrict reading to the master rank. Surfaces and values
read will be broadcast to the other ranks, with the intention of
reducing load on the filesystem.
ENH: add writing of Dimensioned fields for areaWrite functionObject
- can be useful for examining finite-area source terms