1. 18 Jan, 2019 1 commit
  2. 16 Jan, 2019 2 commits
    • Mark Olesen's avatar
      ENH: use globalIndex gather in patch merging · c44814c1
      Mark Olesen authored
      c44814c1
    • Mark Olesen's avatar
      ENH: add simplified gather methods for globalIndex with default communicator · f498d09d
      Mark Olesen authored
      - 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();
          ----
      f498d09d
  3. 09 Jan, 2019 2 commits
    • Mark Olesen's avatar
      STYLE: add compile-time deprecated message for face/triangle normal() · c350a127
      Mark Olesen authored
      - in 1812 propagated through the distinction between areaNormal and
        unitNormal (issue #885).
      
        In older versions, the normal() always meant the area-normal for
        certain of these primitive.
      
        However, the .org version changed this to now return the unit-normal
        instead, but with the same method name. Thus add the deprecated
        message to avoid future inadvertent uses of normal() without being
        certain which one is being meant.
      c350a127
    • Mark Olesen's avatar
      ENH: minor consistency improvements for bounding box · 20670140
      Mark Olesen authored
      - 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
      20670140
  4. 08 Jan, 2019 1 commit
  5. 07 Jan, 2019 2 commits
  6. 03 Jan, 2019 1 commit
  7. 02 Jan, 2019 1 commit
  8. 16 Dec, 2018 1 commit
    • Mark Olesen's avatar
      ENH: add some storage queries to PrimitivePatch · dc8179f5
      Mark Olesen authored
      - for quantities such as face area/normals etc, it can be useful to
        calculate directly and avoid the overhead of caching all the values.
      
      STYLE: comments, use HashTable lookup() method in whichPoint()
      dc8179f5
  9. 11 Dec, 2018 1 commit
    • Mark Olesen's avatar
      ENH: use Zero when zero-initializing types · 1d85fecf
      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)
      1d85fecf
  10. 13 Dec, 2018 1 commit
  11. 09 Nov, 2018 1 commit
  12. 14 Nov, 2018 1 commit
  13. 15 Nov, 2018 1 commit
    • Mark Olesen's avatar
      ENH: code reduction in MeshObject (#1071) · c5998105
      Mark Olesen authored
      - use forwarding templates for the factory method
      
      - avoid double use of dynamic_cast.
        Don't need implicit use in isA<>, can use result directly
      
      STYLE: updated iteration over HashTable of mesh objects
      c5998105
  14. 11 Nov, 2018 1 commit
  15. 09 Nov, 2018 1 commit
  16. 08 Nov, 2018 1 commit
  17. 06 Nov, 2018 1 commit
  18. 05 Nov, 2018 1 commit
    • Mark Olesen's avatar
      ENH: extend globalIndex toGlobal methods · f5baa9a5
      Mark Olesen authored
      - 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())
           );
      f5baa9a5
  19. 19 Oct, 2018 2 commits
  20. 18 Oct, 2018 1 commit
    • Mark Olesen's avatar
      ENH: cleanup of Enum class · 3b745122
      Mark Olesen authored
      - 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.
      3b745122
  21. 16 Oct, 2018 1 commit
  22. 12 Oct, 2018 1 commit
    • Mark Olesen's avatar
      ENH: avoid readScalar, readLabel etc from dictionary (#762, #1033) · 8eddcc07
      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,
      
           this->coeffsDict().getScalar("key");
      8eddcc07
  23. 27 Sep, 2018 2 commits
    • Andrew Heather's avatar
      ENH: polyPatch - added areaFraction method · 0f4c6572
      Andrew Heather authored
      Helper function to calculate the current face area vs the area returned
      from the current point locations.  Useful for ACMI-type baffles where we
      scale the face areas without moving points.
      0f4c6572
    • Mark Olesen's avatar
      STYLE: add nBoundaryFaces() method to primitiveMesh · 64c3e484
      Mark Olesen authored
      - 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;
           }
      64c3e484
  24. 20 Sep, 2018 1 commit
  25. 19 Sep, 2018 1 commit
  26. 13 Sep, 2018 2 commits
  27. 11 Sep, 2018 1 commit
  28. 27 Aug, 2018 1 commit
  29. 08 Aug, 2018 2 commits
    • Mark Olesen's avatar
      STYLE: use edgeHashes include · ca5d9123
      Mark Olesen authored
      STYLE: use initial hash size 128 instead of 100 in a few places
      ca5d9123
    • Mark Olesen's avatar
      ENH: add missing Hash function for List/UList (issue #966) · dd9ecd49
      Mark Olesen authored
      - there were previously no hashing mechanisms for lists so they
        would fall back to the definition for primitives and hash the
        memory location of the allocated List object.
      
      - provide a UList::Hash<> sub-class for inheritance, and also a global
        specialization for UList<T>, List<T> such that the hash value for
        List<List<T>> cascades properly.
      
      - provide similar function in triFace to ensure that it remains
        similar in behaviour to face.
      
      - added SymmHash to Pair, for use when order is unimportant.
      
      STYLE: use string::hash() more consistently
      
      - no particular reason to use Hash<word>() which forwards to
        string::hash() anyhow
      dd9ecd49
  30. 07 Aug, 2018 1 commit
  31. 06 Aug, 2018 1 commit
  32. 03 Aug, 2018 2 commits
    • Mark Olesen's avatar
      ENH: additional methods and improvements to plane · de2eed3e
      Mark Olesen authored
      - signedDistance() method is like distance() but retains
        the positive/negative sign for the side of the plane.
      
      - the sign() method returns the sign as -1,0,+1 integer for
        classification purposes where it is important to distinguish between
        a zero value and a positive value (eg, for cutting). Optional
        tolerance can be supplied to round for zero.
      
      - refactor and inlined simple and frequently used methods.
      
      - add boundBox faceCentre() method, which can be useful for creating
        clipping planes from a bounding box.
        Relocated treeBoundBox faceNormals to boundBox since they apply
        equally there - the meaning of the faces (x-min, x-max, etc)
        is the same, even if the point addressing for the faces differs.
      de2eed3e
    • Mark Olesen's avatar
      ENH: added ZoneMesh indices(), selection() with wordRes matcher · 84e2df49
      Mark Olesen authored
      - rationalized code dealing with extraction of name or indices from
        coordinateSystems, polyBoundaryMesh, faBoundaryMesh, fvBoundaryMesh,
        ZoneMesh to use internal implementations that allow direct
        searching/matching without building an intermediate list of names.
      
      - simpler and more efficient handling of patch group matching.
      84e2df49