Commit Graph

21162 Commits

Author SHA1 Message Date
ef882e542a ENH: zero initialize memory for Pstream send (issue #814)
- this avoids some valgrind messages

      "Uninitialised byte(s) found during client check request"
2018-05-02 14:02:55 +02:00
6d89a3ec38 ENH: additional convenience for mpirunDebug
- a -valgrind option for logging with valgrind

- determine number of processors from system/decomposeParDict
  or -decomposeParDict if -np was not specified
2018-05-02 11:49:33 +02:00
0ea44eda59 ENH: bitSet::find_first_not() method (issue #751)
- find the position of the first bit off - symmetrical with find_first()
2018-05-02 08:33:49 +02:00
4653beaa49 ENH: report illegal cellId for getRefCellValue (FULLDEBUG)
-  this should normally not be triggered, provided that setRefCell was
   used. However, if getRefCellValue() was called without any previous
   checking on refCelli, it is possible to provoke errors.
2018-04-30 14:25:37 +02:00
8959b8e00a ENH: Improvements to the fileHandler and collated IO
Improvements to existing functionality
--------------------------------------
  - MPI is initialised without thread support if it is not needed e.g. uncollated
  - Use native c++11 threading; avoids problem with static destruction order.
  - etc/cellModels now only read if needed.
  - etc/controlDict can now be read from the environment variable FOAM_CONTROLDICT
  - Uniform files (e.g. '0/uniform/time') are now read only once on the master only
    (with the masterUncollated or collated file handlers)
  - collated format writes to 'processorsNNN' instead of 'processors'.  The file
    format is unchanged.
  - Thread buffer and file buffer size are no longer limited to 2Gb.

The global controlDict file contains parameters for file handling.  Under some
circumstances, e.g. running in parallel on a system without NFS, the user may
need to set some parameters, e.g. fileHandler, before the global controlDict
file is read from file.  To support this, OpenFOAM now allows the global
controlDict to be read as a string set to the FOAM_CONTROLDICT environment
variable.

The FOAM_CONTROLDICT environment variable can be set to the content the global
controlDict file, e.g. from a sh/bash shell:

    export FOAM_CONTROLDICT=$(foamDictionary $FOAM_ETC/controlDict)

FOAM_CONTROLDICT can then be passed to mpirun using the -x option, e.g.:

    mpirun -np 2 -x FOAM_CONTROLDICT simpleFoam -parallel

Note that while this avoids the need for NFS to read the OpenFOAM configuration
the executable still needs to load shared libraries which must either be copied
locally or available via NFS or equivalent.

New: Multiple IO ranks
----------------------
The masterUncollated and collated fileHandlers can now use multiple ranks for
writing e.g.:

    mpirun -np 6 simpleFoam -parallel -ioRanks '(0 3)'

In this example ranks 0 ('processor0') and 3 ('processor3') now handle all the
I/O.  Rank 0 handles 0,1,2 and rank 3 handles 3,4,5.  The set of IO ranks should always
include 0 as first element and be sorted in increasing order.

The collated fileHandler uses the directory naming processorsNNN_XXX-YYY where
NNN is the total number of processors and XXX and YYY are first and last
processor in the rank, e.g. in above example the directories would be

    processors6_0-2
    processors6_3-5

and each of the collated files in these contains data of the local ranks
only. The same naming also applies when e.g. running decomposePar:

decomposePar -fileHandler collated -ioRanks '(0 3)'

New: Distributed data
---------------------

The individual root directories can be placed on different hosts with different
paths if necessary.  In the current framework it is necessary to specify the
root per slave process but this has been simplified with the option of specifying
the root per host with the -hostRoots command line option:

    mpirun -np 6 simpleFoam -parallel -ioRanks '(0 3)' \
        -hostRoots '("machineA" "/tmp/" "machineB" "/tmp")'

The hostRoots option is followed by a list of machine name + root directory, the
machine name can contain regular expressions.

New: hostCollated
-----------------

The new hostCollated fileHandler automatically sets the 'ioRanks' according to
the host name with the lowest rank e.g. to run simpleFoam on 6 processors with
ranks 0-2 on machineA and ranks 3-5 on machineB with the machines specified in
the hostfile:

    mpirun -np 6 --hostfile hostfile simpleFoam -parallel -fileHandler hostCollated

This is equivalent to

    mpirun -np 6 --hostfile hostfile simpleFoam -parallel -fileHandler collated -ioRanks '(0 3)'

This example will write directories:

    processors6_0-2/
    processors6_3-5/

A typical example would use distributed data e.g. no two nodes, machineA and
machineB, each with three processes:

    decomposePar -fileHandler collated -case cavity

    # Copy case (constant/*, system/*, processors6/) to master:
    rsync -a cavity machineA:/tmp/

    # Create root on slave:
    ssh machineB mkdir -p /tmp/cavity

    # Run
    mpirun --hostfile hostfile icoFoam \
        -case /tmp/cavity -parallel -fileHandler hostCollated \
        -hostRoots '("machineA" "/tmp" "machineB" "/tmp")'

Contributed by Mattijs Janssens
2018-03-21 12:42:22 +00:00
d469bbae4b COMP: Allwmake: feed through 'objects' targer for wmakeCollect 2018-05-17 08:39:57 +01:00
c812b4c6f7 ENH: atmosphericModels: Added Lopes da Costa porosity and turbulence models
Specialized variants of the power law porosity and k epsilon turbulence models
developed to simulate atmospheric flow over forested and non-forested complex
terrain.

Class
    Foam::powerLawLopesdaCosta

Description
    Variant of the power law porosity model with spatially varying
    drag coefficient

    given by:

        \f[
            S = -\rho C_d \Sigma |U|^{(C_1 - 1)} U
        \f]

    where
    \vartable
        \Sigma | Porosity surface area per unit volume
        C_d    | Model linear coefficient
        C_1    | Model exponent coefficient
    \endvartable

    Reference:
    \verbatim
        Costa, J. C. P. L. D. (2007).
        Atmospheric flow over forested and non-forested complex terrain.
    \endverbatim

Class
    Foam::RASModels::kEpsilonLopesdaCosta

Description
    Variant of the standard k-epsilon turbulence model with additional source
    terms to handle the changes in turbulence in porous regions represented by
    the powerLawLopesdaCosta porosity model.

    Reference:
    \verbatim
        Costa, J. C. P. L. D. (2007).
        Atmospheric flow over forested and non-forested complex terrain.
    \endverbatim

    The default model coefficients are
    \verbatim
        kEpsilonLopesdaCostaCoeffs
        {
            Cmu         0.09;
            C1          1.44;
            C2          1.92;
            sigmak      1.0;
            sigmaEps    1.3;
        }
    \endverbatim

Tutorial case to follow.
2018-03-20 22:26:07 +00:00
54ddd14168 STYLE: src/atmosphericModels: New library containing models specific to atmospheric flows
Converted the atmBoundaryLayerInlet boundary conditions to inletOutlet to handle
changes in inflow orientation without the need for re-meshing.
2018-03-18 14:08:20 +00:00
a8261a5626 STYLE: fvPatchFields: Corrected documentation
Resolves bug-report https://bugs.openfoam.org/view.php?id=2885
2018-03-22 11:09:42 +00:00
f246a81f8a BUG: wideBandAbsorptionEmission: Corrected errors
Resolves bug-reports
https://bugs.openfoam.org/view.php?id=2881
https://bugs.openfoam.org/view.php?id=2882

Patches contributed by Kevin Nordin-Bates
2018-03-21 18:03:29 +00:00
a33b6aa447 ENH: particle: Optimisation by inlining key methods
Resolves bug report https://bugs.openfoam.org/view.php?id=2871
2018-03-13 08:22:33 +00:00
b4a2876c56 ENH: use move construct for cellZone/faceZone 2018-03-07 11:28:05 +01:00
4fe8ed8245 STYLE: use direct iteration for HashSet
- The iterator for a HashSet dereferences directly to its key.

- Eg,

      for (const label patchi : patchSet)
      {
          ...
      }
  vs.
      forAllConstIter(labelHashSet, patchSet, iter)
      {
          const label patchi = iter.key();
          ...
      }
2018-03-06 00:29:03 +01:00
2a6ac7edce BUG: nearWallFields: correct exit condition for particles. Fixes #812. 2018-04-30 13:08:58 +01:00
e2361b102f COMP: inplaceMapValue relocated to ListOps 2018-04-30 14:05:54 +02:00
153323e1f6 Merge branch 'feature-regionsplit' into 'develop'
Feature regionsplit

See merge request Development/OpenFOAM-plus!201
2018-04-30 11:21:45 +01:00
f3d1e41d76 COMP: label-size 64 compilation of fft (issue #813) 2018-04-30 08:24:38 +02:00
f86c129fd5 STYLE: additional comment when completion not found (issue #719)
No completion added for XXX
    ... incorrect platform, or not yet compiled?
2018-04-30 07:50:48 +02:00
ed2722745d ENH: revert regionSplit to older algorithm (issue #805)
- the algorithm was last used in OpenFOAM-2.4, after which it was
  replaced with a FaceCellWave version.

  Whereas the original (2.4.x) version exhibited performance
  degradation on very large meshes (with explicit constraints), the
  FaceCellWave version exhibited performance issues with large numbers
  of blocked faces.

  With large numbers of blocked faces, the FaceCellWave regionSplit
  could take between 10 to 100 times longer due to the slow
  propagation speed through blocked faces.

  The 2.4 regionSplit has been revamped to avoid local memory
  allocations, which appears to have been the source of the original
  performance issues on large meshes.

  For additional performance, intermediate renumbering is also avoided
  during the consolidation of regions over processor domains.
2018-04-27 15:51:33 +02:00
dd8341f659 ENH: make format of ExecutionTime = ... output configurable (issue #788)
- controlled by the the 'printExecutionFormat' InfoSwitch in
  etc/controlDict

      // Style for "ExecutionTime = " output
      // - 0 = seconds (with trailing 's')
      // - 1 = day-hh:mm:ss

   ExecutionTime = 112135.2 s  ClockTime = 113017 s

   ExecutionTime = 1-07:08:55.20  ClockTime = 1-07:23:37

- Callable via the new Time::printExecutionTime() method,
  which also helps to reduce clutter in the applications.
  Eg,

     runTime.printExecutionTime(Info);

  vs

     Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
         << "  ClockTime = " << runTime.elapsedClockTime() << " s"
         << nl << endl;

--

ENH: return elapsedClockTime() and clockTimeIncrement as double

- previously returned as time_t, which is less portable.
2018-04-27 15:00:34 +02:00
0743b61a3c STYLE: minor cleanup in decompositionMethod
- reduce cell looping. Avoid initial looping over blockFace.

- make early return (no processor sets, connections, or blocked faces)
  more apparent.
2018-04-26 12:36:24 +02:00
4dcd052ffc STYLE: remove old/dead decompositionMethod::calcCellCells code
- alternative calcCellCells that handled explicitConnections was
  deactivated (2014 or earlier) and finally removed APR-2018.
2018-04-27 11:16:18 +02:00
10b69fa2b4 ENH: ListOp::inplaceMapValue using a Map<label> for the mapping.
For example, with some HashTable or Map container of models

    { model0 => 1, model1 => 4, model2 => 5, model3 => 12, model4 => 15, }

specify the remapping

    Map<label> mapper({{1, 3}, {2, 6}, {3, 12}, {5, 8}});

inplaceMapValue(mapper, models) then yields

    { model0 => 3, model1 => 4, model2 => 8, model3 => 12, model4 => 15, }

--

ENH: extend bitSet::count() to optionally count unset bits instead.

--

ENH: BitOps compatibility methods for boolList.

- These ease coding that uses a boolList instead of bitSet and use
  short-circuit logic when possible.

  Eg, when 'bitset' and 'bools' contain the same information

      bitset.count()  <->  BitOps::count(bools)
      bitset.all()    <->  BitOps::all(bools)
      bitset.any()    <->  BitOps::any(bools)
      bitset.none()   <->  BitOps::none(bools)

  These methods can then be used directly in parameters or in logic.
  Eg,

      returnReduce(bitset.any(), orOp<bool>());
      returnReduce(BitOps::any(bools), orOp<bool>());

      if (BitOps::any(bools)) ...
2018-04-27 10:43:32 +02:00
c0766ce8ea STYLE: consistent '// End namespace' markers 2018-04-27 09:51:35 +02:00
a9fbaa4b08 ENH: volPointInterpolate: improved debug message 2018-04-26 17:08:50 +01:00
a645b2b5c8 BUG: annularThermalMixer: incorrect shm setup. Fixes #811. 2018-04-25 11:43:52 +01:00
0226485c77 BUG: extraneous '}' in FULLDEBUG 2018-04-26 14:49:49 +02:00
d3c2668cc6 STYLE: extraneous debug output in PackedList
- bitSet::used() method for compatibility with code using the
  PackedBoolList typedef, but marked as deprecated.
2018-04-26 14:10:16 +02:00
f181a7ac61 SUBMODULE: minor updates for cfmesh
- with updated DynList that inherits from UList and uses List/FixedList
  internally for its memory management
2018-04-26 10:45:52 +02:00
497dde2b2f CONFIG: bump API version number to 1804 to account for bitSet
- since PackedBoolList is now a compatibility typedef for bitSet,
  it is useful to have an additional means of distinction.

STYLE: simplify internal version tests and compiler defines.

- the API version is now conveyed via the OPENFOAM define directly.
  The older OPENFOAM_PLUS define is provided for existing code.
2018-04-26 09:28:42 +02:00
ebfe46503f STYLE: improve wmkdepend parse error message
- parsing error state only arises from a missing final newline
  in the file (which the dnl macro does not capture).
  Report with a warning instead of modifying the dnl macro since
  we generally wish to know about this anyhow.

- add missing newline to YEqn.H file.
2018-04-25 14:37:59 +02:00
e6787bfa9a Merge branch 'feature-bitset' into 'develop'
ENH: new bitSet class and improved PackedList class (closes #751)

See merge request Development/OpenFOAM-plus!200
2018-04-25 11:39:59 +01:00
dffc65d41d STYLE: make token null constructor constexpr, noexcept 2018-04-25 10:42:25 +02:00
2fde6c3ab0 ENH: improve handling of mismatched brackets, forgotten ';' (issue #762)
- flags the following type of problems:

  * mismatches:

        keyword  mismatch ( set of { brackets ) in the } entry;

  * underflow (too many closing brackets:

        keyword  too many ( set of ) brackets ) in ) entry;

- a missing semi-colon

        dict
        {
           keyword  entry with missing semi-colon
        }

  will be flagged as 'underflow', since it parses through the '}' but
  did not open with it.

Max monitoring depth is 60 levels of nesting, to avoid incurring any
memory allocation.
2018-04-25 09:55:00 +02:00
76cb38fbc7 CONFIG: adjust make scripts for darwin
- handling of dead links (find -L -delete unsupported)

- remove ignore case flag on 's/../../i' used in have_scotch script.
  It is unneeded and not tolerated by Darwin's sed.

- avoid embedded comments in EXE_INC (Make/options files), which do
  not work well with the OSX LLVM cpp.
  It strips out the comments but also removes the continuation char.

STYLE: adjust notes about paraview library locations
2018-04-24 21:20:06 +02:00
0dfda5f796 COMP: fix Darwin size ambiguities
- size ambiguity for Foam::min(string::size_type, label)

- stream operators for int16/uint16 which are needed for mode_t (Darwin)
2018-04-24 18:03:42 +02:00
7bb7f1b352 ENH: overset: extraneous exchange. Fixes #803. 2018-04-25 09:20:57 +01:00
b18a9d73c4 ENH: checkMesh: near-zero vol cell. Fixes #808. 2018-04-23 17:54:16 +01:00
366d757937 COMP: ConstCirculator: missing include 2018-04-23 17:50:50 +01:00
2768500d57 CONFIG: remove WM_LINK_LANGUAGE env variable (always c++)
- was somewhat redundant in wmake/rules/General/general anyhow
2018-04-24 14:59:47 +02:00
b4d38ab468 ENH: improve handling of ThirdParty packages
- generalize some of the library extensions (.so vs .dylib).
  Provide as wmake 'sysFunctions'

- added note about unsupported/incomplete system support

- centralize detection of ThirdParty packages into wmake/ subdirectory
  by providing a series of scripts in the spirit of GNU autoconfig.
  For example,

      have_boost, have_readline, have_scotch, ...

  Each of the `have_<package>` scripts will generally provide the
  following type of functions:

      have_<package>          # detection
      no_<package>            # reset
      echo_<package>          # echoing

  and the following type of variables:

      HAVE_<package>          # unset or 'true'
      <package>_ARCH_PATH     # root for <package>
      <package>_INC_DIR       # include directory for <package>
      <package>_LIB_DIR       # library directory for <package>

  This simplifies the calling scripts:

      if have_metis
      then
          wmake metisDecomp
      fi

  As well as reducing clutter in the corresponding Make/options:

      EXE_INC = \
          -I$(METIS_INC_DIR) \
          -I../decompositionMethods/lnInclude

      LIB_LIBS = \
          -L$(METIS_LIB_DIR) -lmetis

  Any additional modifications (platform-specific or for an external build
  system) can now be made centrally.
2018-04-24 14:51:19 +02:00
672f0574e2 COMP: resolve signed/unsigned long ambiguity on Darwin 2018-04-24 13:17:22 +02:00
29c020f5b3 COMP: sinclude platform-specific CGAL rules
- permits platform-specific override of the general CGAL rules
2018-04-24 09:26:50 +02:00
5af5bfa1a5 ENH: error handling for Ragel STL parsing
- also simplify parsing by accepting any case on keywords.
  This implies that something like "sOlId", "SoLiD" will also
  be accepted. Although nobody should really count on this rather
  generous behaviour, it does simplfy the state machine even further.
2018-04-24 09:15:50 +02:00
591a1a0c68 ENH: improve memory allocations for explicit connections (issue #805)
STYLE: change access methods names in mesh wave algorithms

- nUnvisitedCells(), nUnvisitedFaces() etc instead of
  getUnsetCells(), getUnsetFaces()

- simplify some coding with range-for
2018-04-23 10:37:24 +02:00
857eed5b51 ENH: change findCell mode in meshRefinement (issue #805)
- in 2.4.x the general default for polyMesh::findCell was FACE_DIAG_TRIS,
  but this was changed to CELL_TETS for better handling of concave
  cells.

- in snappyHexMesh meshRefinement, findCell is used to define
  locations in mesh and cells for closer refinement. Using CELL_TETS
  causes an octree rebuild when the mesh has changed and this adds
  considerable overhead. For this operation, the faster FACE_DIAG_TRIS
  mode can be used instead.
2018-04-23 09:37:24 +02:00
1f25c5975d BUG: wmkdepend finds 'include' in multi-line comments (closes #784)
- the previous grammar used

      '/*' { fgoto comment; }

  to start processing multi-line comments and

      comment := any* :>> '*/' @{ fgoto main; };

  as a finishing action to return to normal lexing, but seemed not to
  have been triggered properly.

  Now simply trap in a single rule:

      '/*' any* :>> '*/';             # Multi-line comment

STYLE: use more compact dnl (delete to newline)

  OLD:   [^\n]* '\n'
  NEW:   (any* -- '\n') '\n'

  eliminates the intermediate state
2018-04-20 14:41:32 +02:00
694004ad41 ENH: finiteArea - integrated d2dt2 scheme from Alexander Kabat vel Job 2018-04-20 15:04:47 +01:00
4a2afb85d6 BUG: Added missing oriented flag to meshPhi 2018-04-19 12:08:19 +01:00
b5c7e43c84 DEFEATURE: remove foamToTecplot360
- the API-versioned calls (eg, tecini142, teczne142, tecpoly142, tecend142),
  the limited availability of the SDK and lack of adequate testing make
  proper maintenance very difficult.
2018-04-19 14:51:33 +02:00