- previously introduced `getOrDefault` as a dictionary _get_ method,
now complete the transition and use it everywhere instead of
`lookupOrDefault`. This avoids mixed usage of the two methods that
are identical in behaviour, makes for shorter names, and promotes
the distinction between "lookup" access (ie, return a token stream,
locate and return an entry) and "get" access (ie, the above with
conversion to concrete types such as scalar, label etc).
- Favour use of argList methods that are more similar to dictionary
method names with the aim of reducing the cognitive load.
* Silently deprecate two-parameter get() method in favour of the
more familiar getOrDefault.
* Silently deprecate opt() method in favour of get()
These may be verbosely deprecated in future versions.
- enumerated values are (points | topology) which can be optionally
specified in the blockMeshDict. Default is 'topology'.
If the command-line option `blockMesh -merge-points` is specified,
this has absolute priority over any blockMeshDict entry.
STYLE: changed blockMesh "-blockTopology" option to "-write-obj"
- this is more specific to what it does. Potentially wish to add a
"-write-vtk" option in the future.
TUT: adjust tutorials to use preferred or necessary merge strategies:
* channel395DFSEM - topology
* nozzleFlow2D - points
* pipeCyclic - points
- adds into the include-quoted search list instead the general (-Idir)
search list.
* makes it less subject to ordering (since it will now generally be
searched first) and makes it less subject to how duplicate removal
is implemented. In some compilers (#1627), the last instance of
a duplicate directory would be used and not the first instance.
* removes clutter in some Make/options files
COMP: add missing linkage libraries
- simplified templating, which cleans up code and does not appear to
break any normal user coding.
ENH: unique_ptr instead of homegrown demand-driven handling.
- remove MSWindows components (code and makefiles)
- use cxx, hxx extensions to reduce possible confusion with other
"list" and "vector" classes
- use C++ versions for C headers
- adjustments to internal handling to improve run-time addition of
other formats (eg, with additional user library)
For example, to write a binary STL with a '.stl' extension:
$ surfaceMeshConvert input.obj -write-format stlb output.stl
Or in a sampler,
to specify the input type without ambiguity:
surf
{
type meshedSurface;
surface sampling.inp;
fileType starcd;
scale 0.001;
...
}
STYLE: regularize naming for input/output scaling
* -read-scale (compat: -scaleIn)
* -write-scale (compat: -scaleOut)
CONFIG: change edge/surface selection name for STARCD format
- now select as "starcd" instead of "inp" to avoid naming ambiguity
with abaqus
- uses MeshedSurface instead of triSurface to prevent automatic
triangulation.
- supports '-patches' and '-excludePatches' controls as per foamToVTK.
For example,
surfaceSplitByPatch -patches '( ".*rider.*" )' motorBike.obj
ENH: use MeshedSurface for surfaceSubset
- align Switch more with Enum.
Now have find(), found() static methods.
Constructors with failsafe option.
The find() method makes for clearer coding:
OLD
Switch sw(some_string, true); // NB: true = allowBad
if (sw.valid()) ...
NOW
Switch sw = Switch::find(some_string);
if (sw.good()) ...
or
if (Switch::found(some_string)) ...
- improve construct from dictionary to handle all valid token types.
Previously just read in a word.
- Remove asText() method - replaced by c_str() and str() several
versions ago.
- renamed 'core/' -> 'base/' to avoid gitignore masking when re-adding
files
- rename 'nas/' to 'nastran/' for more clarity
- relocated OBJstream from surfMesh to fileFormats
STYLE: remove unused parseNASCoord. Was deprecated 2017-09
- includes restructuring and simplification of low-level ensight part
handling and refactor of backends to improve code reuse.
foamToEnsight
-------------
* new cellZone support.
This was previously only possible via a separate foamToEnsightParts
utility that was not parallelized.
* support for point fields.
* `-nearCellValue` option (as per foamToVTK)
* data indexing now uses values from the time index.
This is consistent with the ensightWrite function object and
can help with restarts.
* existing ensight directories are removed, unless the -no-overwrite
option is supplied
foamToEnsightParts
------------------
* now redundant and removed.
ensightOutputSurface (new class)
--------------------------------
* a lightweight wrapper for point/face references that is tailored
for the ensightSurfaceWriter. It uses compact face/point information
and is serial only, since this is the format requirements from the
surfaceWriter class.
ensightMesh (revised class)
---------------------------
* now only holds a polyMesh reference, which removes its dependency
on finiteVolume and allows it to be relocated under fileFormats
instead of conversion.
Removed classes: ensightParts, ensighPartFaces, ensightPartCells
- these were used by foamToEnsightParts, but not needed anymore.
- remove (unused) Istream constructors, prune some unused methods,
rationalize write() vs writeDict().
Deprecate inconsistent construction order.
- handle empty names for ".ftr" surface patches (for plain triSurface
format) with double-quoted strings for more reliable streaming.
Written on a single line.
This is _backward_ compatible, but if users have been parsing these
files manually, they will need to adjust their code.
Previously:
```
(
frt-fairing:001%1
empty
windshield:002%2
empty
...
)
```
Updated (with example handling of empty name):
```
(
frt-fairing:001%1 empty
windshield:002%2 ""
...
)
```
The controlBoxes wordList was removed from NURBS3DVolume in the
pre-release phase but writeMorpherCPs was not updated accordingly.
TUT: added the invocation of writeMorpherCPs in one of the tutotials to
help identify future regression
- the PDRsetFields utility processes a set of geometrical obstructions
to determine the equivalent blockage effects.
These fields are necessary inputs for PDRFoam calculations.
After setting up the geometries, the -dry-run option can be used to
generate a VTK file for diagnosis and post-processing purposes.
- this is an initial release, with improvements slated for the future.
NOTE
- the field results may be less than fully reliable when run in
single-precision. This howver does not represent a realistic
restriction since the prepared fields target a combustion
application which will invariably be double-precision.
- The previous option 'write-nut' controlled the writing of turbulence
nut, but other turbulence fields were always written.
These have been shown to be a source of instability for many cases.
This commit replaces the 'write-nut' option by a 'writeTurbulenceFields'
option that controls the writing of all turbulence fields.
If not set, only the velocity field is written.
For compatibility, the old 'write-nut' option is still recognized
but is redirected to 'writeTurbulenceFields'.
The adjoint library is enhanced with new functionality enabling
automated shape optimisation loops. A parameterisation scheme based on
volumetric B-Splines is introduced, the control points of which act as
the design variables in the optimisation loop [1, 2]. The control
points of the volumetric B-Splines boxes can be defined in either
Cartesian or cylindrical coordinates.
The entire loop (solution of the flow and adjoint equations, computation
of sensitivity derivatives, update of the design variables and mesh) is
run within adjointOptimisationFoam. A number of methods to update the
design variables are implemented, including popular Quasi-Newton methods
like BFGS and methods capable of handling constraints like loop using
the SQP or constraint projection.
The software was developed by PCOpt/NTUA and FOSS GP, with contributions from
Dr. Evangelos Papoutsis-Kiachagias,
Konstantinos Gkaragounis,
Professor Kyriakos Giannakoglou,
Andy Heather
[1] E.M. Papoutsis-Kiachagias, N. Magoulas, J. Mueller, C. Othmer,
K.C. Giannakoglou: 'Noise Reduction in Car Aerodynamics using a
Surrogate Objective Function and the Continuous Adjoint Method with
Wall Functions', Computers & Fluids, 122:223-232, 2015
[2] E. M. Papoutsis-Kiachagias, V. G. Asouti, K. C. Giannakoglou,
K. Gkagkas, S. Shimokawa, E. Itakura: ‘Multi-point aerodynamic shape
optimization of cars based on continuous adjoint’, Structural and
Multidisciplinary Optimization, 59(2):675–694, 2019
- silently deprecate 'startsWith', 'endsWith' methods
(added in 2016: 2b14360662), in favour of
'starts_with', 'ends_with' methods, corresponding to C++20 and
allowing us to cull then in a few years.
- handle single character versions of starts_with, ends_with.
- add single character version of removeEnd and silently deprecate
removeTrailing which did the same thing.
- drop the const versions of removeRepeated, removeTrailing.
Unused and with potential confusion.
STYLE: use shrink_to_fit(), erase()
- drop plugin support for Qt4 (old paraview)
- handle upcoming changes in VTK version naming in CMake files
* VTK_MAJOR_VERSION becomes VTK_VERSION_MAJOR etc.
- this largely reverts 3f0f218d88 and 4ee65d12c4.
Consistent addressing with support for wrapped pointer types (eg,
autoPtr, std::unique_ptr) has proven to be less robust than desired.
Thus rescind HashTable iterator '->' dereferencing (from APR-2019).
- change contiguous from a series of global functions to separate
templated traits classes:
- is_contiguous
- is_contiguous_label
- is_contiguous_scalar
The static constexpr 'value' and a constexpr conversion operator
allow use in template expressions. The change also makes it much
easier to define general traits and to inherit from them.
The is_contiguous_label and is_contiguous_scalar are special traits
for handling data of homogeneous components of the respective types.
A set of libraries and executables creating a workflow for performing
gradient-based optimisation loops. The main executable (adjointOptimisationFoam)
solves the flow (primal) equations, followed by the adjoint equations and,
eventually, the computation of sensitivity derivatives.
Current functionality supports the solution of the adjoint equations for
incompressible turbulent flows, including the adjoint to the Spalart-Allmaras
turbulence model and the adjoint to the nutUSpaldingWallFunction, [1], [2].
Sensitivity derivatives are computed with respect to the normal displacement of
boundary wall nodes/faces (the so-called sensitivity maps) following the
Enhanced Surface Integrals (E-SI) formulation, [3].
The software was developed by PCOpt/NTUA and FOSS GP, with contributions from
Dr. Evangelos Papoutsis-Kiachagias,
Konstantinos Gkaragounis,
Professor Kyriakos Giannakoglou,
Andy Heather
and contributions in earlier version from
Dr. Ioannis Kavvadias,
Dr. Alexandros Zymaris,
Dr. Dimitrios Papadimitriou
[1] A.S. Zymaris, D.I. Papadimitriou, K.C. Giannakoglou, and C. Othmer.
Continuous adjoint approach to the Spalart-Allmaras turbulence model for
incompressible flows. Computers & Fluids, 38(8):1528–1538, 2009.
[2] E.M. Papoutsis-Kiachagias and K.C. Giannakoglou. Continuous adjoint methods
for turbulent flows, applied to shape and topology optimization: Industrial
applications. 23(2):255–299, 2016.
[3] I.S. Kavvadias, E.M. Papoutsis-Kiachagias, and K.C. Giannakoglou. On the
proper treatment of grid sensitivities in continuous adjoint methods for shape
optimization. Journal of Computational Physics, 301:1–18, 2015.
Integration into the official OpenFOAM release by OpenCFD
- when running in serial but within a processor directory,
argList::globalPath() is to be used instead of Time.globalPath()
For other cases there is no difference.
- when windows portable executables (.exe or .dll) files are loaded,
their dependent libraries not fully loaded. For OpenFOAM this means
that the static constructors which are responsible for populating
run-time selection tables are not triggered, and most of the run-time
selectable models will simply not be available.
Possible Solution
=================
Avoid this problem by defining an additional library symbol such as
the following:
extern "C" void libName_Load() {}
in the respective library, and tag this symbol as 'unresolved' for
the linker so that it will attempt to resolve it at run-time by
loading the known libraries until it finds it. The link line would
resemble the following:
-L/some/path -llibName -ulibName_Load
Pros:
- Allows precise control of forced library loading
Cons:
- Moderately verbose adjustment of some source files (even with macro
wrapping for the declaration).
- Adjustment of numerous Make/options files and somewhat ad hoc
in nature.
- Requires additional care when implementing future libraries and/or
applications.
- This is the solution taken by the symscape patches (Richard Smith)
Possible Solution
=================
Avoid this problem by simply force loading all linked libraries.
This is done by "scraping" the information out of the respective
Make/options file (after pre-processing) and using that to define
the library list that will be passed to Foam::dlOpen() at run-time.
Pros:
- One-time (very) minimal adjustment of the sources and wmake toolchain
- Automatically applies to future applications
Cons:
- Possibly larger memory footprint of application (since all dependent
libraries are loaded).
- Possible impact on startup time (while loading libraries)
- More sensitive to build failures. Since the options files are
read and modified based on the existence of the dependent
libraries as a preprocessor step, if the libraries are initially
unavailable for the first attempt at building the application,
the dependencies will be inaccurate for later (successful) builds.
- This is solution taken by the bluecape patches (Bruno Santos)
Adopted Solution
================
The approach taken by Bruno was adopted in a modified form since
this appears to be the most easily maintained.
Additional Notes
================
It is always possible to solve this problem by defining a corresponding
'libs (...)' entry in the case system/controlDict, which forces a dlOpen
of the listed libraries. This is obviously less than ideal for large-scale
changes, but can work to resolve an individual problem.
The peldd utility (https://github.com/gsauthof/pe-util), which is
also packaged as part of MXE could provide yet another alternative.
Like ldd it can be used to determine the library dependencies of
binaries or libraries. This information could be used to define an
additional load layer for Windows.
- adjust naming of quaternion 'rotationSequence' to be 'eulerOrder'
to reflect its purpose.
- provide rotation matrices directly for these rotation orders in
coordinateRotations::euler for case in which the rotation tensor
is required but not a quaternion.
- Eg, with surface writers now in surfMesh, there are fewer libraries
depending on conversion and sampling.
COMP: regularize linkage ordering and avoid some implicit linkage (#1238)
- remove writeGeometry() in favour of write() and make it pure virtual
so that all writers must explicitly deal with it.
- establish proxy extension at construction time and treated as an
invariant thereafter. This avoids potentially surprising changes in
behaviour when writing.
- While a rectilinear mesh can be created with blockMesh, not every mesh
created with blockMesh will satisfy the requirements for being a
rectilinear mesh.
This alternative to blockMesh uses a single block that is aligned
with the xy-z directions and specifications of the control points,
mesh divisions and expansion ratios. For example,
x
{
points ( -13.28 -0.10 6.0 19.19 );
nCells ( 10 12 10 );
ratios ( 0.2 1 5 );
}
y { ... }
z { ... }
With only one block, the boundary patch definition is simple and the
canonical face number is used directly. For example,
inlet
{
type patch;
faces ( 0 );
}
outlet
{
type patch;
faces ( 1 );
}
sides
{
type patch;
faces ( 2 3 );
}
...
- After a mesh is defined, it is trivial to retrieve mesh-related
information such as cell-volume, cell-centres for any i-j-k location
without an actual polyMesh.
STYLE: remove -noFunctionObjects from blockMesh
- no time loop, so function objects cannot be triggered anyhow.
- The writers have changed from being a generic state-less set of
routines to more properly conforming to the normal notion of a writer.
These changes allow us to combine output fields (eg, in a single
VTK/vtp file for each timestep).
Parallel data reduction and any associated bookkeeping is now part
of the surface writers.
This improves their re-usability and avoids unnecessary
and premature data reduction at the sampling stage.
It is now possible to have different output formats on a per-surface
basis.
- A new feature of the surface sampling is the ability to "store" the
sampled surfaces and fields onto a registry for reuse by other
function objects.
Additionally, the "store" can be triggered at the execution phase
as well
- can now safely use labelList::null() instead of emptyLabelList for
return values. No special treatment required for lists.
Possible replacements:
if (notNull(list) && list.size()) -> if (list.size())
if (isNull(list) || list.empty()) -> if (list.empty())
The receiver may still wish to handle differently to distinguish
between a null list and an empty list, but no additional special
protection is required when obtaining sizes, traversing, outputting
etc.
- changed ensightOutput from a class solely comprising static methods to
a namespace and added in sub-namespaces Detail and Serial.
This makes it easier to "mix-in" functions at different levels.
Refactored and combined some serial/parallel code where possible.
The general ensightOutput namespace has now shifted to be in the
fileFormats lib, while leaving volField outputs in the conversion lib
and cloud outputs in the lagrangian-intermediate lib.
The ensightCloud namespace is now simply folded into the new
ensightOutput namespace.
These changes clean up some code, reduce fragmentation and
duplication and removes the previous libconversion dependency for
sampling.
- use int for ensight nTypes constexpr
Note: issue #1176 is unaffected except for the change in file name:
ensightOutputTemplates.C -> ensightOutputVolFieldTemplates.C
- changed the sectorCoeffs keyword to 'point' from 'axisPt'
for more similarity with other dictionaries.
Continue to accept 'axisPt' for compatibility.
- a valid() method (same as !empty() call) for consistency with other
containers and data types
- a centre() method (same as midpoint() method) for consistency with
other OpenFOAM geometric entities
- fixed some more places with an explicit AUTO_WRITE.
BUG: revert handling of the readOption. It should not be NO_READ.
In cases where the user a IOobject without specifying read/write, it
defaults to NO_READ anyhow. However, the move constructor can also
be called with empty lists and a read option. This has the same
signature, but obviously will not work with NO_READ.
- the utility had automatic triangulation removed some time ago, but
never changed its name.
- catch old uses with a surfaceMeshTriangulate deprecated script
- note that it does not actually triangulate unless necessary, should
probably receive a new name.
- use newer constructs for handling processor/non-processor patch
selection etc.
- provide relativePath() for argList and for Time.
These are relative to the case globalPath().
Eg,
Info<< "output: " << runTime.relativePath(outputFile) << nl;
- makes the intent clearer and avoids the need for additional
constructor casting. Eg,
labelList(10, Zero) vs. labelList(10, 0)
scalarField(10, Zero) vs. scalarField(10, scalar(0))
vectorField(10, Zero) vs. vectorField(10, vector::zero)
- now use findEtcEntry() instead to handle file or directory.
Added findEtcEntries(), which provides provides a common code basis
for findEtcDirs(), findEtcFiles() ...
- for some special cases we wish to mark command-line arguments as
being optional, in order to do our own treatment. For example,
when an arbitrary number of arguments should be allowed.
Now tag this situation with argList::noMandatoryArgs().
The argList::argsMandatory() query can then be used in any further
logic, including the standard default argument checking.
- with the new default check, can consolidate the special-purpose
"setRootCaseNonMandatoryArgs.H"
into the regular
"setRootCase.H"
- revert to a simple "setRootCase.H" and move all the listing related
bits to a "setRootCaseLists.H" file. This leaves the information
available for solvers, or whoever else wishes, without being
introduced everywhere.
- add include guards and scoping to the listing files and rename to
something less generic.
listOptions.H -> setRootCaseListOptions.H
listOutput.H -> setRootCaseListOutput.H
- similar to the foamEtcFile script -mode=... option, the specific
search location (user/group/other) can now also specified for
string expansions and as a numerical value for etcFile()
For example, if searching for group or other (project) controlDict,
but not wishing to see the user controlDict:
1. foamEtcFile -mode=go controlDict
2. fileName dictFile("<etc:go>/controlDict");
dictFile.expand();
3. etcFile(controlDict, false, 0077);
The default behaviour for searching all contexts is unchanged.
1. foamEtcFile controlDict
2. fileName dictFile("<etc>/controlDict");
dictFile.expand();
3. etcFile(controlDict);
- change previous default (convert all faceZones unless -noFaceZones
specified) with the default behaviour to only convert face zones on
request.
- uses the '-faceZones' option as per foamToEnsight
Reference:
Comte-Bellot, G., and Corrsin, S., "Simple Eulerian Time Correlation of
Full- and Narrow-Band Velocity Signals in Grid-Generated, 'Isotropic'
Turbulence," Journal of Fluid Mechanics, Vol. 48, No. 2, 1971,
pp. 273–337.
- now placed under postProcessing/checkMesh and postProcessing/checkAMI,
respectively.
Output files are now also tagged with the id of the patch, in case
there are multiple AMI patches in use.
- use cellCentres() instead of volField equivalent for vtk conversion
- make looping variables more consistent
- centralize the transcription of OpenFOAM -> vtk tuples
- provide default WM_DIR if not already set, to improve robustness if a
reduced environment is used
- add etc/ to WM_PROJECT_SITE search. This makes the site directory
structure consistent with the OpenFOAM structure.
Eg,
WM_PROJECT_SITE/etc/..
WM_PROJECT_SITE/bin/..
WM_PROJECT_SITE/platforms/..
- Don't set/export WM_OSTYPE. The default is POSIX and is properly
defaulted throughout, including in CMakeLists-OpenFOAM.txt (also for
Catalyst)
- removed reliance on ParaView_INCLUDE_DIR variable for conveying the
major.minor version information when compiling. This can be somewhat
fragile and also adds variable that is an unnecessary when running
(only used when compiling).
Instead use `have_pvplugin_support` function in paraviewFunctions
wmake script to determine the maj.min from the PV_PLUGIN_PATH
since we have already defined the output path there with paraview
maj.min numbering.
Can now build with paraview from the operating system,
provided that it has develop headers available.
ParaView_VERSION=system
In the etc/config.sh/paraview setup, the maj.min is taken from
the corresponding `paraview --version` output and used when
defining the PV_PLUGIN_PATH.
During the build, the include path taken from `paraview-config`
for a system installation, from the guess installation root
of the paraview binary, or ParaView_DIR otherwise.
NB: using a system ParaView for building runTimePostProcessing is unsupported.
- these types of builds appear to have various library resolution issues
(eg, libexpat not being loaded). Additionally, the build logic does
not yet cover this type of use case.
- cfindObject() for const pointer access.
- getObject() for mutable non-const pointer access, similar to the
objectRegistry::getObjectPtr()
- cfindObject(), findObject(), getObject() with template type access
to also check the headerClassName.
For example,
cfindObject("U") -> good
cfindObject<volVectorField>("U") -> good
cfindObject<volScalarField>("U") -> nullptr
This allows inversion of looping logic.
1) Obtain the names for a particular Type
for (const word& objName : objs.sortedNames<Type>())
{
const IOobject* io = objs[objName];
...
}
2) Use previously obtained names and apply to a particular Type
for (const word& objName : someListOfNames)
{
const IOobject* io = objs.cfindObject<Type>(objName);
if (io)
{
...
}
}
- can be used, for example, to visualize all wall cells - for quality
or other purposes - without requiring an intermediate faceSet for
the selection. Request arising from pending merge !213.
- vtkWrite with moving mesh was not updated the subsets properly,
which caused it to crash.
- foamToVTK -overwrite ignored for single region cases,
was working for multi-region cases
- minor documentation changes
- Default format is now XML binary (base64) instead of legacy format.
The old -xml option is redundant and ignored.
The new -legacy option can be used to force legacy output instead.
- Polyhedral decomposition is now off by default (old -poly is ignored).
The option -poly-decomp forces decomposition of polyhedrals into
primitive shapes.
- reduced memory footprint by reading and converting fields
successively.
- Creation of symlinks to processor files is no longer required or
desired. The old -noLinks option is ignored.
- Ignore -useTimeName option. Always number according to timeIndex.
- parallel list output for foamVtkOutput
- simplified '.series' file output
- beginDataArray() method instead of openDataArray() + closeTag()
since this seems to be the most common use anyhow.
With an optional argument for leaving the tag open, this works the
same as openDataArray() which may be deprecated in the future.
- begin/end methods for CellData, PointData, FieldData (commonly used)
- templating parameters for file headers, content version,
legacy fields. This improves coding robustness and convenience of use.
- use formatter and higher-level methods for legacy output
- attribute quoting character now part of the formatter itself
instead of as an argument for xmlAttr().
Toggle with quoting() method.
- pair-wise processing of xml attributes, which also allows them to be
passed as optional entries when creating an xml tag.
- xmlComment with multiple arguments
- use std::string instead of c-string for the string constants
- centralize some definitions of resources into foamVersion.H
Now expose some of the hard-coded values used in foamEtcFiles()
so that they can be known or even overridden as required.
Relocate to src/OpenFOAM/include as a constant location.
- For compatibility, access to the old global names is provided via
macros
#define FOAMversion foamVersion::version
#define FOAMbuild foamVersion::build
#define FOAMbuildArch foamVersion::buildArch
- this isolation makes it easier to provide additional scoped methods
for dealing with version related information. Eg, printBuildInfo()
- deprecate dimensionedType constructors using an Istream in favour of
versions accepting a keyword and a dictionary.
Dictionary entries are almost the exclusive means of read
constructing a dimensionedType. By construct from the dictionary
entry instead of doing a lookup() first, we can detect possible
input errors such as too many tokens as a result of a input syntax
error.
Constructing a dimensionedType from a dictionary entry now has
two forms.
1. dimensionedType(key, dims, dict);
This is the constructor that will normally be used.
It accepts entries with optional leading names and/or
dimensions. If the entry contains dimensions, they are
verified against the expected dimensions and an IOError is
raised if they do not correspond. On conclusion, checks the
token stream for any trailing rubbish.
2. dimensionedType(key, dict);
This constructor is used less frequently.
Similar to the previous description, except that it is initially
dimensionless. If entry contains dimensions, they are used
without further verification. The constructor also includes a
token stream check.
This constructor is useful when the dimensions are entirely
defined from the dictionary input, but also when handling
transition code where the input dimensions are not obvious from
the source.
This constructor can also be handy when obtaining values from
a dictionary without needing to worry about the input dimensions.
For example,
Info<< "rho: " << dimensionedScalar("rho", dict).value() << nl;
This will accept a large range of inputs without hassle.
ENH: consistent handling of dimensionedType for inputs (#1083)
BUG: incorrect Omega dimensions (fixes#2084)
- naming similar to objectRegistry, with unambiguous resolution.
The lookup() methods have different return types depending on the
calling parameter.
STYLE: use IOobjectListTemplates.C for implementations
- previously included as local definition within IOobjectList.C,
but will be adding more templated methods soon.
- adjust parameters (eg, matchName instead of matcher) to show their
function
ENH: handle objectRegistry::names<void>(...)
- this is equivalent to no Type restriction, and can be used when
filtering names. Eg,
obr.names<void>(wordRe..);
- handle tmp fields in interpolate methods
- special method interpolateInternal() for creating a volume field
with zero-gradient treatment for patches from an internal field.
This method was previously also called interpolate(), but that
masked the ability to subset the internal field only.
Ensight output needs the volume field:
uses interpolateInternal().
VTK output has separate handling of internal and patch fields:
uses interpolate().
ENH: added fvMeshSubset mesh() method for baseMesh or subMesh.
- simplies coding when the fvMeshSubset may or may not be in active use.
ENH: update foamToEnsight to use newer methods in wrapped form
- static interpolate functions with renaming for manual use with
fvMeshSubset (when fvMeshSubsetProxy may be too limiting in
functionality)
- helps reduce clutter in the topoSetDict files.
Caveats when using this.
The older specification styles using "name" will conflict with the
set name. Eg,
{
name f0
type faceSet;
action add;
source patchToFace;
sourceInfo
{
name inlet;
}
}
would flattened to the following
{
name f0
type faceSet;
action add;
source patchToFace;
name inlet;
}
which overwrites the "name" used for the faceSet.
The solution is to use the updated syntax:
{
name f0
type faceSet;
action add;
source patchToFace;
patch inlet;
}
- faceBitSet, pointBitSet and faceBoolSet (similar to cellBitSet)
* allows topo sources in a wider variety of places.
* With copy or move constructors.
- cylinderToPoint, searchableSurfaceToFace, searchableSurfaceToPoint,
sphereToFace, sphereToPoint sources
- optional innerRadius for sphere and cylinder sources to treat as hollow.
- support "sets" as well as "set" for cellToCell, faceToFace... sources.
* convenience and avoids writing the set during processing.
- now applicable to labelLists.
Note:
in some situations it will be more efficient to use
Foam::identity() directly. Eg,
globalIndex globalCells(mesh.nCells());
...
labelList cellIds
(
identity(globalCells.localSize(), globalCells.localStart())
);
- old 'DELETE' enum was easily confused with 'REMOVE', which removes
the set, not the elements from the set.
- provide corresponding subtractSet() method
STYLE: HashSet set/unset instead of insert/erase methods in topoSetSource
- simplifies switching to/from bitSet storage
- as part of the cleanup of dictionary access methods (c6520033c9)
made the dictionary class single inheritance from IDLList<entry>.
This eliminates any ambiguities for iterators and allows
for simple use of range-for looping.
Eg,
for (const entry& e : topDict))
{
Info<< "entry:" << e.keyword() << " is dict:" << e.isDict() << nl;
}
vs
forAllConstIter(dictionary, topDict, iter))
{
Info<< "entry:" << iter().keyword()
<< " is dict:" << iter().isDict() << nl;
}
- more dictionary-like methods, enforce keyType::LITERAL for all
lookups to avoid any spurious keyword matching.
- new readEntry, readIfPresent methods
- The get() method replaces the now deprecate lookup() method.
- Deprecate lookupOrFailsafe()
Failsafe behaviour is now an optional parameter for lookupOrDefault,
which makes it easier to tailor behaviour at runtime.
- output of the names is now always flatted without line-breaks.
Thus,
os << flatOutput(someEnumNames.names()) << nl;
os << someEnumNames << nl;
both generate the same output.
- Constructor now uses C-string (const char*) directly instead of
Foam::word in its initializer_list.
- Remove special enum + initializer_list constructor form since
it can create unbounded lookup indices.
- Removd old hasEnum, hasName forms that were provided during initial
transition from NamedEnum.
- Added static_assert on Enum contents to restrict to enum or
integral values. Should not likely be using this class to enumerate
other things since it internally uses an 'int' for its values.
Changed volumeType accordingly to enumerate on its type (enum),
not the class itself.