1. 31 Jan, 2019 1 commit
  2. 21 Jan, 2019 1 commit
  3. 09 Jan, 2019 2 commits
  4. 07 Jan, 2019 3 commits
    • Mark Olesen's avatar
      STYLE: deprecate hashedWordList contains() method · 561710f0
      Mark Olesen authored
      - identical to found(), which should be used for more consistency.
        The contains() is a remnant from when hashedWordList was generalized
        from a speciesTable (OCT 2010)
      561710f0
    • Mark Olesen's avatar
      ENH: additional read guards for dimensionedType. input consistency (#762, #1148) · 9a5038a8
      Mark Olesen authored
      - provide a lookupOrDefault constructor form, since this is a fairly
        commonly used requirement and simplifies the calling sequence.
      
        Before
      
            dimensionedScalar rhoMax
            (
                dimensionedScalar::lookupOrDefault
                (
                    "rhoMax",
                    pimple.dict(),
                    dimDensity,
                    GREAT
                )
           );
      
        After
      
            dimensionedScalar rhoMax("rhoMax", dimDensity, GREAT, pimple.dict());
      
      - read, readIfPresent methods with alternative lookup names.
      
      - Mark the Istream related constructors with compile-time deprecated
        warnings.
      
      BUG: read, readIfPresent methods not handling optional dimensions (#1148)
      9a5038a8
    • Mark Olesen's avatar
      ENH: add guarded lookup for dimensionedSet · 7af06a83
      Mark Olesen authored
      STYLE: use standard dimensionedSets
      7af06a83
  5. 21 Dec, 2018 1 commit
    • Mark Olesen's avatar
      ENH: use Zero when zero-initializing types · e23bd3bb
      Mark Olesen authored
      - makes the intent clearer and avoids the need for additional
        constructor casting. Eg,
      
            labelList(10, Zero)    vs.  labelList(10, 0)
            scalarField(10, Zero)  vs.  scalarField(10, scalar(0))
            vectorField(10, Zero)  vs.  vectorField(10, vector::zero)
      e23bd3bb
  6. 13 Dec, 2018 1 commit
    • Mark Olesen's avatar
      ENH: consolidate handling of mandatory/optional command arguments · 4aeb97b5
      Mark Olesen authored
      - for some special cases we wish to mark command-line arguments as
        being optional, in order to do our own treatment. For example,
        when an arbitrary number of arguments should be allowed.
      
        Now tag this situation with argList::noMandatoryArgs().
        The argList::argsMandatory() query can then be used in any further
        logic, including the standard default argument checking.
      
      - with the new default check, can consolidate the special-purpose
      
            "setRootCaseNonMandatoryArgs.H"
      
        into the regular
      
            "setRootCase.H"
      
      - revert to a simple "setRootCase.H" and move all the listing related
        bits to a "setRootCaseLists.H" file. This leaves the information
        available for solvers, or whoever else wishes, without being
        introduced everywhere.
      
      - add include guards and scoping to the listing files and rename to
        something less generic.
      
           listOptions.H -> setRootCaseListOptions.H
           listOutput.H  -> setRootCaseListOutput.H
      4aeb97b5
  7. 11 Dec, 2018 1 commit
  8. 26 Nov, 2018 1 commit
  9. 19 Oct, 2018 3 commits
    • Mark Olesen's avatar
      STYLE: use range-for when looping dictionary entries. · 28b3ae77
      Mark Olesen authored
      - as part of the cleanup of dictionary access methods (489b778b)
        made the dictionary class single inheritance from IDLList<entry>.
      
        This eliminates any ambiguities for iterators and allows
        for simple use of range-for looping.
      
        Eg,
            for (const entry& e : topDict))
            {
                Info<< "entry:" << e.keyword() << " is dict:" << e.isDict() << nl;
            }
      
         vs
      
            forAllConstIter(dictionary, topDict, iter))
            {
                Info<< "entry:" << iter().keyword()
                    << " is dict:" << iter().isDict() << nl;
            }
      28b3ae77
    • Mark Olesen's avatar
    • Mark Olesen's avatar
      ENH: cleanup of Enum class · 9fd7e9fc
      Mark Olesen authored
      - more dictionary-like methods, enforce keyType::LITERAL for all
        lookups to avoid any spurious keyword matching.
      
      - new readEntry, readIfPresent methods
      
      - The get() method replaces the now deprecate lookup() method.
      
      - Deprecate lookupOrFailsafe()
        Failsafe behaviour is now an optional parameter for lookupOrDefault,
        which makes it easier to tailor behaviour at runtime.
      
      - output of the names is now always flatted without line-breaks.
        Thus,
      
           os << flatOutput(someEnumNames.names()) << nl;
           os << someEnumNames << nl;
      
        both generate the same output.
      
      - Constructor now uses C-string (const char*) directly instead of
        Foam::word in its initializer_list.
      
      - Remove special enum + initializer_list constructor form since
        it can create unbounded lookup indices.
      
      - Removd old hasEnum, hasName forms that were provided during initial
        transition from NamedEnum.
      
      - Added static_assert on Enum contents to restrict to enum or
        integral values.  Should not likely be using ...
      9fd7e9fc
  10. 17 Oct, 2018 1 commit
    • Mark Olesen's avatar
      ENH: simplify objectRegistry access names (issue #322) · 3a3e954b
      Mark Olesen authored
        New name:  findObject(), cfindObject()
        Old name:  lookupObjectPtr()
      
            Return a const pointer or nullptr on failure.
      
        New name:  findObject()
        Old name:  --
      
            Return a non-const pointer or nullptr on failure.
      
        New name:  getObjectPtr()
        Old name:  lookupObjectRefPtr()
      
            Return a non-const pointer or nullptr on failure.
            Can be called on a const object and it will perform a
            const_cast.
      
      - use these updated names and functionality in more places
      
      NB: The older methods names are deprecated, but continue to be defined.
      3a3e954b
  11. 12 Oct, 2018 1 commit
    • Mark Olesen's avatar
      ENH: avoid readScalar, readLabel etc from dictionary (#762, #1033) · efe02691
      Mark Olesen authored
      - use the dictionary 'get' methods instead of readScalar for
        additional checking
      
           Unchecked:  readScalar(dict.lookup("key"));
           Checked:    dict.get<scalar>("key");
      
      - In templated classes that also inherit from a dictionary, an additional
        'template' keyword will be required. Eg,
      
           this->coeffsDict().template get<scalar>("key");
      
        For this common use case, the predefined getXXX shortcuts may be
        useful. Eg,
      
           this->coeffsDict().getScalar("key");
      efe02691
  12. 05 Oct, 2018 1 commit
    • Mark Olesen's avatar
      ENH: use dictionary::readEntry for detection of input errors (#762, #1033) · 392ef54c
      Mark Olesen authored
      - instead of   dict.lookup(name) >> val;
        can use      dict.readEntry(name, val);
      
        for checking of input token sizes.
        This helps catch certain types of input errors:
      
        {
      
            key1 ;                // <- Missing value
            key2 1234             // <- Missing ';' terminator
            key3 val;
        }
      
      STYLE: readIfPresent() instead of 'if found ...' in a few more places.
      392ef54c
  13. 24 Jul, 2018 1 commit
  14. 05 Jul, 2018 1 commit
    • Mark Olesen's avatar
      ENH: improve controls for Time (issue #910) · 1fe7a4f5
      Mark Olesen authored
      - relocate some standard functionality to TimePaths to allow a lighter
        means of managing time directories without using the entire Time
        mechanism.
      
      - optional enableLibs for Time construction (default is on)
        and a corresponding argList::noLibs() and "-no-libs" option
      
      STYLE:
      
      - mark Time::outputTime() as deprecated MAY-2016
      
      - use pre-increment for runTime, although there is no difference in
        behaviour or performance.
      1fe7a4f5
  15. 03 Jun, 2018 1 commit
    • Mark Olesen's avatar
      STYLE: reduced usage of Switch · fb5e5509
      Mark Olesen authored
      - Since 'bool' and 'Switch' use the _identical_ input mechanism
        (ie, both accept true/false, on/off, yes/no, none, 1/0), the main
        reason to prefer one or the other is the output.
      
        The output for Switch is as text (eg, "true"), whereas for bool
        it is label (0 or 1). If the output is required for a dictionary,
        Switch may be appropriate. If the output is not required, or is only
        used for Pstream exchange, bool can be more appropriate.
      fb5e5509
  16. 01 Jun, 2018 1 commit
  17. 30 May, 2018 1 commit
  18. 18 May, 2018 1 commit
    • Mark Olesen's avatar
      ENH: avoid memory leaks for HashPtrTable, PtrMap insertion (issue #749) · 5f1a223b
      Mark Olesen authored
      - disallow insert() of raw pointers, since a failed insertion
        (ie, entry already existed) results in an unmanaged pointer.
      
        Either insert using an autoPtr, or set() with raw pointers or autoPtr.
      
      - IOobjectList::add() now takes an autoPtr instead of an object reference
      
      - IOobjectList::remove() now returns an autoPtr instead of a raw pointer
      5f1a223b
  19. 16 May, 2018 6 commits
    • Will Bainbridge's avatar
      STYLE: thermo: Macro renaming · c9229280
      Will Bainbridge authored
      Thermo and reaction thermo macros have been renamed and refactored. If
      the name is plural (make???Thermos) then it adds the model to all
      selection tables. If not (make???Thermo) then it only adds to the
      requested psi or rho table.
      c9229280
    • Will Bainbridge's avatar
      ENH: reactionThermo: Single component mixture · af7988c2
      Will Bainbridge authored
      This mixture allows a reacting solver to be used with a single component
      fluid without the additional case files usually required for reacting
      thermodynamics.
      
      reactionThermo: Instantiated more single component mixtures
      
      ENH: reactionThermo: Select singleComponentMixture as pureMixture
      
      A pureMixture can now be specified in a reacting solver. This further
      enhances compatibility between non-reacting and reacting solvers.
      
      To achieve this, mixtures now have a typeName function of the same form
      as the lower thermodyanmic models. In addition, to avoid name clashes,
      the reacting thermo make macros have been split into those that create
      entries on multiple selection tables, and those that just add to the
      reaction thermo table.
      af7988c2
    • Will Bainbridge's avatar
      ENH: combustionModels: Changed the construction order · 07372fd5
      Will Bainbridge authored
      The combustion and chemistry models no longer select and own the
      thermodynamic model; they hold a reference instead. The construction of
      the combustion and chemistry models has been changed to require a
      reference to the thermodyanmics, rather than the mesh and a phase name.
      
      At the solver-level the thermo, turbulence and combustion models are now
      selected in sequence. The cyclic dependency between the three models has
      been resolved, and the raw-pointer based post-construction step for the
      combustion model has been removed.
      
      The old solver-level construction sequence (typically in createFields.H)
      was as follows:
      
          autoPtr<combustionModels::psiCombustionModel> combustion
          (
              combustionModels::psiCombustionModel::New(mesh)
          );
      
          psiReactionThermo& thermo = combustion->thermo();
      
          // Create rho, U, phi, etc...
      
          autoPtr<compressible::turbulenceModel> turbulence
          (
              compressible::turbulenceModel::New(rho, U, phi, thermo)
          );
      
          combustion->setTurbulence(*turbulence);
      
      The new sequence is:
      
          autoPtr<psiReactionThermo> thermo(psiReactionThermo::New(mesh));
      
          // Create rho, U, phi, etc...
      
          autoPtr<compressible::turbulenceModel> turbulence
          (
              compressible::turbulenceModel::New(rho, U, phi, *thermo)
          );
      
          autoPtr<combustionModels::psiCombustionModel> combustion
          (
              combustionModels::psiCombustionModel::New(*thermo, *turbulence)
          );
      
      ENH: combustionModel, chemistryModel: Simplified model selection
      
      The combustion and chemistry model selection has been simplified so
      that the user does not have to specify the form of the thermodynamics.
      
      Examples of new combustion and chemistry entries are as follows:
      
          In constant/combustionProperties:
      
              combustionModel PaSR;
      
              combustionModel FSD;
      
          In constant/chemistryProperties:
      
              chemistryType
              {
                  solver          ode;
                  method          TDAC;
              }
      
      All the angle bracket parts of the model names (e.g.,
      <psiThermoCombustion,gasHThermoPhysics>) have been removed as well as
      the chemistryThermo entry.
      
      The changes are mostly backward compatible. Only support for the
      angle bracket form of chemistry solver names has been removed. Warnings
      will print if some of the old entries are used, as the parts relating to
      thermodynamics are now ignored.
      
      ENH: combustionModel, chemistryModel: Simplified model selection
      
      Updated all tutorials to the new format
      
      STYLE: combustionModel: Namespace changes
      
      Wrapped combustion model make macros in the Foam namespace and removed
      combustion model namespace from the base classes. This fixes a namespace
      specialisation bug in gcc 4.8. It is also somewhat less verbose in the
      solvers.
      
      This resolves bug report https://bugs.openfoam.org/view.php?id=2787
      
      ENH: combustionModels: Default to the "none" model
      
      When the constant/combustionProperties dictionary is missing, the solver
      will now default to the "none" model. This is consistent with how
      radiation models are selected.
      07372fd5
    • Henry Weller's avatar
      BUG: compressibleInterFoam family: Corrected transonic option · 56d9a38f
      Henry Weller authored
      Resolves bug-report https://bugs.openfoam.org/view.php?id=2785
      
      ENH: compressibleInterFoam family: merged two-phase momentum stress modelling from compressibleInterPhaseTransportFoam
      
      The new momentum stress model selector class
      compressibleInterPhaseTransportModel is now used to select between the options:
      
      Description
          Transport model selection class for the compressibleInterFoam family of
          solvers.
      
          By default the standard mixture transport modelling approach is used in
          which a single momentum stress model (laminar, non-Newtonian, LES or RAS) is
          constructed for the mixture.  However if the \c simulationType in
          constant/turbulenceProperties is set to \c twoPhaseTransport the alternative
          Euler-Euler two-phase transport modelling approach is used in which separate
          stress models (laminar, non-Newtonian, LES or RAS) are instantiated for each
          of the two phases allowing for different modeling for the phases.
      
      Mixture and two-phase momentum stress modelling is now supported in
      compressibleInterFoam, compressibleInterDyMFoam and compressibleInterFilmFoam.
      The prototype compressibleInterPhaseTransportFoam solver is no longer needed and
      has been removed.
      56d9a38f
    • Will Bainbridge's avatar
      BUG: basicSpecieMixture: Removed duplicated molecular weight mixing · 3cb9dc4e
      Will Bainbridge authored
      Mixture molecular weight is now evaluated in heThermo like everything
      else, relying on the low level specie mixing rules. Units have also been
      corrected.
      
      SpecieMixture: Pure virtual definition for W to prevent Clang warning
      3cb9dc4e
    • Will Bainbridge's avatar
  20. 10 May, 2018 1 commit
  21. 27 Apr, 2018 1 commit
    • Mark Olesen's avatar
      ENH: make format of ExecutionTime = ... output configurable (issue #788) · b77e4888
      Mark Olesen authored
      - controlled by the the 'printExecutionFormat' InfoSwitch in
        etc/controlDict
      
            // Style for "ExecutionTime = " output
            // - 0 = seconds (with trailing 's')
            // - 1 = day-hh:mm:ss
      
         ExecutionTime = 112135.2 s  ClockTime = 113017 s
      
         ExecutionTime = 1-07:08:55.20  ClockTime = 1-07:23:37
      
      - Callable via the new Time::printExecutionTime() method,
        which also helps to reduce clutter in the applications.
        Eg,
      
           runTime.printExecutionTime(Info);
      
        vs
      
           Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
               << "  ClockTime = " << runTime.elapsedClockTime() << " s"
               << nl << endl;
      
      --
      
      ENH: return elapsedClockTime() and clockTimeIncrement as double
      
      - previously returned as time_t, which is less portable.
      b77e4888
  22. 24 Apr, 2018 1 commit
    • Mark Olesen's avatar
      ENH: improve handling of ThirdParty packages · d4cbed29
      Mark Olesen authored
      - generalize some of the library extensions (.so vs .dylib).
        Provide as wmake 'sysFunctions'
      
      - added note about unsupported/incomplete system support
      
      - centralize detection of ThirdParty packages into wmake/ subdirectory
        by providing a series of scripts in the spirit of GNU autoconfig.
        For example,
      
            have_boost, have_readline, have_scotch, ...
      
        Each of the `have_<package>` scripts will generally provide the
        following type of functions:
      
            have_<package>          # detection
            no_<package>            # reset
            echo_<package>          # echoing
      
        and the following type of variables:
      
            HAVE_<package>          # unset or 'true'
            <package>_ARCH_PATH     # root for <package>
            <package>_INC_DIR       # include directory for <package>
            <package>_LIB_DIR       # library directory for <package>
      
        This simplifies the calling scripts:
      
            if have_metis
            then
                wmake metisDecomp
            fi
      
        As well as reduci...
      d4cbed29
  23. 17 Apr, 2018 1 commit
  24. 03 Apr, 2018 2 commits
    • Mark Olesen's avatar
      STYLE: use 'return nullptr' for empty autoPtr/tmp returns · f888c23b
      Mark Olesen authored
      - both autoPtr and tmp are defined with an implicit construct from
        nullptr (but with explicit construct from a pointer to null).
        Thus is it safe to use 'nullptr' when returning an empty autoPtr or tmp.
      f888c23b
    • Mark Olesen's avatar
      STYLE: more consistent use of dimensioned Zero · 5632ef2d
      Mark Olesen authored
      - when constructing dimensioned fields that are to be zero-initialized,
        it is preferrable to use a form such as
      
            dimensionedScalar(dims, Zero)
            dimensionedVector(dims, Zero)
      
        rather than
      
            dimensionedScalar("0", dims, 0)
            dimensionedVector("zero", dims, vector::zero)
      
        This reduces clutter and also avoids any suggestion that the name of
        the dimensioned quantity has any influence on the field's name.
      
        An even shorter version is possible. Eg,
      
            dimensionedScalar(dims)
      
        but reduces the clarity of meaning.
      
      - NB: UniformDimensionedField is an exception to these style changes
        since it does use the name of the dimensioned type (instead of the
        regIOobject).
      5632ef2d
  25. 26 Mar, 2018 1 commit
    • Mark Olesen's avatar
      STYLE: consistent lookupOrDefault template parameters · bba7511c
      Mark Olesen authored
      - in many cases can just use lookupOrDefault("key", bool) instead of
        lookupOrDefault<bool> or lookupOrDefault<Switch> since reading a
        bool from an Istream uses the Switch(Istream&) anyhow
      
      STYLE: relocated Switch string names into file-local scope
      bba7511c
  26. 07 Mar, 2018 1 commit
    • Mark Olesen's avatar
      ENH: cleanup autoPtr class (issue #639) · a2d43901
      Mark Olesen authored
      Improve alignment of its behaviour with std::unique_ptr
      
        - element_type typedef
        - release() method - identical to ptr() method
        - get() method to get the pointer without checking and without releasing it.
        - operator*() for dereferencing
      
      Method name changes
      
        - renamed rawPtr() to get()
        - renamed rawRef() to ref(), removed unused const version.
      
      Removed methods/operators
      
        - assignment from a raw pointer was deleted (was rarely used).
          Can be convenient, but uncontrolled and potentially unsafe.
          Do allow assignment from a literal nullptr though, since this
          can never leak (and also corresponds to the unique_ptr API).
      
      Additional methods
      
        - clone() method: forwards to the clone() method of the underlying
          data object with argument forwarding.
      
        - reset(autoPtr&&) as an alternative to operator=(autoPtr&&)
      
      STYLE: avoid implicit conversion from autoPtr to object type in many places
      
      - existing implementation has the following:
      
           operator const T&() const { return operator*(); }
      
        which means that the following code works:
      
             autoPtr<mapPolyMesh> map = ...;
             updateMesh(*map);    // OK: explicit dereferencing
             updateMesh(map());   // OK: explicit dereferencing
             updateMesh(map);     // OK: implicit dereferencing
      
        for clarity it may preferable to avoid the implicit dereferencing
      
      - prefer operator* to operator() when deferenced a return value
        so it is clearer that a pointer is involve and not a function call
        etc    Eg,   return *meshPtr_;  vs.  return meshPtr_();
      a2d43901
  27. 22 Feb, 2018 1 commit
  28. 09 Feb, 2018 1 commit
    • Mark Olesen's avatar
      STYLE: simplify hashing to use struct instead of class · 564a417b
      Mark Olesen authored
      - more consistent with STL practices for function classes.
      
      - string::hash function class now operates on std::string rather
        than Foam::string since we have now avoided inadvertent use of
        string conversion from int in more places.
      564a417b
  29. 22 Nov, 2017 1 commit