- 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.
- 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.
- 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
- 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.
- 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.
- wrap command-line retrieval of fileName with an implicit validate.
Instead of this:
fileName input(args[1]);
fileName other(args["someopt"]);
Now use this:
auto input = args.get<fileName>(1);
auto other = args.get<fileName>("someopt");
which adds a fileName::validate on the inputs
Because of how it is implemented, it will automatically also apply
to argList getOrDefault<fileName>, readIfPresent<fileName> etc.
- adjust fileName::validate and clean to handle backslash conversion.
This makes it easier to ensure that path names arising from MS-Windows
are consistently handled internally.
- dictionarySearch: now check for initial '/' directly instead of
relying on fileName isAbsolute(), which now does more things
BREAKING: remove fileName::clean() const method
- relying on const/non-const to control the behaviour (inplace change
or return a copy) is too fragile and the const version was
almost never used.
Replace:
fileName sanitized = constPath.clean();
With:
fileName sanitized(constPath);
sanitized.clean());
STYLE: test empty() instead of comparing with fileName::null
It was only looking for faces that were used in both
endpoints but not actually checking whether they were indeed
an edge (== consecutive vertex) in all faces. So if one
face had an additional crossing edge and another didn't it
would find more edgeFaces than the proper
'primitiveMesh::edgeFaces()' routine.
This occasionally happened inside snappyHexMesh
(e.g. motorBike tutorial)
- new '-ascii' option to write in ASCII format instead of the
controlDict setting. This can be useful when generating fields that
should be parsed with other tools, or for visual inspection.
- correct mismatch of option names and lookups
- can use either command-line option "-load-fields" or dictionary
entry "readFields" to specify field names to be preloaded.
Essentially the same functionality as with a readFields function
object but with a lot less typing.
- tutorial examples provided by Ryan Danks <ryan.danks@rwdi.com>
illustrate using setExpr* utilities to calculate a quantity
as a post-processing step.
- simplifies local toggling.
- centralize fileModification static variables into IOobject.
They were previously scattered between IOobject and regIOobject
- override casename, procesorCase flags to guarantee reconstructed
case to be written to the undecomposed directory
- alternative is to construct a Zero mesh on the undecomposed
runTime and add all other bits to that but that has not been
pursued
- for use when the is_contiguous check has already been done outside
the loop. Naming as per std::span.
STYLE: use data/cdata instead of begin
ENH: replace random_shuffle with shuffle, fix OSX int64 ambiguity
- direct check of punctuation.
For example,
while (!tok.isPunctuation(token::BEGIN_LIST)) ..
instead of
while (!(tok.isPunctuation() && tok.pToken() == token::BEGIN_LIST)) ..
Using direct comparison (tok != token::BEGIN_LIST) can be fragile
when comparing int values:
int c = readChar(is);
while (tok != c) .. // Danger, uses LABEL comparison!
- direct check of word.
For example,
if (tok.isWord("uniform")) ..
instead of
if (tok.isWord() && tok.wordToken() == "uniform") ..
- make token lineNumber() a setter method
ENH: adjust internal compound method empty() -> moved()
- support named compound tokens
STYLE: setter method for stream indentation
- eliminates a potentially invalid code branch.
Since it essentially had the same internals as std::swap anyhow,
make that more evident.
ENH: use std::swap for basic types
- makes it clearer that they do not rely on any special semantics
The polyMesh construct-from-components will now ignore
the readOpt for the supplied primitives as before.
This again re-allows READ_IF_PRESENT for fv* in
combination with supplied primitives.
Changed IO flag so that new mesh is created
- was using old 'faces', 'owner' etc but then used the new patch starts
Corrected logic for contMap in polyTopoChange
- previously hard-coded, now adjustable within PDRsetFieldsDict
// Change some predefined patch names
patchNames
{
ground ground;
outer outer;
}
ENH: additions to PDRutils, improve comments
- expose enumerated expansion names and gridControl (PDRblock).
Not commonly needed, but useful to have access when defining
other grid generators
TUT: update PDRsetFieldsDict and tutorials to use "ground"
- remove tutorial references to unused types and legacy obstacles
- use "ground" for the boundary conditions instead of "seaGround".
Consistent with PDRblockMesh
In reconstruct mode redistributePar will have
- master read undecomposed mesh
- slaves construct dummy mesh (0 faces/points etc.)
but correct patches and zones
so all processors have two valid meshes. This was
all handled inside fvMeshTools::newMesh and this
was behaving differently.
The SPL can now be weighted according to the new 'SPLweighting' entry
that can be set to:
- none: no weighting
- dBA : dB(A)
- dBB : dB(B)
- dBC : dB(C)
- dBD : dB(D)
This commit also includes code refactoring of the noiseModel class to
remove the dependency on noiseFFT/declutter.
This adds a 'geometry' scheme section to the system/fvSchemes:
geometry
{
type highAspectRatio;
}
These 'fvGeometryMethod's are used to calculate
- deltaCoeffs
- nonOrthoCoeffs
etc and can even modify the basic face/cellCentres calculation.
- bundles selection and control parameters used when creating
iso-surfaces. This simplifies selection and specification
- drop old compatibility handling of "cell" as a bool
- harmonize filter/regularisation flags for iso-surface
- for dictionary input, accept "isoMethod" and "isoAlgorithm" as being
synonymous. Using "isoMethod" is less subject to typing errors.
- robuster matching behaviour when encountering paths that themselves
contain the word "processor" in them. For example,
"/path/processor0generation2/case1/processor10/system"
will now correctly match on processor10 instead of failing.
- use procRangeType for encapsulating the processor ranges
- provision for information of distributed vs non-distributed roots.
The information is currently available from the initial setup, but
can useful to access directly within fileOperation.
STYLE: modernize list iteration
- (tet, pyr, hex) can be identified from their number of faces
and vertices. For these common shapes can use static `test()`
method instead of the virtual isA() method.
This is much cheaper for calling on an individual basis since
it avoids the overhead of constructing an object.
ENH: tetCell edge/reverseEdge (already had tetEdge)
- non-uniform offsets are generated due to truncation errors,
which can lead to problems later on (e.g. redistributePar).
Detect if the offsets are close to being uniform.
ENH: limit output to 25 cell types per line for readability
- makes it easier to trace potential format errors etc
STYLE: downgrade warning about polyhedrals to a simple info message
- can assume that polyhedral support is widespread enough to not
warrant a warning.
- first sort the cells into their ijk bins, and restrict testing for
face orientation to those faces with an owner or neighbour that has
an ijk bin.
ENH: ensure polyMesh from PDRblockMesh is marked as AUTO_WRITE
- the particular polyMesh constructor inherits the writeOpt, which
makes is dependent on the caller and thus somewhat fragile for the
top level caller.
- can help when designing/debugging blockMesh layouts
- propagate low-level cellModel methods face() and edge() to cellShape
STYLE: relocate blockMesh OBJ output to application only
- remove blockTopology files in cleanCase function
- improve code consistency in top-level blockMesh, PDRblockMesh
generation.
- add -recentre option to shift points according to the bounding box
centre before performing other operations
- add -auto-origin to use the bounding box centre as the origin for
rotations. Has lower priority than the -origin option.
- surfaceTransformPoints now has distinct -read-scale, -write-scale
options (as per surfaceMeshConvert). Silently accepts -scale as
equivalent to -write-scale, for backwards compatibility and
similarity with transformPoints
- add -steps option for surfaceRefineRedGreen for successive
refinement
- the problem arises when output fields are missing on some
processors.
When the information is combined, the resulting HashTables can have
different insertion orders. This poses an issue when there are hash
key collisions and thus different chaining.
- Use sorted order.
- returns a range of `int` values that can be iterated across.
For example,
for (const int proci : Pstream::subProcs()) { ... }
instead of
for
(
int proci = Pstream::firstSlave();
proci <= Pstream::lastSlave();
++proci
)
{
...
}
- returns a range of `int` values that can be iterated across.
For example,
for (const int proci : Pstream::allProcs()) { ... }
instead of
for (label proci = 0; proci < Pstream::nProcs(); ++proci) { ... }
- introduce WM_COMPILE_CONTROL variable to convey control information
into the build rules.
The convention (as per spack):
- '+' to select a feature
- '~' to deselect a feature
Eg, to select the gold linker, and disable openmp
(spaces are not required):
WM_COMPILE_CONTROL="+gold ~openmp"
CONFIG: accept FOAM_EXTRA_LDFLAGS for AMD, gold, Mingw linkers
CONFIG: generalize PROJECT_LIBS (-ldl used almost universally)
- since the context (laminar/RAS/LES) is already given by the
sub-dictionary, it is redundant to use as prefix as well.
- silently support the longer names as compat methods
- with '&&' conditions, often better to check for non-null autoPtr
first (it is cheap)
- check as bool instead of valid() method for cleaner code, especially
when the wrapped item itself has a valid/empty or good.
Also when handling multiple checks.
Now
if (ptr && ptr->valid())
if (ptr1 || ptr2)
instead
if (ptr.valid() && ptr->valid())
if (ptr1.valid() || ptr2.valid())
- For some cases it can be helpful to test if additional libraries can
be properly resolved.
This can be useful in scripts to test for additional capability:
if foamHasLibrary geometricVoF
then ...
fi
But also directly from the command-line to help resolve configuration
issues:
foamHasLibrary -verbose petscFoam
Could not load "petscFoam"
libpetsc.so.3.13: cannot open shared object file: No such file or directory
- the earlier implementation of externally controlled lumped point
motion (see merge request !120 and OpenFOAM-v1706 release notes) was
conceived for the motion of simple structures such as buildings or
simple beams. The motion controller was simply defined in terms of
an orientation axis and divisions along that axis.
To include complex structures, multiple motion controllers are
defined in terms of support points and connectivity.
The points can have additional node Ids associated with them, which
makes it easier to map to/from FEA models.
OLD system/lumpedPointMovement specification
--------------------------------------------
//- Reference axis for the locations
axis (0 0 1);
//- Locations of the lumped points
locations (0 0.05 .. 0.5);
NEW system/lumpedPointMovement specification
--------------------------------------------
// Locations of the lumped points
points
(
(0 0 0.00)
(0 0 0.05)
...
(0 0 0.50)
);
//- Connectivity for motion controllers
controllers
{
vertical
{
pointLabels (0 1 2 3 4 5 6 7 8 9 10);
}
}
And the controller(s) must be associated with the given
pointDisplacement patch. Eg,
somePatch
{
type lumpedPointDisplacement;
value uniform (0 0 0);
controllers ( vertical ); // <-- NEW
}
TUT: adjust building motion tutorial
- use new controllor definitions
- replace building response file with executable
- add updateControl in dynamicMeshDict for slowly moving structure