Commit Graph

4000 Commits

Author SHA1 Message Date
Mark Olesen
3e43edf056 ENH: unify use of dictionary method names
- 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).
2020-06-02 17:26:03 +02:00
Mark Olesen
f721b5344f ENH: report dictionary name actually used (for -dict option) 2020-06-02 14:29:36 +02:00
Mark Olesen
31b172217c ENH: support predicate checks for argList (similar to dictionary methods)
- 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.
2020-06-02 13:51:18 +02:00
Mark Olesen
45a05012c6 STYLE: use Time::printExecutionTime() method
- makes format of ExecutionTime = ... output configurable (#788)
  and reduces code clutter.
2020-05-29 15:48:20 +02:00
Mark Olesen
03c2373d2c ENH: align meshRefinement dictionary wrapper with dictionary code
COMP: do not rely on implicit conversion to PtrList from Istream
2020-05-26 08:56:11 +02:00
Mark Olesen
02517e971a ENH: no implicit loading of controlDict libs for foamListRegions (#1713)
ENH: eliminate duplicate input region types
2020-05-23 15:53:17 +02:00
mattijs
8eeb5e8699 ENH: redistributePar: handle cyclicACMI. See #1558.
Explicitly avoid updating cyclicACMI.
2020-05-20 18:03:54 +01:00
Mark Olesen
d7db8f8292 COMP: support cgal header-only configurations
- improve wmake CGAL rule(s) accordingly
2020-05-19 07:13:12 +01:00
Mark Olesen
44b225604d ENH: add blockMeshDict "mergeType" keyword (#1589)
- 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
2020-05-13 20:59:03 +02:00
Mark Olesen
595579e01d COMP: use -iquotedir for including the local '.' directory
- 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
2020-05-06 13:06:40 +02:00
Mark Olesen
b4bf26ea4f Merge remote-tracking branch 'origin/master' into develop 2020-05-06 10:13:56 +02:00
Mark Olesen
8756791b00 ENH: use topological merge as default for blockMesh (closes #1589)
- faster and fewer issues with high aspect ratio cells.

- `blockMesh -merge-geometric` for old behaviour
2020-05-04 16:19:03 +02:00
Mark Olesen
8cfb483054 STYLE: some general spelling fixes 2020-05-04 09:15:21 +02:00
Mark Olesen
8a5d108fd2 STYLE: update PrimitivePatch (#1648)
- 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.
2020-04-30 15:52:42 +02:00
Mark Olesen
cc7af66a15 STYLE: use face_type instead of FaceType typedef 2020-04-28 15:38:47 +02:00
Mark Olesen
79048eb68f STYLE: use writeEntry(), beginBlock(), endBlock() methods
- use dictionary::get<..> instead of lookup in a few more places
2020-04-28 10:41:23 +02:00
Mark Olesen
5ab04f5745 GIT: remove prebuilt pdf file(s) 2020-04-27 09:45:17 +02:00
mattijs
c3571b7357 ENH: topoDistanceData: templated on passive data type.
Also adds pointTopoDistance, edgeTopoDistance.
2020-04-24 12:34:08 +01:00
Mark Olesen
9cfa5fe454 Merge remote-tracking branch 'origin/master' into develop 2020-04-21 15:07:35 +02:00
Mark Olesen
6691e6563c COMP: adjust for CGAL-1.14 changes 2020-04-21 14:59:07 +02:00
Mark Olesen
b2bf82360c COMP: cleanup of surfaceCoarsen/bunnylod
- 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
2020-04-16 13:34:56 +02:00
Mark Olesen
560c053bc8 ENH: support independent specification of surface read/write format (#1600)
- 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
2020-04-03 19:11:50 +02:00
Mark Olesen
3e3193aa5e Merge remote-tracking branch 'origin/master' into develop 2020-03-16 15:27:27 +01:00
Andrew Heather
69a61bf835 BUG: objToVTK - corrected for empty lines in obj file. See #1632 2020-03-16 10:21:34 +00:00
Mark Olesen
e3d4443871 ENH: improve surfaceSplitByPatch controls (#1600)
- 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
2020-03-12 16:20:57 +01:00
Mark Olesen
6744a2102b Merge remote-tracking branch 'origin/master' into develop 2020-03-12 11:35:26 +01:00
Mark Olesen
8e27022ea2 STYLE: find(), cfind() methods instead of lookupPtr()
- coordinateSystems, DictionaryBase
2020-03-11 22:05:15 +01:00
Mark Olesen
fc26fb758d ENH: add stringListOps with whitelist/blacklist matching
- refactored from ensightMesh, foamToVTK, surfaceMeshExtract

STYLE: use wordRes matching() method instead of findString() function
2020-02-26 21:40:09 +01:00
Mark Olesen
a456e9ae92 STYLE: relocate nonCoupledBoundaryTree into meshSearcher
- use point::uniform in more places
2020-02-24 18:41:02 +01:00
Mark Olesen
4e6caf8d61 STYLE: return Switch by value, not const-reference 2020-02-21 11:44:29 +01:00
Mark Olesen
86fe2b7bc9 STYLE: remove dead code, refactor constructors in extrudePatchMesh 2020-02-21 11:13:22 +01:00
Mark Olesen
fbbf9064b9 STYLE: remove trailing space, shell quoting
- emit "constant " and "uniform " as separate word/space combination
2020-02-20 10:11:23 +01:00
Mark Olesen
42299dca22 ENH: use IOstreamOption for writeObject() calls.
- reduces the number of parameters that are being passed around
  and allows future additions into the IOstreamOption with mininal
  effort.
2020-02-19 09:25:33 +00:00
Kutalmis Bercin
9be1772e0c BUG: surfaceInertia analytic eigendecomposition (fixes #1599)
- was missing cast to symmTensor
2020-02-19 10:14:57 +01:00
Mark Olesen
bb53e8adb3 ENH: adjustments to Switch
- 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.
2020-02-18 21:51:35 +01:00
Mark Olesen
4307e1719f STYLE: adjust names, locations for fileFormats
- 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
2020-02-18 13:51:20 +01:00
Mark Olesen
a97628121c ENH: overhaul ensight handling (#1579)
- 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.
2020-02-18 11:09:43 +00:00
Mark Olesen
79cf72d573 BUG: foamListTimes does not remove collated directories (fixes #1588)
- also now report any verbosity on stderr

- fix similar collated directories issue for foamRestoreFields
2020-02-14 17:44:49 +01:00
Mark Olesen
ec3de7128c STYLE: adjust logic names for point-values in foamToVTK 2020-02-12 18:03:50 +01:00
mattijs
8ab37e13e2 ENH: foamFormatConvert: leave boundary intact. Fixes #1358. 2020-02-12 15:04:05 +00:00
mattijs
01c14532bd ENH: checkMesh: write cellZone, faceZone info. See #1543. 2020-02-06 12:36:26 +00:00
Mark Olesen
87b3006566 STYLE: backslash doxygen commands, email address, typos in error messages 2020-01-31 17:06:30 +01:00
Kutalmis Bercin
f55da4b690 ENH: allow datToFoam writing points dict directly
- refactors the corresponding tutorial by removing redundant files and items:
    compressible/rhoCentralFoam/biconic25-55Run35
2020-01-29 12:26:36 +00:00
Mark Olesen
e252ec46dc COMP: backport of updates for gcc-92 compilation 2020-01-28 16:09:18 +01:00
Mark Olesen
ae40bd9f9b STYLE: use guards for dictionary lookup() 2020-01-28 11:57:23 +01:00
Mark Olesen
de57d2da7e DEFEATURE: remove paraview reader modules (migrate to submodule) 2020-01-23 14:04:23 +01:00
Mark Olesen
ee96dba0cf STYLE: simplify Random constructors
COMP: use generated methods in a few more places
2020-01-21 12:12:44 +01:00
Mark Olesen
f0be8679f6 ENH: provide defaultName() static method for patches, zones
- consistent way of writing "patch" + Foam::name(id) etc.
2020-01-16 13:24:23 +01:00
Mark Olesen
2a98c4e665 ENH: consistency improvements for surface patch handling (fixes #483)
- 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 ""
  ...
  )
```
2020-01-16 10:07:26 +01:00
OpenFOAM bot
596e4aef3f STYLE: remove trailing space, tabs 2020-01-22 10:00:03 +01:00
Mattijs Janssens
b8c2c0acf6 ENH: shm: support for automatic faceZones 2020-01-16 12:22:02 +00:00
mattijs
0fc4b79dde ENH: checkMesh: write minPyrVol. Fixes #1543. 2020-01-06 13:59:16 +00:00
mattijs
28eb349a30 BUG: checkMesh: handling of unsorted points. Fixes #920. 2020-01-06 11:22:34 +00:00
Vaggelis Papoutsis
c413ec5009 BUG: writeMorpherCPs expects a controlBoxes entry
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
2020-01-03 09:36:51 +00:00
Andrew Heather
ae2ab06312 REL: Release preparations 2019-12-23 09:49:23 +00:00
mattijs
df5a056fd3 GIT: interfaceTracking: relocate library 2019-12-19 15:32:34 +00:00
mattijs
427f92215c BUG: foamFormatConvert: missing 'faces' file. Fixes #1529. 2019-12-18 15:00:50 +00:00
sergio
6e8f0dbe76 INT: org integration
1) rPolynomial Eq of State
2) externalForce and softWall in rigidBodyDynamics

INT: Several minor bug fixes plus
2019-12-17 22:23:00 +00:00
Mark Olesen
a60fe9c7b0 ENH: PDRsetFields utility (#1216)
- 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.
2019-12-16 21:50:47 +01:00
Andrew Heather
f8577a3423 ENH: applyBoundaryLayer - optionally write turbulence fields
- 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'.
2019-12-06 20:43:43 +00:00
Vaggelis Papoutsis
b863254308 ENH: New adjont shape optimisation functionality
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
2019-12-12 14:17:29 +00:00
Mark Olesen
2923daab65 ENH: setExprFields and setExprBoundaryFields
- these are the expressions equivalent of funkySetFields and
  funkySetBoundaryFields
2019-12-10 13:09:22 +01:00
Andrew Heather
5d7d24df94 GIT: Housekeeping 2019-12-06 17:43:08 +00:00
Mark Olesen
1310e85225 ENH: support 'get()' for retrieving argList options
- previously only had 'opt<..>()' for options, but 'get<..>()'
  provides more similarity with dictionary methods.
  The 'opt<..>()' method is retained.
2019-11-26 21:07:11 +01:00
Mark Olesen
241dee29b2 ENH: add transformPoints -time option (issue #1510) 2019-11-25 10:55:05 +01:00
Mark Olesen
98467036b3 STYLE: regularize quoting and exit on failed 'cd' 2019-11-13 13:19:16 +01:00
Mark Olesen
7c1190f0b1 ENH: rationalize some string methods.
- 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()
2019-11-11 18:50:00 +01:00
Mark Olesen
713595f0c0 COMP: adjust common paraview library name to vtkPVFoamCommon
- similar prefixing as the dependent readers, making it easier to
  identify

- add FOAM_API information as server module version
2019-11-11 11:21:45 +01:00
Mark Olesen
8495e8e92c COMP: provide separate get_pvplugin_api function 2019-11-11 11:16:54 +01:00
Mark Olesen
e6dfb39c66 STYLE: remove unnecessary stdout, stderr /dev/null redirects
- no stderr redirect needed:
    * 'command -v'

- no stdout/stderr redirect needed:
    * 'rm -f'

STYLE: consistent spacing after redirects
2019-11-06 10:44:36 +01:00
Mark Olesen
ec7e3c88e4 ENH: test for WM_PROJECT_DIR being set/unset in scripts 2019-11-06 09:18:51 +01:00
Mark Olesen
e5916fd9ba ENH: use findMinMax instead of findMin, findMax separately 2019-11-05 13:10:23 +01:00
Mark Olesen
883752cfb9 COMP: restructure paraview reader files, add paraview-5.7 guards
- building plugins with paraview-5.7 is quite different
2019-11-05 09:14:37 +01:00
Mark Olesen
675dbc4333 ENH: use wordHashSet instead of hashedWordList in PV readers
- we don't need the GUI sort order of the values.
2019-11-04 18:29:29 +01:00
Andrew Heather
7aa83ea939 ENH: postProcess - updated app to update on mesh change instead of full clear out 2019-11-12 15:38:52 +00:00
Andrew Heather
fdf8d10ab4 Merge commit 'e9219558d7' into develop-v1906 2019-12-05 11:47:19 +00:00
OpenFOAM bot
e9219558d7 GIT: Header file updates 2019-10-31 14:48:44 +00:00
mattijs
f64125c6d9 ENH: redistributePar: handle -overwrite. Fixes #1450. 2019-10-17 13:27:55 +01:00
Mark Olesen
f75e01c8c2 CONFIG: adjustments for CMake files
- 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.
2019-10-04 11:48:03 +02:00
Mark Olesen
dcff32ea65 STYLE: use move insert in featurePointConformer 2019-09-30 09:40:59 +02:00
Mark Olesen
b6bf9129f6 DEFEATURE: pointer dereferencing for HashTable iterator
- 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).
2019-09-27 19:45:54 +02:00
OpenFOAM bot
38b53e5346 STYLE: use default destructor in header definitions 2019-09-24 12:14:36 +02:00
sergio
e3b05494f7 COMP: relocate regionProperties to meshTools 2019-09-20 14:06:30 -07:00
Kutalmis Bercin
5447220e6f BUG: Add writeDivider to foamDictionary (#1444) 2019-09-23 14:14:48 +01:00
mattijs
61dfa9b544 ENH: checkMesh: do not create wallDist unless in fvSchemes. See #71 2019-09-19 14:37:38 +01:00
mattijs
1307836caa ENH: checkMesh: write wall distance. See #71 2019-09-02 12:40:22 +01:00
Mark Olesen
dade6957c8 ENH: checkMesh report num global patches and min-max 2019-08-19 14:11:31 +02:00
mattijs
9815d37db3 BUG: corrupt extrudeToRegionMesh boundary patches in parallel (fixes #1295)
- new patches were added to the end of existing patches, which placed
  them _after_ the processor patches. This is incorrect.
2019-08-16 01:07:00 +01:00
Mark Olesen
1d79c0452c ENH: additional contiguous traits (#1378)
- 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.
2019-07-29 11:36:30 +02:00
Mark Olesen
1d8ea9182b ENH: add basic zero-initialized constructors for particle classes
- for the most basic level construction with mesh and position only.
2019-08-02 17:23:00 +02:00
Mark Olesen
037be8dbb0 STYLE: use default constructors/destructors for base cloud classes
- use cloud::defaultName instead of "defaultCloud" string literal
2019-08-02 17:22:00 +02:00
Mark Olesen
5382c2f590 STYLE: fix namespace documentation for CGAL-related content 2019-07-30 18:15:48 +02:00
Mark Olesen
f94be1bebb ENH: use FatalIOErrorInLookup instead of FatalErrorInLookup 2019-07-16 10:26:51 +02:00
Mark Olesen
fb09f56aba ENH: use FatalErrorInLookup macros (#1362) 2019-07-12 18:00:00 +02:00
Mark Olesen
1d86fc4f6b ENH: add single-parameter sortedOrder() function 2019-07-17 11:08:40 +02:00
Mark Olesen
f1a48a3c2f ENH: accept bitSet for MeshedSurface::subsetMesh
- add triSurface::subsetMesh single-parameter variant
2019-07-12 08:54:34 +02:00
Andrew Heather
96e7dd8da6 Merge branch 'develop' 2019-06-27 13:27:57 +01:00
Andrew Heather
15a763b931 COMP: Resolved some name clashes for #ifdef statements 2019-06-26 11:52:15 +01:00
Andrew Heather
be44dcaf1f RELEASE: Version clean-up for release 2019-06-25 11:51:19 +01:00
OpenFOAM bot
51bb4e0037 STYLE: remove trailing spaces 2019-06-26 11:36:49 +02:00
Vaggelis Papoutsis
ecc1fb5efb CONTRIB: New adjoint optimisation and tools
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
2019-06-17 12:59:11 +01:00
mattijs
64ed81b78f BUG: gmsh: skip empty lines. See #1155.
Fix provided by Gavin Ridley.
2019-04-11 11:07:28 +01:00
Mark Olesen
8ab09daad0 BUG: foamToVTK writes to undecomposed case (closes #1271)
- 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.
2019-04-08 11:53:50 +02:00
Mark Olesen
66a100997f COMP: force dlOpen for windows application binaries (#1238)
- 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.
2019-05-25 19:10:14 +02:00
Mark Olesen
b5d775a691 STYLE: avoid deprecated lookup methods 2019-05-22 15:06:12 +01:00
Mark Olesen
b043be3063 STYLE: add notices for deprecated dictionary methods 2019-05-17 09:02:51 +01:00
Mark Olesen
4bbd0294bb ENH: add -excludePatches option for surfaceMeshExtract (#1315)
- simplify faceZone selection in surfaceMeshExtract
2019-05-10 17:11:47 +02:00
Mark Olesen
6c8f6a2f50 ENH: support all 12 Euler rotation orders (#1292)
- 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.
2019-05-10 11:20:21 +02:00
Mark Olesen
06b2aa6849 COMP: skip CGAL rules when -DNO_CGAL is defined for surfaceBooleanFeatures 2019-04-30 10:33:01 +02:00
Mark Olesen
897528da1a ENH: streamline handling of static/dynamic libs in detection scripts 2019-04-29 10:04:44 +02:00
Mark Olesen
beefee48d4 COMP: adjust compilation order with updated interdependencies
- 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)
2019-04-28 14:44:33 +02:00
Mark Olesen
e1609d16d1 STYLE: use degToRad() instead of pi/180 2019-04-26 11:48:27 +02:00
mattijs
bc53e50c90 CONTRIBUTION: gmshToFoam: support version 4 mesh format. Fixes #1155.
Patch contributed by Gavin Ridley.
2019-04-25 16:33:17 +01:00
mattijs
7cc9961ff2 BUG: gmsh: skip empty lines. See #1155.
Fix provided by Gavin Ridley.
2019-04-11 11:07:28 +01:00
Mark Olesen
eb0c35dc6a STYLE: drop use of objToVTK conversion in viewFactors 2019-04-08 12:20:56 +02:00
Mark Olesen
f0f4af16d2 Merge remote-tracking branch 'origin/master' into develop 2019-04-08 12:05:24 +02:00
Mark Olesen
39c91d8440 ENH: support HashTable iterator pointer dereference 2019-04-06 16:00:21 +02:00
Mark Olesen
f3670521cd STYLE: use std:: qualifier on ::abort, ::exit
- consistent with use of <cstdlib> and makes for a stronger distinct
  from Foam::abort etc.
2019-04-03 20:24:30 +02:00
mattijs
a01b05b8c4 ENH: renumberMesh: renumber refinement data. Fixes #1241. 2019-04-01 09:48:23 +01:00
mattijs
83e321d3e4 ENH: snappyHexMesh: allow cross-patch merging of patch faces. Fixes #1255. 2019-03-27 15:04:48 +00:00
mattijs
f513f8bec6 ENH: extrudeMesh: -dict. See #1253 2019-03-27 10:39:35 +00:00
mattijs
7d077626d3 ENH: moveDynamicMesh: add -overwrite option. Fixes #1233. 2019-03-13 15:43:38 +00:00
Mark Olesen
773ec00d4b ENH: improved consistency of surface writers (#1232)
- 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.
2019-03-11 15:09:03 +01:00
Mark Olesen
5d445f4ed6 ENH: suppress cell/patch/proc ids for foamToVTK (#1230)
- reduces output size, consistent with vtkWrite function object

STYLE: mark some foamToVTK options as advanced (ie, visible with -help-full)
2019-03-11 11:02:58 +01:00
mattijs
aafbca93b2 ENH: old-time field: avoid reading in postprocessing mode. Fixes #1228. 2019-03-06 11:35:16 +00:00
Mark Olesen
c9549ba6a4 GIT: added PDRblockMesh to Allwmake 2019-02-25 07:46:21 +01:00
Mark Olesen
84270ed667 ENH: new PDRblockMesh mesh generation utility (issue #1216)
- 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.
2019-02-23 15:45:32 +01:00
Mark Olesen
181c974b11 ENH: improved sample surfaces and surface writers (#1206)
- 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
2019-02-07 18:11:34 +01:00
Mark Olesen
9b8ac57e98 BUG: foamToEnsightParts reports the time value twice in log output 2019-01-30 15:41:06 +01:00
Mark Olesen
fe445ac516 ENH: support VTK output of point ids
- can be useful for diagnosing mesh internals and the locations of
  decomposed cells.
2019-02-17 15:09:36 +01:00
Andrew Heather
29315f4644 DEP: Deprecated the ensightFoamReader 2019-01-17 09:35:04 +00:00
Mark Olesen
cf8d500f8c ENH: export FOAM_API in dictionary (issue #1158)
- uses the value of foamVersion::api, which should be reliable.
2019-01-07 19:04:50 +01:00
Mark Olesen
170041aaf5 ENH: for-range, forAllIters() ... in applications/
- reduced clutter when iterating over containers
2019-01-07 09:20:51 +01:00
Mark Olesen
60234ab007 STYLE: reduced nesting on return branching 2019-02-13 08:06:36 +01:00
Mark Olesen
ff54ef8299 ENH: additional vtk::Tools methods for handling faces, points etc.
- includes initial relocation of low-level vtu handling.
  Extracted, refactored from the Catalyst function object.
2019-02-03 17:24:26 +01:00
Mark Olesen
078e34746e ENH: code adjustments for updated NullObject
- 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.
2019-02-07 13:04:24 +01:00
OpenFOAM bot
154029ddd0 BOT: Cleaned up header files 2019-02-06 12:28:23 +00:00
Andrew Heather
cab94a5d0a Merge remote-tracking branch 'origin/master' into develop 2019-02-04 10:55:34 +00:00
Mark Olesen
b7fb6116c3 ENH: restructuring of ensight output files
- 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
2019-01-29 15:18:17 +01:00
mattijs
14e6b198cc ENH: checkMesh: write correct faceWeights. Fixes #1099. 2019-01-31 15:28:01 +00:00
Mark Olesen
fe21c9c327 ENH: change vtk::Tools from a class to a namespace
- allows localized extension of functionality
2019-01-31 13:43:18 +01:00
mattijs
73705d8290 BUG: decomposePar: incorrect indexing. Fixes #1189. 2019-01-30 11:48:35 +00:00
Andrew Heather
da29c4f0d0 Merge branch 'feature-snappyHexMesh-check' into 'develop'
Feature snappy hex mesh check

See merge request Development/OpenFOAM-plus!229
2019-01-28 08:57:46 +00:00
Mark Olesen
3b91160027 STYLE: centralize example dictionaries under etc/ (issue #1074)
- as well as being more convenient to find, this is necessary when the
  OpenFOAM installation is without sources or tutorials
2019-01-26 17:46:08 +01:00
mattijs
c2debedd08 ENH: changeDictionary: allow removal of patches (!). Fixes #1179. 2019-01-24 12:40:46 +00:00
Mark Olesen
1c85c64984 STYLE: clarify input requirements for extrusion models (#1181)
- changed the sectorCoeffs keyword to 'point' from 'axisPt'
  for more similarity with other dictionaries.
  Continue to accept 'axisPt' for compatibility.
2019-01-24 09:40:12 +01:00
Mark Olesen
8b3a00efcc STYLE: fixup very old-style case headers 2019-01-24 08:44:41 +01:00
Mark Olesen
567ae55e8e STYLE: improve input check on gmshToFoam 2019-01-23 22:45:00 +01:00
Mark Olesen
856f45a910 Merge remote-tracking branch 'origin/master' into develop 2019-01-23 21:27:03 +01:00
Mark Olesen
812fa22dff Merge remote-tracking branch 'origin/develop' into develop 2019-01-23 21:22:10 +01:00
Andrew Heather
34ca554f15 Merge branch 'feature-run-time-control-triggers' into 'develop'
Feature run time control triggers

See merge request Development/OpenFOAM-plus!228
2019-01-23 14:59:18 +00:00
mattijs
47d29b1cdd ENH: snappyHexMesh: user size limit. See #972. 2019-01-23 12:25:54 +00:00
Mark Olesen
a5cc0ffcad STYLE: use const reference for caught exceptions 2019-01-23 09:03:06 +01:00
Mark Olesen
8f8a4dc682 ENH: add foamDictionary -precision option (issue #1177)
- since foamDictionary doesn't use system/controlDict it will use the
  standard default precision. The '-precision' option allows adjusting
  that value.
2019-01-22 15:11:28 +01:00
Mark Olesen
53efb24a8d STYLE: use ListOps::uniqueEqOp instead of local definition 2019-01-18 15:34:28 +01:00
mattijs
6ccdc77468 BUG: trackingInverseDistance: fix trackingInverseDistance. Fixes #736. 2019-01-17 18:21:38 +00:00
Andrew Heather
bc12ce2ac9 ENH: Updated fieldSelection dependent code 2019-01-21 11:56:53 +00:00
Mark Olesen
f498d09dbf ENH: add simplified gather methods for globalIndex with default communicator
- when combining lists in processor order this simplifies code and
  reduces memory overhead.

  Write this:
    ----
    labelList collected;

    const globalIndex sizing(input.size());
    sizing.gather(input, collected);
    ----

  OR

    ----
    labelList collected;
    globalIndex::gatherOp(input, collected);
    ----

  Instead of this:

    ----
    labelList collected;

    List<labelList> scratch(Pstream::nProcs());
    scratch[Pstream::myProcNo()] = input;
    Pstream::gatherList(scratch);

    if (Pstream::master())
    {
        collected = ListListOps::combine<labelList>
        (
            scratch,
            accessOp<labelList>()
        );
    }
    scratch.clear();
    ----
2019-01-16 21:33:06 +01:00
Mark Olesen
2a1d0f36ec ENH: new foamToVTK output option -processor-fields
- write values of processor boundaries only, for diagnostic purposes.

- parallel only, and non-legacy format only
2019-01-14 17:32:07 +01:00
Mark Olesen
dcb6969361 BUG: missing space separator in chemkinToFoam file output
- generates dictionary-like content, but without a separator between
  keyword and list content.
2019-01-11 11:03:36 +01:00
Mark Olesen
cb5617e070 STYLE: fix some doxygen markup
- missing verbatim/endverbatim markers, missing "Foam::" prefix, typos
2019-01-11 08:22:02 +01:00
Mark Olesen
b6d87f56cd STYLE: foamDictionary does not need to set FOAM_API
- already done in argList
2019-01-10 12:00:11 +01:00
Mattijs Janssens
e6f8dfecec Feature merge OpenFOAM.org 2019-01-10 10:10:06 +00:00
Mark Olesen
2067014079 ENH: minor consistency improvements for bounding box
- 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
2019-01-09 09:32:23 +01:00
Mark Olesen
14a404170b ENH: for-range, forAllIters() ... in applications/utilities
- reduced clutter when iterating over containers
2019-01-07 09:20:51 +01:00
Mark Olesen
74d9dc3f50 BUG: polyMesh constructor AUTO_WRITE flag, ignored readOpt (#1147)
- 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.
2019-01-07 22:23:19 +01:00
Mark Olesen
620f5274d0 Merge remote-tracking branch 'origin/develop' into develop 2019-01-07 19:13:18 +01:00
Mark Olesen
22b659d7c0 ENH: export FOAM_API in dictionary (issue #1158)
- uses the value of foamVersion::api, which should be reliable.
2019-01-07 19:04:50 +01:00
mattijs
a6a46d23b8 BUG: polyMesh: set AUTO_WRITE flag. See #1147. 2019-01-07 17:51:47 +00:00
Mark Olesen
505b4b9c1c ENH: add guarded lookup for dimensionedSet
STYLE: use standard dimensionedSets
2019-01-02 16:53:41 +01:00
Mark Olesen
e2bc0b55b9 COMP: use std::move() explicitly to avoid copying 2019-01-02 15:56:54 +01:00
mattijs
10da897275 ENH: snappyHexMesh: limit printing in dry-run. See #972. 2018-12-24 08:55:42 +00:00
Mark Olesen
855faae858 STYLE: surfaceMeshTriangulate renamed to surfaceMeshExtract
- the utility had automatic triangulation removed some time ago, but
  never changed its name.

- catch old uses with a surfaceMeshTriangulate deprecated script
2018-12-21 18:37:39 +01:00
Andrew Heather
9231534efa STYLE: Updating version to v1812 2018-12-19 18:07:52 +00:00
Mark Olesen
7ee1ec92ec STYLE: add usage information for subsetMesh argument 2018-12-19 15:15:28 +01:00
Mark Olesen
e8f25b1385 BUG: foamToVTK, vtkWrite stopped by processorCyclic (closes #1135)
- they had an isType<> instead of isA<>() check
2018-12-19 13:56:20 +01:00
Mark Olesen
919fa3a541 STYLE: ensure help for -dict matches its intended usage 2018-12-17 10:39:59 +01:00
Mark Olesen
54ac451bf5 ENH: add -dict option for mirrorMesh 2018-12-17 09:51:29 +01:00
Mark Olesen
b6983e6af5 STYLE: adjust comments and adjust surfaceMeshTriangulate code
- 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.
2018-12-16 16:16:00 +01:00
Mark Olesen
455c8ef540 ENH: simplify use of case-relative paths
- provide relativePath() for argList and for Time.
  These are relative to the case globalPath().
  Eg,

     Info<< "output: " << runTime.relativePath(outputFile) << nl;
2018-12-15 13:26:55 +01:00
Mark Olesen
1d85fecf4d ENH: use Zero when zero-initializing types
- 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)
2018-12-11 23:50:15 +01:00
Mark Olesen
2db0db3006 BUG: stringOps etc expansion fails for directories (issue #1121)
- now use findEtcEntry() instead to handle file or directory.

  Added findEtcEntries(), which provides provides a common code basis
  for findEtcDirs(), findEtcFiles() ...
2018-12-13 12:48:31 +01:00
Mark Olesen
78fd05051b STYLE: juggle some advanced/non-advanced options (foamToVTK, foamToEnsight) 2018-12-13 02:39:41 +01:00
Mark Olesen
5d9e278e92 ENH: consolidate handling of mandatory/optional command arguments
- 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
2018-12-13 01:45:09 +01:00
Mark Olesen
172c36c29a ENH: support search modes for etcFiles()
- 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);
2018-12-12 13:45:32 +01:00
Mark Olesen
29a5793b5b STYLE: argList::opt method instead of the longer argList::lookupOrDefault
- also replaced a few instances of readIfPresent with opt<> for
  constant values.
2018-12-12 12:10:39 +01:00
Mark Olesen
f38190213c ENH: support usage descriptions for command arguments 2018-12-12 11:58:56 +01:00
Mark Olesen
98158f5409 TUT: add End marker for tutorials 2018-12-11 16:25:28 +01:00
Mark Olesen
68ec561df8 STYLE: add usage notes to more utilities and solvers 2018-12-11 15:25:27 +01:00
Mark Olesen
f0fc2a2671 BUG: paraview target was tagged with ParaVIEW_MAJOR instead of PARAVIEW_API
- regression was introduced by 628b2445fc
2018-12-10 16:43:32 +01:00
Mark Olesen
51a3f4e6e4 ENH: make foamToVTK faceZone writing explicit (closes #1117)
- 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
2018-12-10 14:35:44 +01:00
Mark Olesen
5415991e79 ENH: argList::getList with optional parameter
- this allows it to work like readListIfPresent() but with a list as
  the return value, which can be useful for a const context.
2018-12-10 14:09:53 +01:00
Johan Roenby
9f45518378 ENH: Added invertAlpha option to the setAlphaField utility. Fixes #1113 2018-12-10 11:33:57 +00:00
Andrew Heather
a16fd1fa9e TUT: Added new decay of isotropic turbulence case based on CBC data
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.
2018-12-06 22:56:32 +00:00
Andrew Heather
a1558b88f5 ENH: Added new utility to create a box of isotropic turbulence 2018-12-06 22:28:43 +00:00
Mark Olesen
fc2f2e74d2 BUG: checkMesh, moveDynamicMesh checks not in postProcessing/ (fixes #1104)
- 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.
2018-12-05 22:03:28 +01:00
Mark Olesen
1f9543802d ENH: code cleanup for vtk transcription
- use cellCentres() instead of volField equivalent for vtk conversion

- make looping variables more consistent

- centralize the transcription of OpenFOAM -> vtk tuples
2018-12-05 11:19:08 +01:00
Mark Olesen
5252c70b46 STYLE: add OpenFOAM/include directory in CMakeLists
- eg for foamVersion.H
2018-12-04 01:38:46 +01:00
Mark Olesen
b8c257d6ad CONFIG: adjustments to environment
- 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)
2018-12-03 09:50:48 +01:00
Mark Olesen
628b2445fc ENH: improve setup for paraview
- 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.
2018-11-29 01:48:00 +01:00
Mark Olesen
dd0487ac2a STYLE: typo in comments 2018-11-28 12:35:34 +01:00
Mark Olesen
41a03f3790 ENH: add regular expressions for reconstructPar, mapFieldsPar -fields option
- improved flexibility

- reconstruction of Lagrangian positions/fields now handled as a class
  for better modularity
2018-11-28 08:36:17 +01:00
Mark Olesen
b81420e524 ENH: additional variants of IOobjectList findObject()
- 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)
           {
               ...
           }
       }
2018-11-28 11:28:38 +01:00
Mark Olesen
7477459186 STYLE: const-correctness on IOobject* access
- foamToEnsight, foamToEnsightParts, profiling
2018-11-28 08:00:53 +01:00
Mark Olesen
29e1d9e982 Merge remote-tracking branch 'origin/develop' into develop 2018-11-27 16:59:08 +01:00
Mark Olesen
ad88c551f9 Merge remote-tracking branch 'vtk/feature-vtm' into develop 2018-11-27 11:23:37 +01:00
Mark Olesen
46e2e71f28 STYLE: update dictionary documentation for topoSources (#1060) 2018-11-27 08:32:27 +01:00
mattijs
0e5325bff9 ENH: snappyHexMesh: add -dry-run argument. See #972. 2018-11-26 12:23:01 +00:00
Andrew Heather
3bdb0435f8 DEP: Deprecated the ensightFoamReader 2019-01-17 09:35:04 +00:00
Mark Olesen
d8a55e46b6 ENH: align foamToEnsightParts internals with foamToEnsight
- add -region option and -fields filtering
2018-11-25 12:12:19 +01:00
Mark Olesen
b5432011fa ENH: improve option naming consistency in
- foamToVTK, foamToEnsight, foamToEnsightParts
2018-11-25 10:47:00 +01:00
Mark Olesen
a139543e9c ENH: add boundaryToCell, patchToCell topoSetCellSources (#1060)
- 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.
2018-11-24 13:52:43 +01:00
Mark Olesen
05353da5f4 BUG: errors found in feature-vtm 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
2018-11-23 14:04:07 +01:00
Mark Olesen
0d29257a6d STYLE: use vtk::surfaceWriter instead of sampleSurface version 2018-10-16 14:49:56 +02:00
Mark Olesen
2b42076d58 ENH: restructuring of foamToEnsight code
- align with foamToVTK code base
2018-10-09 21:28:53 +02:00
Mark Olesen
89cca8578c ENH: rewrite of foamToVTK to include parallel output (#926)
- 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.
2018-10-09 20:00:55 +02:00
Mark Olesen
4f2ec88d24 ENH: improvements to the parallelization of ensightCloud output
- communication mode is now selectable (default is blocking)

- eliminate serial-only version as being redundant
2018-10-10 10:32:14 +02:00
Mark Olesen
e4fac35d60 ENH: cleanup ensightMesh method names and handling of internal vs boundary
- this removes the old 'magically' means of suppressing the internal
  mesh in favour of specifying it directly.
2018-10-09 17:49:15 +02:00
Mark Olesen
6f06ce6e02 ENH: parallel and xml output for vtk::lagrangianWriter (issue #926) 2018-09-17 11:35:17 +02:00
Mark Olesen
0d2dbaf61b ENH: parallel and xml output for vtk topoSet writers (issue #926)
- introduce lower-level vtk::indirectPatchWriter class
2018-09-17 15:41:58 +02:00
Mark Olesen
05427217a0 ENH: improvements for foamVtkOutput, foamVtkFormatter (issue #926)
- 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
2018-09-17 08:59:03 +02:00
Mark Olesen
ac03307258 ENH: improve consistency in version handling (issue #1010)
- 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.
2018-11-23 11:08:36 +01:00
Mark Olesen
577babc72b ENH: reject bad time values for blockMesh -time (closes #1093) 2018-11-22 15:51:05 +01:00
Mark Olesen
343a3b958d ENH: guard against non-dictionary entries in changeDictionary (#1092) 2018-11-22 13:59:49 +01:00
Mark Olesen
083e9e9665 ENH: isolate version information in foamVersion names instead of globals
- 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()
2018-11-22 11:50:24 +01:00
Mark Olesen
6dcc46b187 ENH: improve error handling for foamHelp
- Catch any leading option (the incorrect location).
- Catch initialization error for cleaner result.
2018-11-21 20:18:39 +01:00
mattijs
9bfc010e64 ENH: faMesh: decompose zero-sized patches. Fixes #1090. 2018-11-21 16:38:33 +00:00
Mark Olesen
dd87c98393 ENH: add read guard for dimensionedType constructors (#762)
- 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)
2018-11-20 15:14:10 +01:00
Mark Olesen
f2de61f82c STYLE: add geometric constraint to decomposeParDict example (issue #921) 2018-11-15 11:45:18 +01:00
Mark Olesen
1883a872a1 STYLE: adds comments in empty Make/options files
- easier when making modifications

STYLE: spelling in topoSetSource comments
2018-11-13 15:21:13 +01:00
Mark Olesen
2ac5df6f93 BUG: inconsistent field ordering in PDRMesh (fixes #1069) 2018-11-12 12:59:03 +01:00
Mark Olesen
faaa93fdb5 ENH: add IOobjectList::findObject() method
- 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..);
2018-11-09 21:57:55 +01:00
Mark Olesen
91cfe4c271 ENH: add wordRes::matching() method
- returns indices of matching entries.
2018-11-09 21:21:15 +01:00
Mark Olesen
3cf177e759 Work-package-09 geometric constraint 2018-11-08 20:50:47 +00:00
Mark Olesen
2fb382bf8a ENH: multiple zone selection for fvMeshSubsetProxy (#973)
- 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)
2018-10-02 17:06:44 +02:00
Mark Olesen
5f556ffb4a ENH: make sourceInfo sub-dictionary optional for topoSet (#1060)
- 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;
    }
2018-11-07 10:33:36 +01:00
Mark Olesen
6090faedef ENH: additional topoSources, and consistency changes (#1060)
- 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.
2018-11-06 18:25:05 +01:00
Mark Olesen
a7a346b206 STYLE: indentation for FatalIOErrorInFunction calls 2018-11-06 09:49:22 +01:00
Mark Olesen
f5baa9a583 ENH: extend globalIndex toGlobal methods
- 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())
     );
2018-11-05 16:23:33 +01:00
Mark Olesen
50baac3c45 ENH: construct string types from Istream now explicit (#1033)
- this helps for trapping unguarded dictionary lookups.
2018-11-03 20:24:34 +01:00
mattijs
30dcac006f COMP: Allwmake: make -q work 2018-11-01 14:12:52 +00:00
Mark Olesen
7325e3ac7d ENH: topoSetSource::SUBTRACT enum action (#1060)
- 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
2018-10-30 15:09:44 +00:00
Mark Olesen
50fe195374 ENH: use "origin" for searchable sphere etc. (#1060)
- replaces "centre", using the same keyword as other objects
  (eg, plane, rotatedBox, coordinateSystem etc).
2018-10-29 15:51:05 +00:00
Mark Olesen
c2e58dca64 ENH: support multiple zones for topo set sources (#1060)
- uses the keywords 'zones' and 'zone' to avoid potential conflicts
  with a named topoSet action, but accepts 'name' for compatibility.
2018-10-29 12:54:30 +00:00
mattijs
966eed302e BUG: subsetMesh: mapping topoSets. Fixes #1053. 2018-10-30 12:43:30 +00:00
mattijs
f2ef995113 ENH: checkMesh: pass by reference. See #755. 2018-10-29 15:08:52 +00:00
mattijs
3be48a677c ENH: snappyHexMesh: update main snappyHexMeshDict. See #1031. 2018-10-17 12:04:53 +01:00
Mark Olesen
07dafe7b0b STYLE: use range-for when looping dictionary entries.
- 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;
      }
2018-10-19 13:08:24 +02:00
Mark Olesen
4e04c1966f ENH: use dictionary::get<word>() instead of lookup() in a few places 2018-10-19 09:11:31 +02:00
Mark Olesen
3b74512231 ENH: cleanup of Enum class
- 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.
2018-10-18 12:57:32 +02:00