Skip to content
Snippets Groups Projects
  1. Nov 05, 2021
    • Mark OLESEN's avatar
      ENH: improve handling of area calculations in faMesh (#2233) · a95427c2
      Mark OLESEN authored and Andrew Heather's avatar Andrew Heather committed
      - previous handling did not correctly account for off-processor
        connections (SEGFAULT).
      
      - revised the point/area normal calculations to use the dual of the
        faces. This simplifies the logic and reduces the depth of loops.
      
        Point corrections from the neighbouring patches is handled
        centrally by the new halo face information, which properly handles
        on-processor or off-processor faces irrespective of any explicit
        processor patches.
      
      STYLE: local function and add comments for finiteArea area weighting
      
      - following the original Tukovic code, the area-weighted normal
        for a vector pair (defining a triangle) is weighted by
          (1) area : larger weight for larger areas
          (2) sin  : lower weight for narrow angles (eg, shards)
          (3) invDist squared : lower weights for distant points
      
        Refactored to eliminate intermediate operations, some additional
        divide-by-zero protection - similar to vector normalise()
      a95427c2
    • Mark OLESEN's avatar
      ENH: add boundary halo handling to faMesh · ea92cb82
      Mark OLESEN authored and Andrew Heather's avatar Andrew Heather committed
      - the finiteArea is typically restricteed to one or more patches on a
        polyMesh but will have an external connectivity to other parts of
        the polyMesh. For proper determination of the point normals (for
        example), the neighbouring information is needed.
      
        These outside 'halo' faces can be located on different processors,
        but not correspond to an internal processor-processor interface.
      
        Add a dedicated form of mapDistribute for swapping this type of
        information. Since this is a collective operation, locate
        corresponding methods directly on the faMesh level instead of
        the faPatch level.
      ea92cb82
    • Mark OLESEN's avatar
      BUG: parallel construct finiteArea fails with arbitrary connections (#2152) · 8e451089
      Mark OLESEN authored and Andrew Heather's avatar Andrew Heather committed
      - the case of 'fan-like' processor was previously assumed to be
        rare (see merge-request !490 and issue #2084).
      
        However, Vaggelis Papoutsis noticed that even fairly normal geometries
        can trigger problems.
      
      - replaced the old patch/patch matching style with a more general
        edge-based synchronisation and matching that appears to handle
        the corner cases inherently. The internal communication overhead
        is essentially unchanged, and the logic is simpler.
      
      ENH: additional framework for managing patch connectivity
      8e451089
    • Mark OLESEN's avatar
      BUG: parallel blocking with faFieldDecomposer, faMeshReconstructor (fixes #2237) · 9c1f94d4
      Mark OLESEN authored and Andrew Heather's avatar Andrew Heather committed
      - the patch remapping in faFieldDecomposer calls weights
        internalField() which can trigger parallel communication on the
        complete mesh for some processors only (ie, blocks).
      
        Force a priori creation of weights instead.
      
      - ensure that the complete mesh (reconstruction helper)
        is serial when adding patches.
      9c1f94d4
    • Mark OLESEN's avatar
      BUG: incorrect finite-area faceProcAddressing (fixes #2155) · a8092654
      Mark OLESEN authored and Andrew Heather's avatar Andrew Heather committed
      - when creating a finite-area mesh in parallel, need to determine
        the equivalent ProcAddressing for the faMesh.
      
        In the faceProcAddressing the collected and sorted order was being
        scattered directly back to the individual processors instead of only
        the sections relevant to each particular processor.
      
        This caused the observed jumbled order for reconstructed fields.
      a8092654
    • Andrew Heather's avatar
      Merge branch 'feature-runTimeCompat' into 'develop' · 38bf3016
      Andrew Heather authored
      long-term maintenance improvement for runTime selection tables
      
      See merge request !481
      38bf3016
    • Mark OLESEN's avatar
      ENH: use singleton method for accessing runtime selection · ba8d6bdd
      Mark OLESEN authored
      STYLE: use alias to mark partialFaceAreaWeightAMI deprecation after v2012
      ba8d6bdd
    • Mark OLESEN's avatar
      ENH: define singleton-style lookups for runTime selection, alias handling · 4fc6ec1d
      Mark OLESEN authored
      - this makes the lookup and use of tables slightly cleaner and
        provides a hook for update (compat) messages
      
        The singleton-style method returns the function pointer directly,
        or nullptr on not-found.
      
        NEW access method (mnemonic: 'ctor' prefix for constructors)
      
        ```
        auto* ctorPtr = dictionaryConstructorTable(modelType);
      
        if (!ctorPtr)
        {
            ...
        }
      
        return autoPtr<myModel>(ctorPtr(dict, ...));
        ```
      
        OLD method, which also still works, but without any compat handling:
      
        ```
        auto ctorIter = dictionaryConstructorTablePtr_->cfind(modelType);
      
        if (!ctorIter.found())
        {
            ...
        }
      
        return autoPtr<myModel>(ctorIter()(dict, ...));
        ```
      4fc6ec1d
    • Mark OLESEN's avatar
      ENH: add error::master() static for low-level messages · 794e23e0
      Mark OLESEN authored
      - a Pstream::master with a Pstream::parRun guard in case Pstream has
        not yet been initialised, as will be the case for low-level messages
        during startup.
      
      - propagate relativeName handling into IOstreams
      794e23e0
    • Mark OLESEN's avatar
      ENH: refactored and simplified runtime declaration macros · 0bd113f5
      Mark OLESEN authored
      - improves future maintenance, avoids code/macro duplication
      0bd113f5
    • Mark OLESEN's avatar
      ENH: rename runTime selection typedefs · 7f8ecd98
      Mark OLESEN authored
      - better distinction between content and storage type
        by appending 'Type' to the typedef.
      
          old: 'Class::abcConstructorTable* tablePtr'
          new: 'Class::abcConstructorTableType* tablePtr'
      
        Was rarely used in any exposed code.
      
      BREAKING: LESdelta::New with additional table
      
      - parameter change to dictionaryConstructorTableType
        (was dictionaryConstructorTable)
      7f8ecd98
    • Mark OLESEN's avatar
      ENH: improve isolation of basicThermo internals (as private) · 3416151d
      Mark OLESEN authored
      - getThermoOrDie: returns constructor pointer, or FatalError.
        Better isolation and avoids additional template/typename previously
        needed with ambiguous method name (lookupThermo).
      
      - makeThermoName: centralize dictionary -> stringified name
      
      - splitThermoName: use stringOps functionality
      3416151d
    • Mark OLESEN's avatar
      Merge branch 'feature-proudman-mean-fields' into 'develop' · 9e56dd40
      Mark OLESEN authored
      ENH: proudmanAcousticPower - extended to operate on mean turbulence fields
      
      See merge request !485
      9e56dd40
    • Andrew Heather's avatar
      ENH: proudmanAcousticPower - extended to operate on mean turbulence fields · 5cba2690
      Andrew Heather authored and Mark OLESEN's avatar Mark OLESEN committed
      Example using mean turbulence fields (mean fields should be available e.g. from
      a fieldAverage function object)
      
          proudmanAcousticPower1
          {
              // Mandatory entries (unmodifiable)
              type        proudmanAcousticPower;
              libs        (fieldFunctionObjects);
      
              ...
      
              // Turbulence field names (if not retrieved from the turb model)
              k           kMean;
              epsilon     epsilonMean;
              omega       none; // omegaMean
          }
      5cba2690
  2. Nov 04, 2021
  3. Nov 03, 2021
    • Mark OLESEN's avatar
      ENH: improve flexibility of error, messageStream output · c9333a5a
      Mark OLESEN authored
      - provide a plain stream() method on messageStream to reduce reliance
        on casting operators and slightly opaque operator()() calls etc
      
      - support alternative stream for messageStream serial output.
        This can be used to support local redirection of output.
        For example,
      
           refPtr<OFstream> logging;   // or autoPtr, unique_ptr etc
      
           // Later...
           Info.stream(logging.get())
              << "Detailed output ..." << endl;
      
        This will use the stdout semantics in the normal case, or allow
        redirection to an output file if a target output stream is defined,
        but still effectively use /dev/null on non-master processes.
      
        This is mostly the same as this ternary
      
            (logging ? *logging : Info())
      
        except that the ternary could be incorrect on sub-processes,
        requires more typing etc.
      
      ENH: use case-relative names of dictionary, IOstream for FatalIOError
      
      - normally yields more easily understandable information
      c9333a5a
    • Mark OLESEN's avatar
      ENH: expose dictionary relativeName() method · 1c354ce2
      Mark OLESEN authored
      STYLE: more consistent noexcept for dictionary and entry
      1c354ce2
    • Mark OLESEN's avatar
      ENH: argList improvements · b364a9e7
      Mark OLESEN authored
      - argList::envExecutable() static method.
        This is identical to getEnv("FOAM_EXECUTABLE"), where the name of
        the executable has typically been set from the argList construction.
      
        Provides a singleton access to this value from locations that
        do not have knowledge of the originating command args (argList).
        This is a similar rationale as for the argList::envGlobalPath() static.
      
      - additional argList::envRelativePath() static method.
      
      - make -dry-run handling more central and easier to use by adding into
        argList itself.
      
      STYLE: drop handling of -srcDoc (v1706 option)
      
      - replaced with -doc-source for 1712 and never used much anyhow
      b364a9e7
    • Mark OLESEN's avatar
      STYLE: additional storage checks, noexcept, spelling · a19f03a5
      Mark OLESEN authored
      - prune unneeded demandDrivenData.H includes
      a19f03a5
  4. Nov 02, 2021
  5. Oct 29, 2021
    • Mark OLESEN's avatar
      CONFIG: increment API level to 2108 · 08e66a64
      Mark OLESEN authored
      - reflects updates for List, globalIndex handling etc
      08e66a64
    • Mark OLESEN's avatar
    • Mark OLESEN's avatar
      ENH: add fallback behaviour for distanceSurface proximity regions (#1631) · 0c891547
      Mark OLESEN authored
      - using the proximityRegions filter when there is no enclosing surface
        to segregate domains causes a surface of zero-faces to be created.
      
        In most cases, this means that a simpler proximityFaces filter would
        have been more appropriate. To increase overall robustness, revert
        to the simpler proximityFaces filter logic when the proximityRegions
        would otherwise result in zero faces (globally seen).
      0c891547
    • Mark OLESEN's avatar
      ENH: reduces buffer use / blocking in Ensight output · 048166c3
      Mark OLESEN authored
      - reuse single component buffer within an Ensight output method.
        Use direct UPstream read/write to avoid Pstream char buffers
      
      - replace blocking transfer with scheduled for Ensight cloud output
      048166c3
    • Mark OLESEN's avatar
      ENH: replace PstreamBuffers with scheduled read/writes for VTK output · 33ff3201
      Mark OLESEN authored
      - use the new updates to globalIndex to manage the bookkeeping
      33ff3201
    • Mark OLESEN's avatar
      ENH: additional MPI gather/scatter routines, globalIndex gather methods · b6539cd0
      Mark OLESEN authored
      - UPstream::mpiGather (MPI_Gather)   - used by Pstream::listGatherValues
      - UPstream::mpiScatter (MPI_Scatter) - used by Pstream::listScatterValues
      
        These are much simpler forms for gather/scatter of fixed-sized
        contiguous types data types (eg, primitives, simple pairs etc).
      
        In the gather form, creates a list of gathered values on the master
        process. The subranks have a list size of zero.
      
        Similarly, scatter will distribute a list of values to single values
        on each process.
      
        Instead of
      
            labelList sendSizes(Pstream::nProcs());
            sendSizes[Pstream::myProcNo()] = sendData.size();
            Pstream::gatherList(sendSizes);
      
        Can write
      
            const labelList sendSizes
            (
                UPstream::listGatherValues<label>(sendData.size())
            );
      
        // Less code, lower overhead and list can be const.
      
        For scattering an individual value only,
        instead of
      
            labelList someValues;
            if (Pstream::master()) someValues = ...;
      
            Pstream::gatherList(sendSizes);
            const label localValue
            (
                someValues[Pstream::myProcNo()]
            );
      
        Can write
      
            labelList someValues;
            if (Pstream::master()) someValues = ...;
      
            Pstream::gatherList(sendSizes);
            const label localValue
            (
                UPstream::listScatterValues<label>(someValues)
            );
      
         Can of course also mix listGatherValues to assemble a list on master
         and use Pstream::scatterList to distribute.
      
      ENH: adjusted globalIndex gather methods
      
      - added mpiGather() method [contiguous data only] using MPI_Gatherv
      
      - respect localSize if gathering master data to ensure that a
        request for 0 master elements is properly handled.
      b6539cd0
    • Mark OLESEN's avatar
      ENH: cleanup Pstream internal names, cull unneeded parameters · 1f20747b
      Mark OLESEN authored
      - Pstreams can be ascii/binary but are always currentVersion
      
      - rename UIPstream externalBuf_ to 'recvBuf_' for similar naming as
        PstreamBuffers and symmetry with UOPstream::sendBuf_
      
      - specific enum size for commsType (for more compact structures in the
        future). Default construct lists items.
      
      BUG: possible incidental indexing in UIPstream::read(char*, std::streamsize)
      
      - raw reading had been split into beginRawRead(), readRaw().
        However, this could change the current input position (due to word
        boundary alignment), even if the expected count is zero. Make a
        no-op for count == 0. This mirrors UOPstream::write behaviour.
      1f20747b
    • Mark OLESEN's avatar
      ENH: improve flexibilty of globalIndex · 609fb366
      Mark OLESEN authored
      - construct or reset from a list of local sizes. It is generally
        easier and safer to assemble sizes and let globalIndex determine the
        corresponding offsets, when working with raw values.
      
      - Can use reset() from sizes or fine-tune offsets with setLocalSize()
        instead of using the potentially more fragile non-const access to
        the offsets.
      
      - add globalIndex const_iterator to iterate across the access ranges.
        This is makes it simpler to use with the List slice() method to
        access or operate on a sub-section of list.
      
        For example,
            scalarField allValues = ...;
            globalIndex procAccess = ...;
      
            for (const labelRange& range : procAccess)
            {
                someOutput(allValues.slice(range));
            }
      609fb366
    • Mark OLESEN's avatar
      ENH: additional 'nocopy' methods for List resize/reserve methods · b8a4b7e8
      Mark OLESEN authored
      - the size of a List often requires adjustment prior to an operation,
        but old values (if any) are not of interest and will be overwritten.
      
        In these cases can use the _nocopy versions to avoid additional memory
        overhead of the intermediate list and the copy/move overhead of
        retaining the old values (that we will subsequently discard anyhow).
      
        No equivalent for PtrList/UPtrList - this would be too fragile.
      
      - add swap DynamicField with DynamicList
      
      BUG: fixed Dynamic{Field,List} setCapacity corner case
      
      - for the case when the newly requested capacity coincides with the
        current addressable size, the resize of the underlying list would have
        been bypassed - ie, the real capacity was not actually changed.
      
      - remove (unused) PtrDynList setCapacity method as too fragile
      b8a4b7e8
    • Mark OLESEN's avatar
      ENH: return UList range slice as a SubList · e2861cc2
      Mark OLESEN authored
      - previously returned the range slice as a UList,
        but this prevents convenient assignment.
        Apply similar handling for Field/SubField
      
        Allows the following
      
           labelRange range(...);
           fullList.slice(range) = identity(range.size());
      
        and
      
           fullList.slice(range) = UIndirectList<T>(other, addr);
      
      ENH: create SubList from full FixedList (simplifies interface)
      
      - allow default constructed SubList. Use shallowCopy to 'reset' later
      e2861cc2
    • Mark OLESEN's avatar
      ENH: add '_bytes()' versions of List data(), cdata() · 3781f17e
      Mark OLESEN authored
      - simply adds in the reinterpret_cast, which simplifies coding for
        binary data movement.
        Name complements the size_bytes() method for contiguous data
      
      STYLE: container IO.C files into main headers for better visibility
      
      STYLE: include CompactListList.H in polyTopoChange
      
      - avoids future mismatches if the CompactListList template signature
        changes
      
      GIT: relocate CompactListList into CompactLists/ directory
      3781f17e
    • Mark OLESEN's avatar
      ENH: additional tests in {cell,face}SetOption · 3d3d2874
      Mark OLESEN authored
      - useSubMesh() - name as per fvMeshSubsetProxy.
        Setter methods take a parameter instead of direct access.
      3d3d2874