Commit Graph

416 Commits

Author SHA1 Message Date
Mark Olesen
86f627b9e6 ENH: consolidate decomposition model, constructors for decomposition methods
- make regionName an optional constructor parameter, which eliminates
  a separate set of constructors and construction tables. Adjust
  internals to treat a missing/empty regionName as a no-op.

- pass in fallback dictionary content via new IOdictionary constructor
  with a pointer

ENH: further relax check for matching number of processor dirs

- if the "numberOfSubdomains" entry is missing (or even zero)
  ignore checks of processor dirs as meaningless.
2021-04-27 09:14:48 +02:00
Mark Olesen
9a2a22a03a ENH: provide setter methods for IOobject read/write options etc.
- simplifies local toggling.

- centralize fileModification static variables into IOobject.
  They were previously scattered between IOobject and regIOobject
2021-03-17 15:10:00 +01:00
mattijs
3299f9ac0d ENH: redistributePar: single-step. See #1211
Support for DimensionedFields
2021-03-17 12:21:46 +00:00
mattijs
db343351f7 BUG: redistributePar: single-step. See #1211
- override casename, procesorCase flags to guarantee reconstructed
case to be written to the undecomposed directory
- alternative is to construct a Zero mesh on the undecomposed
runTime and add all other bits to that but that has not been
pursued
2021-03-15 08:31:10 +00:00
mattijs
ba9e573812 ENH: redistributePar: single-step. See #1211
- single-step for reconstructParMesh
- no point merging for redistributePar -reconstruct
2021-03-08 11:01:57 +00:00
Mark Olesen
6cdf89dced ENH: use concise forms for walking processor and cyclic boundaries 2021-02-09 17:57:49 +01:00
mattijs
f5e689c6a8 BUG: redistributePar: symmetric logic. Fixes #1973. 2021-01-04 14:44:28 +00:00
mattijs
dbaed65d75 BUG: redistributePar: failing reconstruct. See #1953.
In reconstruct mode redistributePar will have
- master read undecomposed mesh
- slaves construct dummy mesh (0 faces/points etc.)
  but correct patches and zones
so all processors have two valid meshes. This was
all handled inside fvMeshTools::newMesh and this
was behaving differently.
2020-12-16 17:27:08 +00:00
mattijs
723edc1c61 ENH: redistributePar: avoid temporary unassigned faces. See #1956. 2020-12-16 17:27:08 +00:00
Mattijs Janssens
46dbfabd9d ENH: primitiveMesh: make geometry calculation runtime selectable
This adds a 'geometry' scheme section to the system/fvSchemes:

geometry
{
    type            highAspectRatio;
}

These 'fvGeometryMethod's are used to calculate
- deltaCoeffs
- nonOrthoCoeffs
etc and can even modify the basic face/cellCentres calculation.
2020-12-11 10:31:34 +00:00
mattijs
8268d8aaba BUG: redistributePar: avoid par comms. Fixes #1953 2020-12-10 15:43:28 +00:00
mattijs
89f2cda3ab ENH: mpi: use per-application communicator. 2020-12-09 15:17:44 +00:00
Mark Olesen
df74e8448c ENH: robuster fileOperations splitProcessorPath
- robuster matching behaviour when encountering paths that themselves
  contain the word "processor" in them. For example,

    "/path/processor0generation2/case1/processor10/system"
    will now correctly match on processor10 instead of failing.

- use procRangeType for encapsulating the processor ranges

- provision for information of distributed vs non-distributed roots.
  The information is currently available from the initial setup, but
  can useful to access directly within fileOperation.

STYLE: modernize list iteration
2020-12-08 11:58:28 +01:00
Mark Olesen
9c7aa9727a ENH: add UPstream::parRun(const bool)
- slightly neater code when disabling/restoring parallel state

  New
      const bool oldParRun = Pstream::parRun(false);
      ...
      Pstream::parRun(oldParRun);

  Old
      const bool oldParRun = Pstream::parRun();
      Pstream::parRun() = false;
      ...
      Pstream::parRun() = oldParRun;
2020-10-12 12:51:22 +02:00
Mark Olesen
5dc5ea928a ENH: add UPstream::subProcs() static method
- returns a range of `int` values that can be iterated across.
  For example,

      for (const int proci : Pstream::subProcs()) { ... }

  instead of

      for
      (
          int proci = Pstream::firstSlave();
          proci <= Pstream::lastSlave();
          ++proci
      )
      {
          ...
      }
2020-09-28 14:26:07 +02:00
Mark Olesen
e18ff114a6 ENH: add UPstream::allProcs() method
- returns a range of `int` values that can be iterated across.
  For example,

      for (const int proci : Pstream::allProcs()) { ... }

  instead of

      for (label proci = 0; proci < Pstream::nProcs(); ++proci) { ... }
2020-09-28 14:25:59 +02:00
Mark Olesen
12c91b9472 STYLE: check autoPtr as plain bool instead of valid()
- cleaner code, more similarity with unique_ptr

  Now
      if (ptr)
      if (!ptr)

  instead
      if (ptr.valid())
      if (!ptr.valid())
2020-07-16 11:39:24 +02:00
Mark Olesen
9af3f85cf9 STYLE: simplify short-circuit involving autoPtr (#1775)
- with '&&' conditions, often better to check for non-null autoPtr
  first (it is cheap)

- check as bool instead of valid() method for cleaner code, especially
  when the wrapped item itself has a valid/empty or good.
  Also when handling multiple checks.

  Now
      if (ptr && ptr->valid())
      if (ptr1 || ptr2)

  instead
      if (ptr.valid() && ptr->valid())
      if (ptr1.valid() || ptr2.valid())
2020-07-16 10:17:25 +02:00
OpenFOAM bot
df7044845e GIT: remove whitespace, backslash escape angle brackets in comments
- fix older '> >' template parameters as '>>'
2020-06-26 12:28:49 +02:00
Kutalmis Bercin
2803f765f5 BUG: decomposePar -decomposeParDict option (fixes #1649)
DOC: reorder the options of decomposePar in the header file
2020-06-11 13:30:30 +01:00
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