1. 21 Dec, 2018 1 commit
    • Mark Olesen's avatar
      ENH: use Zero when zero-initializing types · e23bd3bb
      Mark Olesen authored
      - 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)
  2. 19 Oct, 2018 1 commit
  3. 12 Oct, 2018 1 commit
    • Mark Olesen's avatar
      ENH: avoid readScalar, readLabel etc from dictionary (#762, #1033) · efe02691
      Mark Olesen authored
      - use the dictionary 'get' methods instead of readScalar for
        additional checking
           Unchecked:  readScalar(dict.lookup("key"));
           Checked:    dict.get<scalar>("key");
      - In templated classes that also inherit from a dictionary, an additional
        'template' keyword will be required. Eg,
           this->coeffsDict().template get<scalar>("key");
        For this common use case, the predefined getXXX shortcuts may be
        useful. Eg,
  4. 13 Aug, 2018 2 commits
  5. 30 May, 2018 1 commit
  6. 17 Apr, 2018 1 commit
  7. 03 Apr, 2018 1 commit
    • Mark Olesen's avatar
      STYLE: more consistent use of dimensioned Zero · 5632ef2d
      Mark Olesen authored
      - when constructing dimensioned fields that are to be zero-initialized,
        it is preferrable to use a form such as
            dimensionedScalar(dims, Zero)
            dimensionedVector(dims, Zero)
        rather than
            dimensionedScalar("0", dims, 0)
            dimensionedVector("zero", dims, vector::zero)
        This reduces clutter and also avoids any suggestion that the name of
        the dimensioned quantity has any influence on the field's name.
        An even shorter version is possible. Eg,
        but reduces the clarity of meaning.
      - NB: UniformDimensionedField is an exception to these style changes
        since it does use the name of the dimensioned type (instead of the
  8. 07 Mar, 2018 1 commit
    • Mark Olesen's avatar
      ENH: cleanup autoPtr class (issue #639) · a2d43901
      Mark Olesen authored
      Improve alignment of its behaviour with std::unique_ptr
        - element_type typedef
        - release() method - identical to ptr() method
        - get() method to get the pointer without checking and without releasing it.
        - operator*() for dereferencing
      Method name changes
        - renamed rawPtr() to get()
        - renamed rawRef() to ref(), removed unused const version.
      Removed methods/operators
        - assignment from a raw pointer was deleted (was rarely used).
          Can be convenient, but uncontrolled and potentially unsafe.
          Do allow assignment from a literal nullptr though, since this
          can never leak (and also corresponds to the unique_ptr API).
      Additional methods
        - clone() method: forwards to the clone() method of the underlying
          data object with argument forwarding.
        - reset(autoPtr&&) as an alternative to operator=(autoPtr&&)
      STYLE: avoid implicit conversion from autoPtr to object type in many places
      - existing implementation has the following:
           operator const T&() const { return operator*(); }
        which means that the following code works:
             autoPtr<mapPolyMesh> map = ...;
             updateMesh(*map);    // OK: explicit dereferencing
             updateMesh(map());   // OK: explicit dereferencing
             updateMesh(map);     // OK: implicit dereferencing
        for clarity it may preferable to avoid the implicit dereferencing
      - prefer operator* to operator() when deferenced a return value
        so it is clearer that a pointer is involve and not a function call
        etc    Eg,   return *meshPtr_;  vs.  return meshPtr_();
  9. 22 Jan, 2018 1 commit
  10. 28 Oct, 2017 1 commit
  11. 22 Sep, 2017 12 commits
    • Will Bainbridge's avatar
      lagrangian: Optimised reduced-dimension constraints · f1780abe
      Will Bainbridge authored and Andrew Heather's avatar Andrew Heather committed
      The 4.x tracking enforces reduced dimensionality on the parcels by
      moving them to the centre of the mesh at the start of each track,
      without considering the topology. This can leave the parcel outside it's
      associated tetrahedron.
      The barycentric algorithm isn't tolerant to incorrect topology, so
      instead of changing position, it was written to track to the mesh
      centre. This worked, but effectively doubled the number of tracking
      calls. This additional cost has now been removed by absorbing the
      constraint displacement into the existing motion track, so that the same
      number of tracking steps are performed as before.
      Partially resolves bug report https://bugs.openfoam.org/view.php?id=2688
    • Andrew Heather's avatar
      ENH: Lagrangian - provided backwards compatibility for cases using the · 65a9d494
      Andrew Heather authored
      old "positions" file form
      The change to barycentric-based tracking changed the contents of the
      cloud "positions" file to a new format comprising the barycentric
      co-ordinates and other cell position-based info.  This broke
      backwards compatibility, providing no option to restart old cases
      (v1706 and earlier), and caused difficulties for dependent code, e.g.
      for post-processing utilities that could only infer the contents only
      after reading.
      The barycentric position info is now written to a file called
      "coordinates" with provision to restart old cases for which only the
      "positions" file is available. Related utilities, e.g. for parallel
      running and data conversion have been updated to be able to support both
      file types.
      To write the "positions" file by default, use set the following option
      in the InfoSwitches section of the controlDict:
          writeLagrangianPositions 1;
    • Andrew Heather's avatar
      INT: clean-up · a6044104
      Andrew Heather authored
    • Will Bainbridge's avatar
      lagrangian: Removed duplicate hit-processor handling · fa31a76a
      Will Bainbridge authored and Andrew Heather's avatar Andrew Heather committed
    • Will Bainbridge's avatar
      lagrangian: Removed unnecessary patch argument from hit methods · 6a6f4d76
      Will Bainbridge authored and Andrew Heather's avatar Andrew Heather committed
      The patch can be determined from the particle when it is needed. Most of
      the time it is not.
    • Will Bainbridge's avatar
      lagrangian: Removed duplicate data from method arguments · dd30e552
      Will Bainbridge authored and Andrew Heather's avatar Andrew Heather committed
      A lot of methods were taking argument data which could be referenced or
      generated from the parcel class at little or no additional cost. This
      was confusing and generated the possibility of inconsistent data states.
    • Will Bainbridge's avatar
      lagrangian: Un-templated the tracking data · 76e2c497
      Will Bainbridge authored and Andrew Heather's avatar Andrew Heather committed
      Tracking data classes are no longer templated on the derived cloud type.
      The advantage of this is that they can now be passed to sub models. This
      should allow continuous phase data to be removed from the parcel
      classes. The disadvantage is that every function which once took a
      templated TrackData argument now needs an additional TrackCloudType
      argument in order to perform the necessary down-casting.
    • Henry Weller's avatar
      Rationalize the "pos" function · ae277fd1
      Henry Weller authored and Andrew Heather's avatar Andrew Heather committed
      "pos" now returns 1 if the argument is greater than 0, otherwise it returns 0.
      This is consistent with the common mathematical definition of the "pos" function:
      However the previous implementation in which 1 was also returned for a 0
      argument is useful in many situations so the "pos0" has been added which returns
      1 if the argument is greater or equal to 0.  Additionally the "neg0" has been
      added which returns 1 if if the argument is less than or equal to 0.
    • Andrew Heather's avatar
      INT: Integration of Mattijs' collocated parallel IO additions · 85f12ff5
      Andrew Heather authored
      Original commit message:
      Parallel IO: New collated file format
      When an OpenFOAM simulation runs in parallel, the data for decomposed fields and
      mesh(es) has historically been stored in multiple files within separate
      directories for each processor.  Processor directories are named 'processorN',
      where N is the processor number.
      This commit introduces an alternative "collated" file format where the data for
      each decomposed field (and mesh) is collated into a single file, which is
      written and read on the master processor.  The files are stored in a single
      directory named 'processors'.
      The new format produces significantly fewer files - one per field, instead of N
      per field.  For large parallel cases, this avoids the restriction on the number
      of open files imposed by the operating system limits.
      The file writing can be threaded allowing the simulation to continue running
      while the data is being written to file.  NFS (Network File System) is not
      needed when using the the collated format and additionally, there is an option
      to run without NFS with the original uncollated approach, known as
      The controls for the file handling are in the OptimisationSwitches of
          //- Parallel IO file handler
          //  uncollated (default), collated or masterUncollated
          fileHandler uncollated;
          //- collated: thread buffer size for queued file writes.
          //  If set to 0 or not sufficient for the file size threading is not used.
          //  Default: 2e9
          maxThreadFileBufferSize 2e9;
          //- masterUncollated: non-blocking buffer size.
          //  If the file exceeds this buffer size scheduled transfer is used.
          //  Default: 2e9
          maxMasterFileBufferSize 2e9;
      When using the collated file handling, memory is allocated for the data in the
      thread.  maxThreadFileBufferSize sets the maximum size of memory in bytes that
      is allocated.  If the data exceeds this size, the write does not use threading.
      When using the masterUncollated file handling, non-blocking MPI communication
      requires a sufficiently large memory buffer on the master node.
      maxMasterFileBufferSize sets the maximum size in bytes of the buffer.  If the
      data exceeds this size, the system uses scheduled communication.
      The installation defaults for the fileHandler choice, maxThreadFileBufferSize
      and maxMasterFileBufferSize (set in etc/controlDict) can be over-ridden within
      the case controlDict file, like other parameters.  Additionally the fileHandler
      can be set by:
      - the "-fileHandler" command line argument;
      - a FOAM_FILEHANDLER environment variable.
      A foamFormatConvert utility allows users to convert files between the collated
      and uncollated formats, e.g.
          mpirun -np 2 foamFormatConvert -parallel -fileHandler uncollated
      An example case demonstrating the file handling methods is provided in:
      The work was undertaken by Mattijs Janssens, in collaboration with Henry Weller.
    • Will Bainbridge's avatar
      Lagrangian: Enabled tracking through ACMI patches and minor code improvements · 930e02a0
      Will Bainbridge authored and Andrew Heather's avatar Andrew Heather committed
      Particle collisions with ACMI patches are now handled. The hit detects
      whether the location is within the overlap or the coupled region and
      recurses, calling the hit routine appropriate for the region.
      The low level tracking methods are now more consistently named. There is
      now a distinction between tracking to a face and hitting it. Function
      object side effects have been moved out of the base layer and into the
      parcels on which they are meaningful.
    • Will Bainbridge's avatar
      lagrangian: Corrected patch data · 4bc08a0a
      Will Bainbridge authored and Andrew Heather's avatar Andrew Heather committed
      The KinematicCloud::patchData method has been made consistent on moving
      meshes and/or when the time-step is being sub-cycled.
      It has also been altered to calculate the normal component of a moving
      patch's velocity directly from the point motions. This prevents an
      infinite loop occuring due to inconsistency between the velocity used to
      calculate a rebound and that used when tracking.
      Some minor style improvements to the particle class have also been made.
    • Will Bainbridge's avatar
      Lagrangian: Rewrite of the particle tracking algorithm to function in · b7d08241
      Will Bainbridge authored and Andrew Heather's avatar Andrew Heather committed
      terms of the local barycentric coordinates of the current tetrahedron,
      rather than the global coordinate system.
      Barycentric tracking works on any mesh, irrespective of mesh quality.
      Particles do not get "lost", and tracking does not require ad-hoc
      "corrections" or "rescues" to function robustly, because the calculation
      of particle-face intersections is unambiguous and reproducible, even at
      small angles of incidence.
      Each particle position is defined by topology (i.e. the decomposed tet
      cell it is in) and geometry (i.e. where it is in the cell). No search
      operations are needed on restart or reconstruct, unlike when particle
      positions are stored in the global coordinate system.
      The particle positions file now contains particles' local coordinates
      and topology, rather than the global coordinates and cell. This change
      to the output format is not backwards compatible. Existing cases with
      Lagrangian data will not restart, but they will still run from time
      zero without any modification. This change was necessary in order to
      guarantee that the loaded particle is valid, and therefore
      fundamentally prevent "loss" and "search-failure" type bugs (e.g.,
      2517, 2442, 2286, 1836, 1461, 1341, 1097).
      The tracking functions have also been converted to function in terms
      of displacement, rather than end position. This helps remove floating
      point error issues, particularly towards the end of a tracking step.
      Wall bounded streamlines have been removed. The implementation proved
      incompatible with the new tracking algorithm. ParaView has a surface
      LIC plugin which provides equivalent, or better, functionality.
      Additionally, bug report <https://bugs.openfoam.org/view.php?id=2517>
      is resolved by this change.
  12. 21 Jul, 2017 1 commit
  13. 10 Jul, 2017 1 commit
  14. 26 May, 2017 1 commit
  15. 19 May, 2017 1 commit
  16. 28 Apr, 2017 1 commit
  17. 16 Aug, 2016 1 commit
  18. 01 Aug, 2016 1 commit
  19. 18 May, 2016 1 commit
  20. 13 May, 2016 1 commit
    • mark's avatar
      ENH: add parcel property types (fixes #109) · 1fdaeb5f
      mark authored
      - assists in decoding what the binary IO content means
      ENH: use label instead of bool for the KinematicParcel active state (fixes #111)
      - avoids internal padding of the data structure and simplifies
        downstream use.
      ENH: make particle sizeofFields public (fixes #110)
      Also fixes #108 (missing faceI and stepFraction entries) which had
      also been fixed in the upstream as well.
  21. 30 Apr, 2016 2 commits
    • Henry Weller's avatar
      GeometricField: Renamed internalField() -> primitiveField() and... · fe43b805
      Henry Weller authored
      GeometricField: Renamed internalField() -> primitiveField() and dimensionedInternalField() -> internalField()
      These new names are more consistent and logical because:
          Provides low-level access to the Field<Type> (primitive field)
          without dimension or mesh-consistency checking.  This should only be
          used in the low-level functions where dimensional consistency is
          ensured by careful programming and computational efficiency is
          Provides access to the DimensionedField<Type, GeoMesh> of values on
          the internal mesh-type for which the GeometricField is defined and
          supports dimension and checking and mesh-consistency checking.
    • Henry Weller's avatar
      GeometricField::internalField() -> GeometricField::internalFieldRef() · e1e99674
      Henry Weller authored
      Non-const access to the internal field now obtained from a specifically
      named access function consistent with the new names for non-canst access
      to the boundary field boundaryFieldRef() and dimensioned internal field
      See also commit a4e2afa4
  22. 28 Apr, 2016 1 commit
    • Henry Weller's avatar
      GeometricField::GeometricBoundaryField -> GeometricField::Boundary · 75ea7618
      Henry Weller authored
      When the GeometricBoundaryField template class was originally written it
      was a separate class in the Foam namespace rather than a sub-class of
      GeometricField as it is now.  Without loss of clarity and simplifying
      code which access the boundary field of GeometricFields it is better
      that GeometricBoundaryField be renamed Boundary for consistency with the
      new naming convention for the type of the dimensioned internal field:
      Internal, see commit a25a449c
      This is a very simple text substitution change which can be applied to
      any code which compiles with the OpenFOAM-dev libraries.
  23. 25 Apr, 2016 2 commits
  24. 24 Apr, 2016 1 commit
  25. 16 Apr, 2016 1 commit
  26. 29 Feb, 2016 1 commit