Commit Graph

10 Commits

Author SHA1 Message Date
Mark Olesen
d6d28ccfa2 ENH: make sliceRange modifiable - similar to labelRange 2023-11-18 17:25:22 +01:00
Mark Olesen
117173aaba ENH: use min/max instead of first/last for int/slice ranges
- consistent with MinMax tuple etc.
- cull unused before(), after() methods
2023-02-27 15:41:25 +01:00
Mark Olesen
56c9134ccc ENH: add identity(IntRange) and Istream operator for common types
- provides consistency with identity(label, label) and looks more
  familiar than using labelRange::labels()

- relocates labelRange IO operators to IntRange

ENH: make sliceRange interators random access

STYLE: scalarRanges::match() instead of predicate operator
2020-10-01 11:35:43 +02:00
Mark Olesen
413ccd5ce3 STYLE: adjust tests and one code instance for updated labelRange 2020-09-23 10:46:04 +02:00
Mark Olesen
d204d33c4e ENH: new IntRange class, enhancements to labelRange, sliceRange
- add reverse iterators and replace std::iterator
  (deprecated in C++17) with full definitions

- simplify construction of iterators

- construct labelRange from a single single parameter.
  This creates a (0,len) range.

- make basic constructors forms constexpr.
  Remove unused size checks.

- Derive labelRange from new IntRange template class.
  Allows reuse of base functionality with different integral sizes.

Deprecations:

  - deprecate labelRange::valid() in favour of using
    labelRange::empty() or the bool operator.
    For example,

        if (range) ...  vs older  if (range.valid()) ...

DEFEATURE: drop labelRange::null, scalarRange::null static variables

- turned out to be not particularly useful.
  Can simply use constexpr contructor forms

DEFEATURE: drop labelRange::identity static method

- simply use the single-parameter constructor
2020-09-23 10:45:57 +02:00
Mark Olesen
822d052e32 ENH: added IndirectSubList
- provides an indirect access to a sub-section of a list that is
  somewhat less efficient than a Foam::SubList, but supports the
  following:
    * adjustment of its addressing range after construction
    * recovery of the original, underlying list at any time

  This can be more convenient for some coding cases.
  For example,

      template<class Addr>
      void renumberFaces(IndirectListBase<face, Addr>& faces, ...);

  which can be called for

      * Specific faces:
        UIndirectList<face>(mesh.faces(), facesToChange)

      * A sub-range of faces:
        IndirectSubList<face>(mesh.faces(), pp.range())

      * All faces:
        IndirectSubList<face>(mesh.faces())

CONFIG: added IndirectListsFwd.H with some common forwarding
2020-01-31 17:01:22 +01:00
OpenFOAM bot
e9219558d7 GIT: Header file updates 2019-10-31 14:48:44 +00:00
mattijs
912009c458 ENH: overset: insert remote interpolation into lduMatrix
All remote contributions to interpolation stencils now
get added as 'processor' type lduInterfaces. This guarantees
a consistent matrix, e.g. initial residual is normalised to 1.

Second change is the normalisation of the interpolation discretisation
which uses the diagonal from the unmodified equation. This helps
GAMG.
2019-05-02 16:49:48 +01:00
Mark Olesen
765493b69f ENH: generalize indirect lists and support new types
- use an IndirectListBase class for various indirect list types.

- new SortList type

  In some places the SortList can be used as a lightweight alternative
  to SortableList to have the convenience of bundling data and sort
  indices together, but while operating on existing data lists.
  In other situations, it can be useful as an alternative to
  sortedOrder.  For example,

        pointField points = ...;

        labelList order;
        sortedOrder(points, order);

        forAll(order, i)
        {
            points[order[i]] = ...;
        }

   Can be replaced with the following (with the same memory overhead)

        pointField points = ...;

        SortList<point> sortedPoints(points);

        for (point& pt : sortedPoints)
        {
            pt = ...;
        }

- new SliceList type (#1220), which can be used for stride-based
  addressing into existing lists
2019-04-11 15:24:33 +02:00
Mark Olesen
d4eb17a9ff ENH: new sliceRange class
- this is somewhat like labelRange, but with a stride.
  Can be used to define slices (of lists, fields, ..) or as a range specifier
  for a for-loop. For example,

      for (label i : sliceRange(0, 10, 3))
      {
          ...
      }
2019-04-06 15:07:53 +02:00