Skip to content
Snippets Groups Projects
  1. Apr 29, 2022
  2. Apr 28, 2022
    • Mark OLESEN's avatar
      ENH: additional Field normalise method (#2444) · 8e6f2ca5
      Mark OLESEN authored
      - for most field types this is a no-op, but for a field of floatVector
        or doubleVector (eg, vector and solveVector) it will normalise each
        element with divide-by-zero protection.
      
        More reliable and efficient than dividing a field by the mag of itself
        (even with VSMALL protection).
        Applied to FieldField and GeometricField as well.
      
        Eg,
            fld.normalise();
        vs.
            fld /= mag(fld) + VSMALL;
      
      ENH: support optional tolerance for vector::normalise
      
      - for cases where tolerances larger than ROOTVSMALL are preferable.
        Not currently available for the field method (a templating question).
      
      ENH: vector::removeCollinear method
      
      - when working with geometries it is frequently necessary to have a
        normal vector without any collinear components. The removeCollinear
        method provides for clearer, compacter code.
      
        Eg,
            vector edgeNorm = ...;
      
            const vector edgeDirn = e.unitVec(points());
      
            edgeNorm.removeCollinear(edgeDirn);
            edgeNorm.normalise();
      
        vs.
            vector edgeNorm = ...;
      
            const vector edgeDirn = e.unitVec(points());
      
            edgeNorm -= edgeDirn*(edgeDirn & edgeNorm);
            edgeNorm /= mag(edgeNorm);
      8e6f2ca5
    • Mark OLESEN's avatar
      ENH: additional BitOps::toc, BitOps::sortedToc · b59a5b11
      Mark OLESEN authored
      - for obtaining set entries from a boolList
      
      - BitOps::select to mirror bitSet constructor but returning a boolList
      
      - BitOps::set/unset for boolList
      
      ENH: construct bitSet from a labelRange
      
      - useful, for example, when marking up patch slices
      
      ENH: ListOps methods
      
      - ListOps::count_if to mirror std::count_if but with list indexing.
      - ListOps::find_if to mirror std::find_if but with list indexing.
      
      ENH: UPtrList::test() method.
      
      - includes bounds checks, which means it can be used in more places
        (eg, even if the storage is empty).
      b59a5b11
  3. Apr 25, 2022
  4. Apr 22, 2022
  5. Apr 19, 2022
  6. Apr 14, 2022