Skip to content
Snippets Groups Projects
  1. Nov 03, 2022
  2. Nov 01, 2022
  3. Oct 31, 2022
    • Mark OLESEN's avatar
      ENH: expose IntRange {begin,end}_value() methods · 2202995f
      Mark OLESEN authored
      - end_value() corresponds to the infrequently used after() method, but
        with naming that corresponds better to iterator naming conventions.
      
        Eg,
      
           List<Type> list = ...;
           labelRange range = ...;
      
           std::transform
           (
               (list.data() + range.begin_value()),
               (list.data() + range.end_value()),
      
               outIter,
               op
           );
      
      - promote min()/max() methods from labelRange to IntRange base class
      
      STYLE: change timeSelector from "is-a" to "has-a" scalarRanges.
      2202995f
    • Mark OLESEN's avatar
      ENH: single/double value reset method for MinMax · 21f037e3
      Mark OLESEN authored
      - resets min/max to be identical to the specified value,
        which can be more convenient (and slightly more efficient) than doing
        a full reset followed by add()
      
      - additional MinMax intersects() query, which works like overlaps()
        but with exclusive checks at the ends
      
      - provide MinMax::operator&=() to replace (unused) intersect() method
      
      ENH: single/double value reset method for boundBox
      
      - boundBox::operator&=() to replace (rarely used) intersect() method.
        Deprecate boundBox::intersect() to avoid confusion with various
        intersects() method
      
      COMP: provide triangleFwd.H
      21f037e3
    • Mark OLESEN's avatar
      ENH: supplementary vector comparison methods · c9730666
      Mark OLESEN authored
      - background: for some application it can be useful to have fully
        sorted points. i.e., sorted by x, followed by y, followed by z.
      
        The default VectorSpace 'operator<' compares *all*
        components. This is seen by the following comparisons
      
        1.  a = (-2.2 -3.3 -4.4)
            b = (-1.1 -2.2 3.3)
      
            (a < b) : True
            Each 'a' component is less than each 'b' component
      
        2.  a = (-2.2 -3.3 -4.4)
            b = (-2.2 3.3 4.4)
      
            (a < b) : False
            The a.x() is not less than b.x()
      
        The static definitions 'less_xyz', 'less_yzx', 'less_zxy'
        instead use comparison of the next components as tie breakers
        (like a lexicographic sort).
        - same type of definition that Pair and Tuple2 use.
      
            a = (-2.2 -3.3 -4.4)
            b = (-2.2 3.3 4.4)
      
            vector::less_xyz(a, b) : True
            The a.x() == b.x(), but a.y() < b.y()
      
         They can be used directly as comparators:
      
            pointField points = ...;
      
            std::sort(points.begin(), points.end(), vector::less_zxy...
      c9730666
    • Mark OLESEN's avatar
      ENH: bounding sphere calculation for PrimitivePatch face · 37179584
      Mark OLESEN authored
      - useful when a characteristic per-face search dimension is required.
        With PrimitivePatch we are certain to have consistent evaluations
        of the face centre.
      
      STYLE: tag PrimitivePatch compatibility headers as such
      37179584
    • Mark OLESEN's avatar
      ENH: component/element access for zero/one return themselves · 7a43cac5
      Mark OLESEN authored
      STYLE: more consistent access for uniform list/fields
      7a43cac5
    • Mark OLESEN's avatar
      ENH: support construction of pointIndexHit from pointHit · 94338989
      Mark OLESEN authored
      STYLE: combine templated/non-templated headers (reduced clutter)
      
      STYLE: use hitPoint(const point&) combined setter
      
      - same as setHit() + setPoint(const point&)
      
      ENH: expose and use labelOctBits::pack method for addressing
      94338989
    • Mark OLESEN's avatar
      STYLE: expand use of ListLoop macros (#2624) · 454f7960
      Mark OLESEN authored
      - the old List_FOR_ALL macro only remained in use in relatively few
        places. Replace with the expanded equivalent and move the looping
        parameter out of the macro and give an explicit name (eg, loopLen)
        which simplifies the addition of any loop pragmas in the various
        TFOR_ALL... macros (for example).
      454f7960
    • Mark OLESEN's avatar
      ENH: support optional average value when reading rawIOField · 9db3547b
      Mark OLESEN authored
      ENH: simplify bookkeeping within MappedFile
      9db3547b
    • Mark OLESEN's avatar
      ENH: add syncState() method to serial streams (#2623) · 27837803
      Mark OLESEN authored
      - in places where direct reading from the std::stream is used,
        this method can be used to ensure that the OpenFOAM Sstream state
        is properly updated from the std::stream.
      
      ENH: restrict stream renaming to ISstream
      
      - non-const access was previously declared at the top-level (IOstream)
        but that not only added in potentially odd setting of the static
        fileName, but also meant that the OFstream name() could potentially
        be altered after opening a file and thus be inconsistent with the
        underlying file that had been opened.
      
        Now restrict name modification to ISstream (and ITstream
        counterpart). Does not affect any existing valid code.
      
      STYLE: non-default OFstream destructor (for future file staging)
      27837803
  4. Oct 27, 2022
  5. Oct 26, 2022
  6. Oct 20, 2022
  7. Oct 18, 2022
  8. Oct 13, 2022
  9. Oct 12, 2022
    • Mark OLESEN's avatar
    • Mark OLESEN's avatar
      COMP: fix bad constructor resolution · 4585a2d2
      Mark OLESEN authored
      STYLE: simpler initialization
      4585a2d2
    • Mark OLESEN's avatar
      18eeba11
    • Mark OLESEN's avatar
      ENH: boundBox improvements (#2609) · 61deacd2
      Mark OLESEN authored
      - construct boundBox from Pair<point> of min/max limits,
        make sortable
      
      - additional bounding box intersections (linePointRef), add noexcept
      
      - templated access for boundBox hex-corners
        (used to avoid temporary point field).
        Eg, unrolled plane/bound-box intersection with early exit
      
      - bounding box grow() to expand box by absolute amounts
        Eg,
      
            bb.grow(ROOTVSMALL);   // Or: bb.grow(point::uniform(ROOTVSMALL));
        vs
            bb.min() -= point::uniform(ROOTVSMALL);
            bb.max() += point::uniform(ROOTVSMALL);
      
      - treeBoundBox bounding box extend with two or three parameters.
        The three parameter version includes grow(...) for reduced writing.
        Eg,
      
            bb = bb.extend(rndGen, 1e-4, ROOTVSMALL);
      
        vs
            bb = bb.extend(rndGen, 1e-4);
            bb.min() -= point::uniform(ROOTVSMALL);
            bb.max() += point::uniform(ROOTVSMALL);
      
        This also permits use as const variables or parameter passing.
        Eg,
      
            const treeBoundBox bb
            (
                treeBoundBox(some_points).extend(rndGen, 1e-4, ROOTVSMALL)
            );
      61deacd2
    • Mark OLESEN's avatar
      ENH: provide low-level bound box() methods for meshShapes · 81b1c502
      Mark OLESEN authored
      - box method on meshShapes (cell,edge,face,triangle,...)
        returns a Pair<point>.
      
        Can be used directly without dependency on boundBox,
        but the limits can also passed through to boundBox.
      
      - Direct box calculation for cell, which walks the cell-faces and
        mesh-faces.  Direct calculation for face (#2609)
      81b1c502
  10. Oct 11, 2022
    • Mark OLESEN's avatar
      ENH: support direct calculation of finiteArea edgeNormals (#2592) · 96ff2f32
      Mark OLESEN authored
      - with geometryOrder=1, calculate the edge normals from the adjacent
        faces (area-weighted, inverse distance squared) and also
        use that for the Le() calculation.
      
        Includes the contributions from processor edge neighbours, so it
        should be consistent on both sides.
      
        This new method (consider as 'beta') contrasts with the current
        standard method that first calculates area-weighted point normals
        and uses the average of them for the edge normal.
      
        Enable for testing either with a controlDict OptimisationSwitch entry
        "fa:geometryOrder", or on the command-line:
      
            solverName -opt-switch=fa:geometryOrder=1
      96ff2f32
    • Mark OLESEN's avatar
      ENH: use fallback value if calculated Le() is degenerate (#2592) · 94349722
      Mark OLESEN authored
      - the Le vector is calculated from (edgeVec ^ edgeNorm)
        and should be oriented in direction (faceCentre -> edgeCentre).
      
        If, however, the edgeNorm value is bad for any reason, the
        cross-product falls apart and Le vector is calculated as a zero
        vector!
      
        For these cases, revert to using (faceCentre -> edgeCentre)
        as a better approximation than a zero vector.
      
        In the future, will very likely switch calculating the edge normals
        directly from the attached faces, instead of from the attached
        points as is currently done, which should improve robustness.
      
      ENH: expose fa:geometryOrder as a registered OptimisationSwitch
      
      ENN: reuse polyMesh data (eg, faceCentres) if possible in faMesh
      
      STYLE: add code lambdas and static functions to isolate logic
      94349722
    • Mark OLESEN's avatar
      BUG: processorMeshes removeFiles does not remove collated (fixes #2607) · d5cdc60a
      Mark OLESEN authored
      ENH: extend rmDir to handle removal of empty directories only
      
      - recursively remove directories that only contain other directories
        but no other contents. Treats dead links as non-content.
      d5cdc60a
    • Mark OLESEN's avatar
      ENH: adjust fileName methods for similarity to std::filesystem::path · 779a2ca0
      Mark OLESEN authored
      - stem(), replace_name(), replace_ext(), remove_ext() etc
      
      - string::contains() method - similar to C++23 method
      
        Eg,
            if (keyword.contains('/')) ...
        vs
            if (keyword.find('/') != std::string::npos) ...
      779a2ca0
    • Mark OLESEN's avatar
      GIT: relocate treeDataEdge, treeDataPoint into OpenFOAM · 98a510c3
      Mark OLESEN authored
      - similar to treeDataCell, doesn't need any meshTools components
      - AABBTree under algorithms (like indexedOctree)
      98a510c3
  11. Oct 06, 2022
  12. Oct 05, 2022
  13. Oct 04, 2022
    • Mark OLESEN's avatar
      ENH: add debug surfaceWriter · a246a97b
      Mark OLESEN authored
      - enables special purpose debugging.
        Its definition and behaviour are subject to change at any time.
      a246a97b
    • Mark OLESEN's avatar
      ENH: improved handling of coordinateSystems · 7b2bcfda
      Mark OLESEN authored
      - in continuation of #2565 (rotationCentre for surface output formats)
        it is helpful to also support READ_IF_PRESENT behaviour for the
        'origin' keyword.
      
        This can be safely used wherever the coordinate system definition
        is embedded within a sub-dictionary scope.
      
        Eg,
            dict1
            {
                coordinateSystem
                {
                    origin (0 0 0);  // now optional here
                    rotation ...;
                }
            }
      
         but remains mandatory if constructed without a sub-dict:
      
            dict2
            {
                origin (0 0 0);   // still mandatory
                e1  (1 0 0);
                e3  (0 0 1);
            }
      
         With this change, the "transform" sub-dictionary can written
         more naturally:
      
             formatOptions
             {
                 vtk
                 {
                     scale 1000;  // m -> mm
                     transform
                     {
                         rotationCentre  (1 0 0);
                         rotation axisAngle;
                         axis    (0 0 1);
                         angle   -45;
                     }
                 }
             }
      
      ENH: simplify handling of "coordinateSystem" dictionary lookups
      
      - coordinateSystems::NewIfPresent method for optional entries:
      
          coordSysPtr_ = coordinateSystem::NewIfPresent(mesh, dict);
      
        Instead of
      
          if (dict.found(coordinateSystem::typeName, keyType::LITERAL))
          {
              coordSysPtr_ =
                  coordinateSystem::New
                  (
                      mesh_,
                      dict,
                      coordinateSystem::typeName
                  );
          }
          else
          {
              coordSysPtr_.reset();
          }
      
      ENH: more consistent handling of priorities for binModels, forces (#2598)
      
      - if the dictionaries are overspecified, give a 'coordinateSystem'
        entry a higher prioriy than the 'CofR' shortcuts.
      
        Was previously slightly inconsistent between the different models.
      7b2bcfda