Skip to content
Snippets Groups Projects
  1. May 07, 2024
  2. May 06, 2024
    • Mark OLESEN's avatar
      ENH: add single-time handling to timeSelector · dbfd1f90
      Mark OLESEN authored
      - the timeSelector is often used to select single or multiple times
        (eg, for post-processing). However, there are a few applications
        where only a *single* time should be selected and set.
      
        These are now covered by this type of use:
      
            timeSelector::addOptions_singleTime();  // Single-time options
            ...
            // Allow override of time from specified time options, or no-op
            timeSelector::setTimeIfPresent(runTime, args);
      
         In some cases, if can be desirable to force starting from the
         initial Time=0 when no time options have been specified:
      
            // Set time from specified time options, or force start from Time=0
            timeSelector::setTimeIfPresent(runTime, args, true);
      
         These changes make a number of includes redundant:
      
           * addTimeOptions.H
           * checkConstantOption.H
           * checkTimeOption.H
           * checkTimeOptions.H
           * checkTimeOptionsNoConstant.H
      
      ENH: add time handling to setFields, setAlphaField (#3143)
      
          Co-authored-...
      dbfd1f90
  3. May 02, 2024
    • Mark OLESEN's avatar
      ENH: add offset support to stringOps::split functions · 88319698
      Mark OLESEN authored
      - for example,
      
           string buffer = ...;
           SubStrings<string> split;
           {
               auto colon = buffer.find(':');
      
               if (colon != std::string::npos)
               {
                   split = stringOps::splitSpace(buffer, colon+1);
               }
           }
      
          Not really possible with a substr() since that would create a new
          temporary which then disappears.  Similarly awkward to split and
          then scan for the ':' to decide how many to discard.
      
      ENH: add pop_front() and pop_back() methods to SubStrings
      
      - the content is trivial enough (a pair of iterators) and the total
        number of elements is usually reasonable short so that removal of
        elements is inexpensive
      
        For example,
      
           string buffer = ...;
           auto split = stringOps::splitSpace(buffer);
      
           if (!split.empty() && split[0].str() == "face")
           {
               split.pop_front();
           }
      88319698
    • Mark OLESEN's avatar
      COMP: remove template-id for constructor/destructor · 3fed4154
      Mark OLESEN authored
      - not allowed in C++20
      
      COMP: avoid hidden overloaded-virtual (edgeMesh, surfMesh)
      3fed4154
    • Kutalmış Berçin's avatar
  4. Apr 29, 2024
    • Mattijs Janssens's avatar
      Merge branch 'update-Pstream-message-count' into 'develop' · 7dc9ccdc
      Mattijs Janssens authored
      Use MPI Get_elements_x() for message sizes
      
      See merge request !681
      7dc9ccdc
    • Mark OLESEN's avatar
      ENH: use MPI Get_elements_x() for message sizes (#3152) · b2bbc154
      Mark OLESEN authored
      - ensures more accurate values for message sizes than using
        MPI Get_count(), which trucates at INT_MAX
      
      - add more/better error messages when trying to receive messages
        that exceed INT_MAX or the char buffer lengths
      b2bbc154
    • Mark OLESEN's avatar
      STYLE: use PstreamBuffers default construct · 7b38b148
      Mark OLESEN authored
      - PstreamBuffers are nonBlocking by default, so no need to re-specify
      7b38b148
    • Mark OLESEN's avatar
      STYLE: communication name "buffered" instead of "blocking" · 7f355ba3
      Mark OLESEN authored
      - "buffered" corresponds to MPI_Bsend (buffered send),
        whereas the old name "blocking" is misleading since the
        regular MPI_Send also blocks until completion
        (ie, buffer can be reused).
      
      ENH: IPstream::read() returns std::streamsize instead of label (#3152)
      
      - previously returned a 'label' but std::streamsize is consistent with
        the input parameter and will help with later adjustments.
      
      - use <label> instead of <int> for internal accounting of the message
        size, for consistency with the underyling List<char> buffers used.
      
      - improve handling for corner case of IPstream receive with
        non-blocking, although this combination is not used anywhere
      7f355ba3
  5. Apr 25, 2024
  6. Apr 24, 2024
    • mattijs's avatar
      690d02f9
    • Mattijs Janssens's avatar
      Merge branch 'update-fvsPatchFields-mappers' into 'develop' · 31b74cd6
      Mattijs Janssens authored
      Fix fvsPatchFields reading/writing the "value" entry
      
      See merge request Development/openfoam!679
      31b74cd6
    • Mark OLESEN's avatar
      ENH: improve code consistency for {cell,face,point}Mapper (#3147) · f04ccef5
      Mark OLESEN authored
      - robuster and more reliable determination of inserted objects
        (previous code could produce false positives).
      
        Now also determine the number of inserted objects within the
        constructor (instead of simply storing a bool). This allows reuse
        in the address calculations to reduce overheads there.
      
      BUG: dodgy short-circuit logic for insertedObjectLabels()
      
      - as a quick short-circuit it previously created as demand-driven
        pointer with a zero elements. However, this meant that if this code
        was called first (before any other addressing), subsequent calls to
        the addressing would fail.
      
      BUG: bad logic and lookup for faAreaMapper (#3147)
      
      - was using labelHashSet but returning a bool and set using the
        addressing using the unfiltered objects!
        This is a latent bug since interpolated/inserted faces not
        currently supported anyhow.
      
      ENH: use std::unique_ptr for demand-driven data
      f04ccef5
    • Mark OLESEN's avatar
      BUG: fvsPatchFields reading/writing the "value" entry (fixes #3144) · 8a8b5db9
      Mark OLESEN authored
      - manual revert for 44d0fbd5.
      
        Unless required for post-processing the "value" entry should not
        written if it is not mandatory for reading.
      
        This is especially crucial with an 'empty' patch field where the
        field (size 0) has a different size from the patch.
      
      - the changes made align fvsPatchField behaviour with fvPatchField
      8a8b5db9
  7. Apr 23, 2024
  8. Apr 22, 2024
  9. Apr 19, 2024
  10. Apr 18, 2024
  11. Apr 16, 2024
    • Mark OLESEN's avatar
      ENH: prefer objectRegistry sorted to lookupClass · 31aadc5c
      Mark OLESEN authored
      - lower memory overhead, consistent access pattern
      31aadc5c
    • Mark OLESEN's avatar
      ENH: use typedef for MeshObject within derived classes · a803516b
      Mark OLESEN authored
      - use an internal 'typedef MeshObject<...> MeshObject_type' within
        derived classes. Reduces clutter and eases any updates.
      a803516b
    • Mark OLESEN's avatar
      ENH: add MeshObject Release() static method · 1b212789
      Mark OLESEN authored
      - Delete() will perform a 'checkOut()' which does the following:
        * remove the object from the registry
        * delete the pointer (if owned by the registry)
      
      - Release() does the following:
        * transfer ownership of the pointer (if owned by the registry)
      
      - Store() does the following:
        * transfer ownership of the pointer to the registry
      
      ENH: use UPtrList of sorted objects for MeshObject updates
      
      - few allocations and lower overhead than using a HashTable,
        ensures the same walk order over the objects (in parallel)
      
      STYLE: adjust meshObject debug statements
      1b212789
    • Mark OLESEN's avatar
      ENH: add separate handling for clearing mesh phi · 688fd5f3
      Mark OLESEN authored
      STYLE: update code style for phi modification (engine motion)
      
      ENH: pass isMeshUpdate param in fvMesh/polyMesh clearOut() methods
      
      - top-level use of isMeshUpdate parameter to clearOut and
        clearAddressing was being inadvertently filtered out
      688fd5f3
    • Mark OLESEN's avatar
      REGRESSION: distributedTriSurfaceMesh:::findLocalInstance failure (#3135) · 75e19c31
      Mark OLESEN authored
      - after the modification of d578d48a, the parent was now actually
        searched. However, should be returning "constant" and not trigger a
        FatalError if the file/directory is not found.
      75e19c31
    • Mark OLESEN's avatar
      ENH: reduce reliance on stringListOps functions · 16dd92b3
      Mark OLESEN authored
      - findStrings, findMatchingStrings now mostly covered by matching
        intrinsics in wordRe and wordRes.
      
        Add static wordRes match() and matching() variants
      
      COMP: remove stringListOps include from objectRegistry.H
      
      - was already noted for removal (NOV-2018)
      16dd92b3
    • Mark OLESEN's avatar
      ENH: add const_cast variants for isA<> and refCast<> · 92c329a8
      Mark OLESEN authored
      - an example of the new, more succinct refConstCast version:
      
            auto& abc = refConstCast<adjointVectorBoundaryCondition>(Uab);
      
        older:
            adjointVectorBoundaryCondition& abc =
                refCast<adjointVectorBoundaryCondition>
                (
                    const_cast<fvPatchVectorField&>(Uab)
                );
        or:
            adjointVectorBoundaryCondition& abc =
                const_cast<adjointVectorBoundaryCondition&>
                (
                    refCast<const adjointVectorBoundaryCondition>(Uab)
                );
      
      - an example of the new, more succinct isA_constCast version:
      
            auto* acapPtr = isA_constCast<fieldType>(abf[patchi]);
      
            if (acapPtr)
            {
                auto& acap = *acapPtr;
                ...
            }
      
        older:
            if (isA<fieldType>(abf[patchi]))
            {
                fieldType& acap =
                    const_cast<fieldType&>
                    (
                        refCast<const fieldType>(abf[patchi])
                    );
                ...
            }
      
      STYLE: remove spurious 'const' qualifier from isA<> use
      92c329a8
  12. Apr 15, 2024
  13. Apr 11, 2024
  14. Apr 10, 2024
    • Mark OLESEN's avatar
      ENH: improve findInstance handling for optional files · d578d48a
      Mark OLESEN authored
      - previously would always return "constant" as the instance for
        an optional dir/file that wasn't found.
        However, this meant retesting to screen out false positives.
        Now support an additional parameter
            'bool constant_fallback = ...'
        to return "constant" or an empty word.
      
        The method signature changes slightly with a new optional bool
        parameter:
      
            //! Return \c "constant" instead of \c "" if the search failed
            const bool constant_fallback = true
      
      ENH: code consolidation for findInstancePath
      
      - relocate from Time to TimePaths and provide an additional static
        version that is reused in fileOperations
      
      BUG: distributedTriSurfaceMesh:::findLocalInstance broken (#3135)
      
      - was not checking the parent at all.
      
      COMP: remove unused findInstancePath(const fileName&, ..) method
      d578d48a
    • Mark OLESEN's avatar
      ENH: simpler topoSet handling of zone/set · 85771c89
      Mark OLESEN authored
      - support construct faceZoneSet from faceSet (#3126)
      
      ENH: support unregistered loading of cell/face/point sets
      85771c89