Commit Graph

396 Commits

Author SHA1 Message Date
mattijs
aa956f4b05 ENH: Pstream: Feed through outstanding requests more. See #1626.
This e.g. was giving a problem with using volPointInterpolation (in
functionObjects) with non-blocking global reductions.
2020-06-10 12:10:02 +01: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
mattijs
8eeb5e8699 ENH: redistributePar: handle cyclicACMI. See #1558.
Explicitly avoid updating cyclicACMI.
2020-05-20 18:03:54 +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
Mark Olesen
87b3006566 STYLE: backslash doxygen commands, email address, typos in error messages 2020-01-31 17:06:30 +01: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
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
sergio
e3b05494f7 COMP: relocate regionProperties to meshTools 2019-09-20 14:06:30 -07: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
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
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
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
mattijs
73705d8290 BUG: decomposePar: incorrect indexing. Fixes #1189. 2019-01-30 11:48:35 +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
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
14a404170b ENH: for-range, forAllIters() ... in applications/utilities
- reduced clutter when iterating over containers
2019-01-07 09:20:51 +01:00
mattijs
a6a46d23b8 BUG: polyMesh: set AUTO_WRITE flag. See #1147. 2019-01-07 17:51:47 +00: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
Andrew Heather
9231534efa STYLE: Updating version to v1812 2018-12-19 18:07:52 +00: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
68ec561df8 STYLE: add usage notes to more utilities and solvers 2018-12-11 15:25:27 +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
mattijs
f4ae4f7b2c ENH: snappyHexMesh. Added leak-path detection.
Detects connections (during refinement) between
locationsInsideMesh and locationsOutsideMesh and
writes a sampledSet for postprocessing.
2018-08-02 16:39:06 +01:00
mattijs
9bfc010e64 ENH: faMesh: decompose zero-sized patches. Fixes #1090. 2018-11-21 16:38:33 +00:00
Mark Olesen
f2de61f82c STYLE: add geometric constraint to decomposeParDict example (issue #921) 2018-11-15 11:45:18 +01:00
Mark Olesen
3cf177e759 Work-package-09 geometric constraint 2018-11-08 20:50:47 +00: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
c4542294a8 ENH: more stringent checks for fileName concatenation
- avoids some doubled slashes

STYLE: simplify concatenation of processor directory names
2018-10-11 10:07:11 +02:00
Mark Olesen
a77ab5d4eb STYLE: relocate distributed flag into ParRunControl
- adjust member order in TimePaths to better packing
2018-10-11 09:12:01 +02:00
Mark Olesen
501326b27a ENH: additional constructor and methods for regionProperties
- can now construct with READ_IF_PRESENT and use count() to determine
  if it was loaded. names() and sortedNames() for a collected overview.
2018-10-01 16:01:02 +02:00
Mark Olesen
69f6f63810 ENH: add globalPath() to argList and TimePaths
- simply combines (rootPath()/globalCaseName())
2018-09-28 15:24:59 +02:00
Mark Olesen
64c3e484bb STYLE: add nBoundaryFaces() method to primitiveMesh
- nBoundaryFaces() is often used and is identical to
  (nFaces() - nInternalFaces()).

- forward the mesh nInternalFaces() and nBoundaryFaces() to
  polyBoundaryMesh as nFaces() and start() respectively,
  for use when operating on a polyBoundaryMesh.

STYLE:

- use identity() function with starting offset when creating boundary maps.

     labelList map
     (
         identity(mesh.nBoundaryFaces(), mesh.nInternalFaces())
     );

  vs.

     labelList map(mesh.nBoundaryFaces());
     forAll(map, i)
     {
         map[i] = mesh.nInternalFaces() + i;
     }
2018-09-27 10:17:30 +02:00
Will Bainbridge
2ae4bf73d9 fileHandler: Added flush method
This method waits until all the threads have completed IO operations and
then clears any cached information about the files on disk. This
replaces the deactivation of threading by means of zeroing the buffer
size when writing and reading of a file happen in sequence. It also
allows paraFoam to update the list of available times.

Patch contributed by Mattijs Janssens
Resolves bug report https://bugs.openfoam.org/view.php?id=2962
2018-06-27 11:45:58 +01:00
mattijs
4637e4582c ENH: redistributePar: allow nDomains 1 in decomposeParDict. Fixes #924.
Note: this removes the option to reconstruct by setting nDomains to 1.
      You now have to explicitly use -reconstruct to reconstruct.
2018-08-09 15:17:21 +01:00
Mark Olesen
e0f83938ee ENH: ignore -noFunctionObjects option when disabled
- With argList::noFunctionObjects() we use the logic added in
  4b93333292 (issue #352)

  By removing the '-noFunctionObjects' option, we automatically
  suppress the creation of function-objects via Time (with argList
  as a parameter).
  There is generally no need in these cases for an additional

      runTime.functionObjects().off()  statement

  Use the argList::noFunctionObjects() for more direct configuration
  and reduce unnecessary clutter in the -help information.

  In previous versions, the -noFunctionObjects would have been redundant
  anyhow, so we can also just ignore it now instead.
2018-08-08 09:44:28 +02:00
Mark Olesen
88e5334a9f ENH: IOobject::selectIO helper method
- centralizes IOobject handling and treatment of alternative locations.
  If an alternative file location is specified, it will be used instead.

- provide decompositionMethod::canonicalName instead of using
  "decomposeParDict" in various places.
2018-08-02 17:39:17 +02:00
Mark Olesen
cb919a6c41 ENH: tag some options as 'advanced' (only shown with -help-full)
General:
    * -roots, -hostRoots, -fileHandler

Specific:
    * -to <coordinateSystem> -from <coordinateSystem>

- Display -help-compat when compatibility or ignored options are available

STYLE: capitalization of options text
2018-07-31 11:54:15 +02:00
Mark Olesen
ff26b96a80 STYLE: use 'cloudObjects' instead of 'sprayObjects' 2018-07-30 13:15:38 +02:00
Mark Olesen
02ad76df4f ENH: allow wordHashSet filter for IOobjectList::names
- simplifies usage.
  Support syncPar check on names() to detect inconsistencies.

- simplify readFields, ReadFields and other routines by using these
  new methods.
2018-07-26 14:56:52 +02:00
Mark Olesen
dbe0db1d9a ENH: fvMeshSubset improvements (issue #951)
- what was previously termed 'setLargeCellSubset()' is now simply
  'setCellSubset()' and supports memory efficient interfaces.

  The new parameter ordering avoids ambiguities caused by default
  parameters.

  Old parameter order:

      setLargeCellSubset
      (
          const labelList& region,
          const label currentRegion,
          const label patchID = -1,
          const bool syncCouples = true
      );

  New parameter order:

      setCellSubset
      (
          const label regioni,
          const labelUList& regions,
          const label patchID = -1,
          const bool syncCouples = true
      );

   And without ambiguity:

      setCellSubset
      (
          const labelUList& selectedCells,
          const label patchID = -1,
          const bool syncCouples = true
      );

- support bitSet directly for specifying the selectedCells for
  memory efficiency and ease of use.

- Additional constructors to perform setCellSubset() immediately,
  which simplifies coding.

  For example,

      meshParts.set
      (
          zonei,
          new fvMeshSubset(mesh, selectedCells)
      );

  Or even

      return autoPtr<fvMeshSubset>::New(mesh, selectedCells);
2018-07-25 18:58:00 +02:00
Mark Olesen
a6b84927e4 STYLE: use sortedToc() instead of toc() followed by sort() 2018-07-25 10:29:20 +02:00
Mark Olesen
d58c142404 ENH: use restricted dictionary lookup for utilities (issue #762)
- get<label>, get<scalar> instead of readLabel, readScalar, etc.
2018-07-24 08:08:30 +02:00
Mark Olesen
96b65a781d STYLE: remove spacing around forAll macros and template '> >' closing 2018-07-06 11:03:28 +02:00
Mark Olesen
ed4ffd8f89 ENH: add decomposePar -dry-run option
- can be used to test the behaviour of the decomposion and its
  characteristics without writing any decomposition to disk.
  Combine with -cellDist to visualize the expected decomposition
  result.
2018-07-19 11:04:38 +02:00
Mark Olesen
7cb5b638ad STYLE: more consistency in handling of -region vs -allRegions 2018-07-19 09:15:33 +02:00
Mark Olesen
0304911921 STYLE: more consistent use of dimensioned Zero, scalar decimal points
- use scalar(0) instead of scalar(0.0) etc
2018-07-13 10:28:48 +02:00