Skip to content
Snippets Groups Projects
  1. Mar 23, 2023
    • Mark OLESEN's avatar
      ENH: support construct Geometric field from separate value/dimensions · 80a416d2
      Mark OLESEN authored
      - can be easier to specify than copying into a dimensioned type.
      
        Eg,
            volSymmTensorField(io, mesh, Zero, dimLength);
      
            fluxFieldType
            (
                io
                mesh,
                Zero,
                Uf.dimensions()*dimArea/dimTime
            );
      
        vs
            volSymmTensorField
            (
                io,
                mesh,
                dimensionedSymmTensor("0", dimLength, Zero)
            );
      
            fluxFieldType
            (
                io
                mesh,
                dimensioned<typename flux<Type>::type>
                (
                    Uf.dimensions()*dimArea/dimTime, Zero
                )
            );
      80a416d2
    • Mark OLESEN's avatar
      STYLE: check tmp with is_reference() or movable(), instead of isTmp() · e68acbe3
      Mark OLESEN authored
      - missed consistency in a few places.
      
      - return nullptr (with automatic conversion to tmp) on failures
        instead of tmp<....>(nullptr), for cleaner coding.
      
      INT: add support for an 'immovable' tmp pointer
      
      - this idea is from openfoam.org, to allow creation of a tmp that is
        protected from having its memory reclaimed in field operations
      
      ENH: tmp NewImmovable factory method, forwards as immovable/movable
      e68acbe3
  2. Mar 22, 2023
  3. Mar 16, 2023
    • mattijs's avatar
      ENH: initEvaluate()/evaluate() for faePatchField, fvsPatchField · 34e36b83
      mattijs authored and Mark OLESEN's avatar Mark OLESEN committed
      - no-op implementations, but makes the call to
        GeometricBoundaryField::evaluate() less dependent on PatchField type
      
      - add updated()/manipulatedMatrix() methods to faePatchField,
        fvsPatchField etc. These are mostly no-ops, but provide name
        compatible with fvPatchField etc.
      34e36b83
  4. Mar 10, 2023
  5. Mar 09, 2023
    • Mark OLESEN's avatar
      ENH: provide getter/setter interface to standard communicators · 20566a87
      Mark OLESEN authored
      - similar to UPstream::parRun(), the setter returns the previous value.
      
        The accessors are prefixed with 'comm':
        Eg, commGlobal(), commWarn(), commWorld(), commSelf().
        This distinguishes them from any existing variables (eg, worldComm)
        and arguably more similar to MPI_COMM_WORLD etc...
      
        If demand-driven communicators are added in the future, the function
        call syntax can help encapsulate that.
      
        Previously:
      
            const label oldWarnComm = UPstream::warnComm;
            const label oldWorldComm = UPstream::worldComm;
            UPstream::warnComm = myComm;
            UPstream::worldComm = myComm;
            ...
      
            UPstream::warnComm = oldWarnComm;
            UPstream::worldComm = oldWorldComm;
      
        Now:
            const label oldWarnComm = UPstream::commWarn(myComm);
            const label oldWorldComm = UPstream::commWorld(myComm);
            ...
      
            UPstream::commWarn(oldWarnComm);
            UPstream::commWorld(oldWorldComm);
      
      STYLE: check (warnComm >= 0) instead of (warnComm != -1)
      20566a87
    • Mark OLESEN's avatar
      06df44a5
  6. Mar 08, 2023
  7. Mar 07, 2023
  8. Mar 03, 2023
  9. Mar 02, 2023
  10. Feb 28, 2023
    • Mark OLESEN's avatar
      ENH: add factory method readContents to IO containers · f75af788
      Mark OLESEN authored
      - useful when regular contents are to be read via an IOobject and
        returned.
      
        Eg,  dictionary propsDict(IOdictionary::readContents(dictIO));
        vs.  dictionary propsDict(static_cast<dictionary&&>(IOdictionary(dictIO)));
      
        Commonly these would have simply been constructed directly as the
        IO container:
      
        eg,  IOdictionary propsDict(dictIO);
      
        However, that style may not ensure proper move semantics for return
        types.
      
        Now,
        =====
            labelList decomp(labelIOList::readContents(io));
            ... something
            return decomp;
        =====
      
        Previously,
        =====
            labelIOList decomp(io);
      
            // Hope for the best...
            return decomp;
      
            // Or be explicit and ensure elision occurs...
            return labelList(std::move(static_cast<labelList&>(decomp)));
        =====
      
        Note:
             labelList list(labelIOList(io));
      
             looks like a good idea, but generally fails to compile
      f75af788
    • Mark OLESEN's avatar
      ENH: range-for and updated accessors in primitiveMesh · 790a5c26
      Mark OLESEN authored
      STYLE: split off primitiveMesh::calcCellPoints internal
      
      - for easier reworking (#2715)
      790a5c26
  11. Feb 27, 2023