1. 30 Jul, 2018 1 commit
  2. 04 Jun, 2018 1 commit
  3. 01 Jun, 2018 1 commit
    • Mark Olesen's avatar
      ENH: improve infrastructure for detecting excess tokens (issue #762) · 511b3562
      Mark Olesen authored
      - Always used for optional dictionary entries, since these are individual
        values, and not meant to be embedded in a larger stream of tokens.
      
        Methods:
           - lookupOrDefault, lookupOrAddDefault, lookupOrDefaultCompat
           - readIfPresent, readIfPresentCompat
      
      - Handling mandatory dictionary entries is slightly more complex,
        since these may be part of larger stream of tokens, and are often
        used in a constructor context. For example,
      
            word modelType(dict.lookup("type"));
      
        Or they are used without a definite context. For example,
      
            dict.lookup("format") >> outputFormat;
      
        Newly introduced methods for mandatory dictionary entries:
           - get, getCompat
           - read, readCompat
      
        In a constructor or assignment context:
      
            word modelType(dict.get<word>("type"));
            outputFormat = dict.lookup("format");
      
        without copy/move (similar to readIfPresent):
      
            dict.read("format", outputFormat);
      511b3562
  4. 30 May, 2018 1 commit
  5. 16 May, 2018 1 commit
  6. 21 Mar, 2018 1 commit
  7. 26 Feb, 2018 3 commits
    • Mark Olesen's avatar
    • Mark Olesen's avatar
      ENH: cleanup tmp class (issue #639) · 52b36f84
      Mark Olesen authored
      Improve alignment of its behaviour with std::shared_ptr
      
        - element_type typedef
        - swap, reset methods
      
      * additional reference access methods:
      
      cref()
          returns a const reference, synonymous with operator().
          This provides a more verbose alternative to using the '()' operator
          when that is desired.
      
              Mnemonic: a const form of 'ref()'
      
      constCast()
          returns a non-const reference, regardless if the underlying object
          itself is a managed pointer or a const object.
          This is similar to ref(), but more permissive.
      
              Mnemonic: const_cast<>
      
          Using the constCast() method greatly reduces the amount of typing
          and reading. And since the data type is already defined via the tmp
          template parameter, the type deduction is automatically known.
      
          Previously,
      
              const tmp<volScalarField>& tfld;
      
              const_cast<volScalarField&>(tfld()).rename("name");
              volScalarField& fld = const_cast<volScalarField&>(tfld());
      
          Now,
      
          ...
      52b36f84
    • Mark Olesen's avatar
      ENH: cleanup autoPtr class (issue #639) · 660f3e54
      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_();
      660f3e54
  8. 07 Nov, 2017 2 commits
  9. 05 Nov, 2017 1 commit
  10. 21 Sep, 2017 1 commit
  11. 10 Aug, 2017 1 commit
  12. 31 Jul, 2017 1 commit
  13. 08 Sep, 2017 1 commit
  14. 07 Jul, 2017 1 commit
  15. 03 Jul, 2017 1 commit
  16. 13 Jun, 2017 2 commits
  17. 29 May, 2017 1 commit
  18. 26 May, 2017 1 commit
  19. 19 May, 2017 1 commit
  20. 07 Sep, 2017 2 commits
  21. 08 Aug, 2017 1 commit
  22. 13 Jul, 2017 2 commits
  23. 07 Jul, 2017 1 commit
    • Andrew Heather's avatar
      INT: Integration of Mattijs' collocated parallel IO additions · d8d6030a
      Andrew Heather authored
      Original commit message:
      ------------------------
      
      Parallel IO: New collated file format
      
      When an OpenFOAM simulation runs in parallel, the data for decomposed fields and
      mesh(es) has historically been stored in multiple files within separate
      directories for each processor.  Processor directories are named 'processorN',
      where N is the processor number.
      
      This commit introduces an alternative "collated" file format where the data for
      each decomposed field (and mesh) is collated into a single file, which is
      written and read on the master processor.  The files are stored in a single
      directory named 'processors'.
      
      The new format produces significantly fewer files - one per field, instead of N
      per field.  For large parallel cases, this avoids the restriction on the number
      of open files imposed by the operating system limits.
      
      The file writing can be threaded allowing the simulation to continue running
      while the data is being written to file.  NFS (Network File System) is not
      needed when using the the collated format and additionally, there is an option
      to run without NFS with the original uncollated approach, known as
      "masterUncollated".
      
      The controls for the file handling are in the OptimisationSwitches of
      etc/controlDict:
      
      OptimisationSwitches
      {
          ...
      
          //- Parallel IO file handler
          //  uncollated (default), collated or masterUncollated
          fileHandler uncollated;
      
          //- collated: thread buffer size for queued file writes.
          //  If set to 0 or not sufficient for the file size threading is not used.
          //  Default: 2e9
          maxThreadFileBufferSize 2e9;
      
          //- masterUncollated: non-blocking buffer size.
          //  If the file exceeds this buffer size scheduled transfer is used.
          //  Default: 2e9
          maxMasterFileBufferSize 2e9;
      }
      
      When using the collated file handling, memory is allocated for the data in the
      thread.  maxThreadFileBufferSize sets the maximum size of memory in bytes that
      is allocated.  If the data exceeds this size, the write does not use threading.
      
      When using the masterUncollated file handling, non-blocking MPI communication
      requires a sufficiently large memory buffer on the master node.
      maxMasterFileBufferSize sets the maximum size in bytes of the buffer.  If the
      data exceeds this size, the system uses scheduled communication.
      
      The installation defaults for the fileHandler choice, maxThreadFileBufferSize
      and maxMasterFileBufferSize (set in etc/controlDict) can be over-ridden within
      the case controlDict file, like other parameters.  Additionally the fileHandler
      can be set by:
      - the "-fileHandler" command line argument;
      - a FOAM_FILEHANDLER environment variable.
      
      A foamFormatConvert utility allows users to convert files between the collated
      and uncollated formats, e.g.
          mpirun -np 2 foamFormatConvert -parallel -fileHandler uncollated
      
      An example case demonstrating the file handling methods is provided in:
      $FOAM_TUTORIALS/IO/fileHandling
      
      The work was undertaken by Mattijs Janssens, in collaboration with Henry Weller.
      d8d6030a
  24. 31 Mar, 2017 1 commit
  25. 18 Mar, 2017 2 commits
  26. 16 Mar, 2017 3 commits
    • Henry Weller's avatar
      Function1::ramp: New set of scalar ramp functions · 1e592a12
      Henry Weller authored
      Description
          Ramp function base class for the set of scalar functions starting from 0 and
          increasing monotonically to 1 from \c start over the \c duration and
          remaining at 1 thereafter.
      
          Usage:
          \verbatim
              <entryName> <rampFunction>;
              <entryName>Coeffs
              {
                  start     10;
                  duration  20;
              }
          \endverbatim
          or
          \verbatim
              <entryName>
              {
                  type      <rampFunction>;
                  start     10;
                  duration  20;
              }
          \endverbatim
      
          Where:
          \table
              Property | Description  | Required | Default value
              start    | Start time   | no       | 0
              duration | Duration     | yes      |
          \endtable
      
      The following common ramp functions are provided: linear, quadratic, halfCosine,
      quarterCosine and quaterSine, others can easily be added and registered to the run-time
      selection system.
      1e592a12
    • Henry Weller's avatar
      Function1: Rationalized construction to support the simpler sub-dictionary format · 2e2bfd23
      Henry Weller authored
      e.g.
          ramp
          {
              type     quadratic;
              start    200;
              duration 1.6;
          }
      
      but the old format is supported for backward compatibility:
      
          ramp linear;
          rampCoeffs
          {
              start    200;
              duration 1.6;
          }
      2e2bfd23
    • Henry Weller's avatar
  27. 07 Jan, 2017 1 commit
    • Henry Weller's avatar
      Rationalized the keyword to specify a file name in a dictionary to 'file' · 126125c1
      Henry Weller authored
      e.g. in tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/T
      
          hot
          {
              type            externalCoupledTemperature;
              commsDir        "${FOAM_CASE}/comms";
              file            "data";
              initByExternal  yes;
              log             true;
              value           uniform 307.75; // 34.6 degC
          }
      
      Previously both 'file' and 'fileName' were used inconsistently in different
      classes and given that there is no confusion or ambiguity introduced by using
      the simpler 'file' rather than 'fileName' this change simplifies the use and
      maintenance of OpenFOAM.
      126125c1
  28. 27 Dec, 2016 1 commit
  29. 28 Nov, 2016 1 commit
  30. 24 Nov, 2016 1 commit
  31. 05 Aug, 2016 1 commit