- do not need STRINGIFY macros in ragel code
- remove wordPairHashTable.H and use equivalent wordPairHashes.H instead
STYLE: replace addDictOption with explicit option
- the usage text is otherwise misleading
GIT: combine Pair/Tuple2 directories
- unused in regular OpenFOAM code
- POSIX version uses deprecated gethostbyname()
- Windows version never worked
COMP: localize, noexcept on internal OSspecific methods
STYLE: support fileName::Type SYMLINK and LINK as synonyms
- for contiguous data, added mpiGatherOp() to complement the
gatherOp() static method
- the gather ops (static methods) populate the globalIndex on the
master only (not needed on other procs) for reduced communication
- rename inplace gather methods to include 'inplace' in their name.
Regular gather methods return the gathered data directly, which
allows the following:
const scalarField mergedWeights(globalFaces().gather(wghtSum));
vs.
scalarField mergedWeights;
globalFaces().gather(wghtSum, mergedWeights());
or even:
scalarField mergedWeights;
List<scalarField> allWeights(Pstream::nProcs());
allWeights[Pstream::myProcNo()] = wghtSum;
Pstream::gatherList(allWeights);
if (Pstream::master())
{
mergedWeights =
ListListOps::combine<scalarField>
(
allWeights, accessOp<scalarField>()
);
}
- add parRun guards on various globalIndex gather methods
(simple copies or no-ops in serial) to simplify the effort for callers.
ENH: reduce code effort for clearing linked-lists
ENH: adjust linked-list method name
- complement linked-list append() method with prepend() method
instead of 'insert', which is not very descriptive
- set() was silently deprecated in favour of reset() FEB-2018
since the original additional check for overwriting an existing
pointer was never used. The reset(...) name is more consistent
with unique_ptr, tmp etc.
Now emit deprecations for set().
- use direct test for autoPtr, tmp instead of valid() method.
More consistent with unique_ptr etc.
STYLE: eliminate redundant ptr() use on cloned quantities
- literal lookups only for expression strings
- code reduction for setExprFields.
- changed keyword "condition" to "fieldMask" (option -field-mask).
This is a better description of its purpose and avoids possible
naming ambiguities with functionObject triggers (for example)
if we apply similar syntax elsewhere.
BUG: erroneous check in volumeExpr::parseDriver::isResultType()
- not triggered since this method is not used anywhere
(may remove in future version)
The utility will now add field data to all tracks (previous version only
created the geometry)
The new 'fields' entry can be used to output specific fields.
Example
cloud reactingCloud1;
sampleFrequency 1;
maxPositions 1000000;
fields (d U); // includes wildcard support
STYLE: minor typo fix
- similar idea to swak timelines/lookuptables but combined together
and based on Function1 for more flexibility.
Specified as 'functions<scalar>' or 'functions<vector>'.
For example,
functions<scalar>
{
intakeType table ((0 0) (10 1.2));
p_inlet
{
type sine;
frequency 3000;
scale 50;
level 101325;
}
}
These can be referenced in the expressions as a nullary function or a
unary function.
Within the parser, the names are prefixed with "fn:" (function).
It is thus possible to define "fn:sin()" that is different than
the builtin "sin()" function.
* A nullary call uses time value
- Eg, fn:p_inlet()
* A unary call acts as a remapper function.
- Eg, fn:intakeType(6.25)
- previously simply reused the scan token, which works fine for
non-nested tokenizations but becomes too fragile with nesting.
Now changed to use tagged unions that can be copied about
and still retain some rudimentary knowledge of their types,
which can be manually triggered with a destroy() call.
- provide an 'identifier' non-terminal as an additional catch
to avoid potential leakage on parsing failure.
- adjust lemon rules and infrastructure:
- use %token to predefine standard tokens.
Will reduce some noise on the generated headers by retaining the
order on the initial token names.
- Define BIT_NOT, internal token rename NOT -> LNOT
- handle non-terminal vector values.
Support vector::x, vector::y and vector::z constants
- permit fieldExpr access to time().
Probably not usable or useful for an '#eval' expression,
but useful for a Function1.
- provisioning for hooks into function calls. Establishes token
names for next commit(s).
- use `#word` to concatenate, expand content with the resulting string
being treated as a word token. Can be used in dictionary or
primitive context.
In dictionary context, it fills the gap for constructing dictionary
names on-the-fly. For example,
```
#word "some_prefix_solverInfo_${application}"
{
type solverInfo;
libs (utilityFunctionObjects);
...
}
```
The '#word' directive will automatically squeeze out non-word
characters. In the block content form, it will also strip out
comments. This means that this type of content should also work:
```
#word {
some_prefix_solverInfo
/* Appended with application name (if defined) */
${application:+_} // Use '_' separator
${application} // The application
}
{
type solverInfo;
libs (utilityFunctionObjects);
...
}
```
This is admittedly quite ugly, but illustrates its capabilities.
- use `#message` to report expanded string content to stderr.
For example,
```
T
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-10;
relTol 0;
#message "using solver: $solver"
}
```
Only reports on the master node.
- use FACE_DATA (was SURFACE_DATA) for similarity with polySurface
ENH: add expression value enumerations and traits
- simple enumeration of standard types (bool, label, scalar, vector)
that can be used as a value type-code for internal bookkeeping.
GIT: relocate pTraits into general traits/ directory
- releases ownership of the pointer. A no-op (and returns nullptr)
for references.
Naming consistent with unique_ptr and autoPtr.
DOC: adjust wording for memory-related classes
- add is_const() method for tmp, refPtr.
Drop (ununsed and confusing looking) isTmp method from refPtr
in favour of is_pointer() or movable() checks
ENH: noexcept for some pTraits methods, remove redundant 'inline'
- test for const first for tmp/refPtr (simpler logic)
- decomposePar: -no-fields to suppress decomposition of fields
- makeFaMesh: -no-decompose to suppress creation of *ProcAddressing
and fields, -no-fields to suppress decomposition of fields only
- switch from default topology merge to point merge if degenerate
blocks are detected. This should alleviate the problems noted in
#1862.
NB: this detection only works for blocks with duplicate vertex
indices, not ones with geometrically duplicate points.
ENH: add patch block/face summary in blockMesh generation
- add blockMesh -verbose option to override the static or dictionary
settings. The -verbose option can be used multiple times to increase
the verbosity.
ENH: extend hexCell handling with more cellShape-type methods
- allows better reuse in blockMesh.
Remove blockMesh-local hex edge definitions that shadowed the
hexCell values.
ENH: simplify some of the block-edge internals
- similar to -dry-run handling, can be interrogated from argList,
which makes it simpler to add into utilities.
- support multiple uses of -dry-run and -verbose to increase the
level. For example, could have
someApplication -verbose -verbose
and inside of the application:
if (args.verbose() > 2) ...
BUG: error with empty distributed roots specification (fixes#2196)
- previously used the size of distributed roots to transmit if the
case was running in distributed mode, but this behaves rather poorly
with bad input. Specifically, the following questionable setup:
distributed true;
roots ( /*none*/ );
Now transmit the ParRunControl distributed() value instead,
and also emit a gentle warning for the user:
WARNING: running distributed but did not specify roots!
- added -dry-run, -write-vtk options.
Additional mesh information after creation.
- add parallel reductions and more information for checkFaMesh
ENH: minor cleanup of faPatch internals
- align pointLabels and pointEdges creation more closely with coding
patterns used in PrimitivePatch
- use fileHandler when loading "S0" field.
- was taking from the current head instead from specified commit-ish
ENH: add -debian=NUM convenience option to foamPackRelease
STYLE: relocate compile begin/end messages
COMP: suppress more clang warnings (needed for boost)
- provide a plain stream() method on messageStream to reduce reliance
on casting operators and slightly opaque operator()() calls etc
- support alternative stream for messageStream serial output.
This can be used to support local redirection of output.
For example,
refPtr<OFstream> logging; // or autoPtr, unique_ptr etc
// Later...
Info.stream(logging.get())
<< "Detailed output ..." << endl;
This will use the stdout semantics in the normal case, or allow
redirection to an output file if a target output stream is defined,
but still effectively use /dev/null on non-master processes.
This is mostly the same as this ternary
(logging ? *logging : Info())
except that the ternary could be incorrect on sub-processes,
requires more typing etc.
ENH: use case-relative names of dictionary, IOstream for FatalIOError
- normally yields more easily understandable information
- argList::envExecutable() static method.
This is identical to getEnv("FOAM_EXECUTABLE"), where the name of
the executable has typically been set from the argList construction.
Provides a singleton access to this value from locations that
do not have knowledge of the originating command args (argList).
This is a similar rationale as for the argList::envGlobalPath() static.
- additional argList::envRelativePath() static method.
- make -dry-run handling more central and easier to use by adding into
argList itself.
STYLE: drop handling of -srcDoc (v1706 option)
- replaced with -doc-source for 1712 and never used much anyhow
- UPstream::mpiGather (MPI_Gather) - used by Pstream::listGatherValues
- UPstream::mpiScatter (MPI_Scatter) - used by Pstream::listScatterValues
These are much simpler forms for gather/scatter of fixed-sized
contiguous types data types (eg, primitives, simple pairs etc).
In the gather form, creates a list of gathered values on the master
process. The subranks have a list size of zero.
Similarly, scatter will distribute a list of values to single values
on each process.
Instead of
labelList sendSizes(Pstream::nProcs());
sendSizes[Pstream::myProcNo()] = sendData.size();
Pstream::gatherList(sendSizes);
Can write
const labelList sendSizes
(
UPstream::listGatherValues<label>(sendData.size())
);
// Less code, lower overhead and list can be const.
For scattering an individual value only,
instead of
labelList someValues;
if (Pstream::master()) someValues = ...;
Pstream::gatherList(sendSizes);
const label localValue
(
someValues[Pstream::myProcNo()]
);
Can write
labelList someValues;
if (Pstream::master()) someValues = ...;
Pstream::gatherList(sendSizes);
const label localValue
(
UPstream::listScatterValues<label>(someValues)
);
Can of course also mix listGatherValues to assemble a list on master
and use Pstream::scatterList to distribute.
ENH: adjusted globalIndex gather methods
- added mpiGather() method [contiguous data only] using MPI_Gatherv
- respect localSize if gathering master data to ensure that a
request for 0 master elements is properly handled.
- the size of a List often requires adjustment prior to an operation,
but old values (if any) are not of interest and will be overwritten.
In these cases can use the _nocopy versions to avoid additional memory
overhead of the intermediate list and the copy/move overhead of
retaining the old values (that we will subsequently discard anyhow).
No equivalent for PtrList/UPtrList - this would be too fragile.
- add swap DynamicField with DynamicList
BUG: fixed Dynamic{Field,List} setCapacity corner case
- for the case when the newly requested capacity coincides with the
current addressable size, the resize of the underlying list would have
been bypassed - ie, the real capacity was not actually changed.
- remove (unused) PtrDynList setCapacity method as too fragile
- previously returned the range slice as a UList,
but this prevents convenient assignment.
Apply similar handling for Field/SubField
Allows the following
labelRange range(...);
fullList.slice(range) = identity(range.size());
and
fullList.slice(range) = UIndirectList<T>(other, addr);
ENH: create SubList from full FixedList (simplifies interface)
- allow default constructed SubList. Use shallowCopy to 'reset' later
- previously used an indirect patch to get the sampling locations,
but this doesn't take account of the face flips. Now use
the faceZone intrinsic for generating a properly flipped patch
and provide the sampling locations separately.
STYLE: adjust compatiblity header for surfaceMeshWriter
- supports redistributePar -decompose -fileHandler collated
- supports redistributePar -reconstruct
- does not support redistributePar with collated in redistribution mode
- noticed by Robin Knowles with `decomposePar -fields -copyZero`
The internals for the Foam:cp method combine the behaviour of
a regular `cp` and `cp -R` combined.
When source and target are both directories, the old implementation
created a subdirectory for the contents.
This normally fine,
ok: cp "path1/0/" to "path2/1" -> "path2/1/2"
BUT: cp "path1/0/" to "path2/0" -> "path2/0/0" !!
Now add check for the basenames first.
If they are identical, we probably meant to copy directory contents
only, without the additional subdir layer.
BUG: decomposePar -fields -copyZero copies the wrong directory
- was using the current time name (usually latest) instead of copying
the 0 directory
ENH: accept 0.orig directories as a fallback to copy if the 0 directory
is missing
- avoid deprecated autoPtr check
- bundle bool values in fvPatchField for compacter allocation
- change useImplicit to a set method taking an argument instead of
allowing direct access.
- support simple mesh subsetting to vtu formats to enable debug output
for a subsection of an existing polyMesh
- rudimentary support for VTK from cellShapes is intended for handling
basic primitive cell shapes without a full blown polyMesh description.
For example,
// Create an empty polyMesh with points only
polyMesh debugMesh
(
io,
std::move(points),
faceList(), // faces
labelList(), // owner
labelList(), // neighbour
true // syncPar
);
// Establish the appropriate VTK sizing for the TET shapes
vtk::vtuCells vtuCells;
vtuCells.resetShapes(debugCutTets);
vtuCells.nPoints(debugMesh.nPoints());
NOTE
Since the vtk::internalMeshWriter only uses the polyMesh reference
for the points, it is also possible to create the vtuCells
description without a pointField (or from a different mesh
description) and write out the connectivity using the pointField
from a different mesh.
- allows reuse similar to refPtr for wrapping different content.
- additional control for when contents are copied back,
instead of waiting for the adaptor to go out of scope.
Eg,
if (adaptor.active())
{
adaptor.commit();
adaptor.clear();
}
- static ConstPrecisionAdaptor::get method renamed to 'select' as a
better description of its purpose and avoid confusion with
non-static 'get' method.
Was previously only used within GAMGPreconditioner, but even there
it is better just to use the ConstPrecisionAdaptor directly.
- support non-uniform scaling, prescaling and cartesian coordinate
transformations.
Eg, stretch in one direction and then rotate
```
prescale (1.5 1 1);
transform
{
origin (0 0 0);
rotation
{
type axisAngle;
axis (0 0 1);
angle 45;
}
}
```
- support "transformed" versions of blockMesh vertices, topology.
With the additional of transformations etc, a simplistic application
of a single scale parameter is no longer sufficient.
new: blMesh.vertices(true);
old: blMesh.vertices() * blMesh.scaleFactor();
new: blMesh.topology(true);
old: N/A
- add individual edge access for blockDescriptor.
Saves copying and duplicate calculations.
- handle '(block face)' specification for curved faces,
which is ok for external block faces, but likely somewhat
questionable if used for internal block faces.
- Can specify
```
transform
{
origin (1 2 3);
rotation none;
}
```
instead of the longer form
```
transform
{
origin (1 2 3);
e1 (1 0 0);
e3 (0 0 1);
}
```
COMPAT: remove old (pre-1812) Euler and STARCD keywords
- use "angles", remove old compat name "rotation"
as clutter and possible confusion with "coordinate rotation"
STYLE: remove coordinate rotation move constructors
- an unnecessary holdover from older code.
The original thermoSurfaceFilm sub-models were divided between kinematicSurfaceFilm and thermoSurfaceFilm in order to use the surfaceFilm model in a kinematicCloud.
The film interaction models are now in a kinematicSurface class which can be used in a kinematic cloud adding constant thermal properties (p and T) for some sub-models, e.g. drySplashInteraction/wetSplashInteraction.
pRef and Tref were added to the kinematicSurfaceFilm as entry to the regionFilm when used with a kinematic cloud.
In the finite area surface film model Tref, pRef are stored in filmSubModelBase.
TUT: kinematicParcelFoam: new tutorial pitzDailySprinkles
1) Adding subMesh capabilities to momentumError and div FOs.
- A subMesh is created from cellZones.
- The operators (div, etc) are only calculated in the subMesh.
2) Optionally, halo cells can be added to the cellZones.
3) New helper class to handle the subMesh creation and field mapping.
- adjust commented-out evaluation to avoid warnings.
With code like this
```
#if 0
nxin #eval{ round($nxin / 5) };
#endif
```
The handling of the "#if 0 / #endif" clause uses the plain ISstream
parser to tokenize. This means that the "round(" is parsed as a word
with a mismatched closing ')', whereas the "#eval" parser will slurp
everything in until the closing brace and send it off as a string
to the expression parser.
- snGrad, internalField, neighbourField.
Functional use as per swak: "... + internalField(T) ..."
ENH: additional volume/patch expressions
- deltaT()
STYLE: rename exprDriverWriter -> fvExprDriverWriter
- the original class name was a misnomer since it holds a reference
to fvExprDriver
BUG: expression faceToPoint/pointToFace definitions were flipped
ENH: refactor expression hierarchy and code style
- handle TimeState reference at the top-level for simpler derivations
- unified internal search parameters (cruft)
- makes it easier to use for local or alternative storage.
Eg,
```
tmp<volScalarField> tfld;
tfld.cref(obj.cfindObject<volScalarField>("name"));
if (!tfld)
{
tfld = volScalarField::New("name", ...);
}
```
- resizes to current fieldNames_ size and assigns everything to
false to avoid any "stickiness" if the field ordering changes
between reads.
ENH: additional debugging faOption/fvOption (#2110)
- aids tracing which sources are being used/ignored
- update code style
STYLE: rename CodedSource -> CodedFvSource
- avoid future name clashes with CodedFaSource
- improved separation of patch creation that is also parallel-aware,
which now allows creation in parallel
- memory-safe use of PtrList for adding patches, with a more generalized
faPatchData helper
- use uindirectPrimitivePatch instead of indirectPrimitivePatch
for internal patch handling.
- align boundary methods with polyMesh equivalents
- system/faMeshDefinition instead of constant/faMesh/faMeshDefinition
as per blockMesh convention. Easier to manage definitions, easier
for cleanup.
- drop inheritence from GeoMesh.
- refine definition of patch boundary faces to distinguish between
boundaryFaces() and uniqBoundaryFaces().
* boundaryFaces() for edge to face lookup on boundary edges.
* uniqBoundaryFaces() for accessing quantities such as face areas
or eroding an outer layer
ENH: LabelledItem container, replaces unused 'Keyed' container
- method names in alignment with objectHit, pointIndexHit etc.
Top-level name aligns with labelledTri.
- can now drop older Test-decomposePar for exploration purposes
and simply use -dry-run with the -domains and -method options.
- write VTK file instead of volScalarField in combination
with -dry-run and -cellDist.
Avoids adding any OpenFOAM fields and is usually faster to load.
Also easier to rename than a volScalarField would be when exploring
multiple decompositions.
- minor simplification of #if/#endif handling
ENH: improve input robustness with negative-prefixed expansions (#2095)
- especially in blockMeshDict it is useful to negate an value directly.
Eg,
```
xmax 100;
xmin -$xmax;
```
However, this fails since the dictionary expansion is a two-step
process of tokenization followed by expansion. After the expansion
the given input would now be the following:
```
xmax 100;
xmin - 100;
```
and retrieving a scalar value for 'xmin' fails.
Counteract this by being more generous on tokenized input when
attempting to retrieve a label or scalar value.
If a '-' is found where a number is expected, use it to negate the
subsequent value.
The previous solution was to invoke an 'eval':
```
xmax 100;
xmin #eval{-$xmax};
```
which adds additional clutter.
- intended for the following type of use:
auto oldHandler = fileHandler(fileOperation::NewUncollated());
... do something that only works with uncollated
// Restore previous (if any)
if (oldHandler)
{
fileHandler(std::move(oldHandler));
}
ENH: make fileOperation distributed(bool) mutable
- use is "static-like" and akin to Pstream::parRun(bool),
thus allow toggling of the switch without a const_cast
- return internalEdges() and boundaryEdges() sub lists directly
- calculate and return boundaryFaces() to identify faces attached to
boundary edges.
- minor code cleanup, and add PrimitivePatchBase class for
non-templated code.
STYLE: mark unused parameter in globalMeshData mergePoints
- this constructor was added for similarity with std::vector,
but continues to cause various annoyances.
The main problem is that the templated parameter tends to grab
anything that is not a perfect match for other constructors.
Typically seen with two integers (in 64-bit mode), but various other
cases as well.
If required, the ListOps::create() function provides a lengthier
alternative but one that can also incorporate transformations.
Eg,
pointField pts = ....;
List<scalar> mags
(
List<scalar>::create
(
pts.begin(),
pts.end(),
[](const vector& v){ return magSqr(v); }
);
- additional rcEdge(), rcEdges() methods for reverse order walk
- accept generic edge() method as alternative to faceEdge() for
single edge retrieval.
- edge() method with points -> returns the vector
- reduce the number of operations in edgeDirection methods
DEFEATURE: remove longestEdge global function
- deprecated and replaced by face::longestEdge() method (2017-04)
- reduces code, simplifies creation of new, specialized polyData
writers.
- new templated vtk::GenericPatchWriter, which adds support for
writing both uindirectPrimitivePatch + indirectPrimitivePatch types.
- handle geometric fields separately from regular fields with
* vtk:GenericPatchGeoFieldsWriter
* vtk:indirectPatchGeoFieldsWriter
* vtk:uindirectPatchGeoFieldsWriter
Step 1.
include "addAllRegionOptions.H"
Adds the -allRegions, -regions and -region options to argList.
Step 2.
include "getAllRegionOptions.H"
Processes the options with -allRegions selecting everything
from the regionProperties.
OR use -regions to specify multiple regions (from
regionProperties), and can also contain regular expressions
OR use the -region option
Specifying a single -regions NAME (not a regular expresssion)
is the same as -region NAME and doesn't use regionProperties
Creates a `wordList regionNames`
Step 3.
Do something with the region names.
Either directly, or quite commonly with the following
include "createNamedMeshes.H"
Creates a `PtrList<fvMesh> meshes`
STYLE: add description to some central include files
- make regionName an optional constructor parameter, which eliminates
a separate set of constructors and construction tables. Adjust
internals to treat a missing/empty regionName as a no-op.
- pass in fallback dictionary content via new IOdictionary constructor
with a pointer
ENH: further relax check for matching number of processor dirs
- if the "numberOfSubdomains" entry is missing (or even zero)
ignore checks of processor dirs as meaningless.
- additional debug information
- improve support for dictionary specification of constant, polynomial
and table entries. These previously only worked properly for
primitiveEntry, which causes confusion.
- extend table Function1 to include TableFile functionality.
Simplifies switching and modifying content.
- additional default construct
- add explicit zero-size constructor for ITstream.
For tagged dispatching, without ambiguity
- elminate mandatory name for parsing versions.
This makes it easier to use ITstream, IStringStream, UListStream
interchangeable.
- some code used copy construct from dictionary::null instead.
The result is the same but suggests that something else may be intended.
Only need dictionary::null for const-ref usage.
- allows use of surface names starting with a digit
(by quoting the name).
User is responsible for not generating bad names for output files.
Eg "bad.**.name", since these will be difficult to handle from the
shell
- The keyType is primarily used within dictionary reading, whereas
wordRe and wordRes are used for selectors in code.
Unifying on wordRe and wordRes reduces the number matching options.
- additional dummy template parameter to assist with supporting
derived classes. Currently just used for string types, but can be
extended.
- provide hash specialization for various integer types.
Removes the need for any forwarding.
- change default hasher for HashSet/HashTable from 'string::hash'
to `Hash<Key>`. This avoids questionable hashing calls and/or
avoids compiler resolution problems.
For example,
HashSet<label>::hasher and labelHashSet::hasher now both properly
map to Hash<label> whereas previously HashSet<label> would have
persistently mapped to string::hash, which was incorrect.
- standardize internal hashing functors.
Functor name is 'hasher', as per STL set/map and the OpenFOAM
HashSet/HashTable definitions.
Older code had a local templated name, which added unnecessary
clutter and the template parameter was always defaulted.
For example,
Old: `FixedList<label, 3>::Hash<>()`
New: `FixedList<label, 3>::hasher()`
Unchanged: `labelHashSet::hasher()`
Existing `Hash<>` functor namings are still supported,
but deprecated.
- define hasher and Hash specialization for bitSet and PackedList
- add symmetric hasher for 'face'.
Starts with lowest vertex value and walks in the direction
of the next lowest value. This ensures that the hash code is
independent of face orientation and face rotation.
NB:
- some of keys for multiphase handling (eg, phasePairKey)
still use yet another function naming: `hash` and `symmHash`.
This will be targeted for alignment in the future.