1. 09 Jul, 2019 1 commit
  2. 13 Jun, 2019 1 commit
  3. 16 Apr, 2019 1 commit
  4. 05 Apr, 2019 2 commits
    • Mark Olesen's avatar
      ENH: add fileName::concat static method · ec33b37e
      Mark Olesen authored
      - similar to the global '/' operator, but taking raw strings and not
        performing any stripping.
      
        Was previously a local function within POSIX.C, but it is useful enough
        to be in fileName itself.
      ec33b37e
    • Mark Olesen's avatar
      ENH: allow space char in fileName is now configurable (#1008) · 28b137f8
      Mark Olesen authored
      - having whitespace in fileName can be somewhat fragile since it means
        that the fileName components do not necessarily correspond to a
        'Foam::word'. But in many cases it will work provided that spaces
        are not present in the final portion of the simulation directory
        itself.
      
          InfoSwitches
          {
              // Allow space character in fileName (use with caution)
              allowSpaceInFileName    0;
          }
      
      - now use doClean=true as default for fileName::validate(). Was false.
      
        Unlike fileName::clean() this requires no internal string rewrite
        since the characters are being copied.  Also handle any path
        separator transformations (ie, backslash => forward slash) at the
        same time. This makes it resemble the std::filesystem a bit more.
      28b137f8
  5. 14 Mar, 2019 1 commit
  6. 06 Feb, 2019 2 commits
  7. 15 Dec, 2018 1 commit
    • Mark Olesen's avatar
      ENH: simplify use of case-relative paths · 70a50d61
      Mark Olesen authored
      - provide relativePath() for argList and for Time.
        These are relative to the case globalPath().
        Eg,
      
           Info<< "output: " << runTime.relativePath(outputFile) << nl;
      70a50d61
  8. 14 Dec, 2018 1 commit
    • Mark Olesen's avatar
      ENH: extend fileName::relative() method · b1a0007c
      Mark Olesen authored
      - optionally replace stripped parent directory with the \<case\> shortcut
      
          "/this/path/and/subdirs/name"
      
          relative("/this/path")        -> "and/subdirs/name"
          relative("/this/path", true)  -> "\<case\>/and/subdirs/name"
      b1a0007c
  9. 13 Dec, 2018 1 commit
    • Mark Olesen's avatar
      ENH: add optional checkGzip parameter to fileName::type(..) method · 81948ebc
      Mark Olesen authored
      - this simplifies use of a unified test for directory or file.
      
            fileName::Type what = myfile.type(true, true);
            if (what == FILE) ...
            if (what == DIRECTORY) ...
      
      - Use distinct bit values for fileName::Type, for possible use in
        the future.
      
      - related to issue #1121, since we need a more flexible way of
        expanding file or directory.
      
        An alternative would be to add checkGzip to Foam::exists() and
        Foam::type() functions, but that would make the code there more
        confusing and in the fileHandler classes.
      81948ebc
  10. 17 Oct, 2018 1 commit
  11. 11 Oct, 2018 1 commit
  12. 05 Oct, 2018 1 commit
  13. 19 Sep, 2018 1 commit
  14. 02 Aug, 2018 1 commit
  15. 16 Apr, 2018 1 commit
    • Mark Olesen's avatar
      ENH: add alternative STL ASCII parsers · 2e38a9b8
      Mark Olesen authored
      - In addition to the traditional Flex-based parser, added a Ragel-based
        parser and a handwritten one.
      
        Some representative timings for reading 5874387 points (1958129 tris):
      
            Flex   Ragel   Manual
            5.2s   4.8s    6.7s         total reading time
            3.8s   3.4s    5.3s         without point merging
      2e38a9b8
  16. 03 Apr, 2018 1 commit
  17. 22 Feb, 2018 1 commit
  18. 25 Jan, 2018 1 commit
    • Mark Olesen's avatar
      ENH: added fileName::relative() method · 4dc45ef6
      Mark Olesen authored
      - this currently just strips off the leading parent directory name
      
           "/this/path/and/subdirs/name"
      
           relative("/this/path")  -> "and/subdirs/name"
           relative("/this")       -> "path/and/subdirs/name"
      4dc45ef6
  19. 10 Jan, 2018 1 commit
  20. 07 Nov, 2017 1 commit
  21. 28 Oct, 2017 1 commit
    • Mark Olesen's avatar
      ENH: add fileName::validate static method (issue #628) · 92a22882
      Mark Olesen authored
      - similar to word::validate to allow stripping of invalid characters
        without triggering a FatalError.
      
      - use this validated fileName in Foam::readDir to avoid problems when
        a directory contains files with invalid characters in their names
      
      - adjust rmDir to handle filenames with invalid characters
      
      - fileName::equals() static method to compare strings while ignoring
        any differences that are solely due to duplicate slashes
      92a22882
  22. 22 Sep, 2017 1 commit
    • Andrew Heather's avatar
      INT: Integration of Mattijs' collocated parallel IO additions · 85f12ff5
      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.
      85f12ff5
  23. 02 Aug, 2017 2 commits
    • Mark Olesen's avatar
      ENH: static versions of fileName clean(), path(), name() · 6802fa9c
      Mark Olesen authored
      - useful operations for other string representations of fileName types.
      
        The return type is in general a std::string with any narrowing
        being done by the caller on the return value.
      6802fa9c
    • Mark Olesen's avatar
      ENH: consolidate, cleanup some string methods · cb049ffe
      Mark Olesen authored
      - consolidate word::validated() into word::validate() and also allow
        as short form for string::validate<word>(). Also less confusing than
        having similarly named methods that essentially do the same thing.
      
      - more consistent const access when iterating over strings
      
      - add valid(char) for keyType and wordRe
      cb049ffe
  24. 26 May, 2017 1 commit
  25. 10 Mar, 2017 2 commits
    • mark's avatar
      ENH: use fileName::nameLessExt() instead of fileName::name(bool) · 1a560627
      mark authored
      - the purpose is more explicit, without needing to check documentation
        about what the bool parameter means.
      
      STYLE: improve formatting of fileName documentation
      1a560627
    • mark's avatar
      ENH: support default/alternate values for env-vars in dictionary lookup · 20e50caf
      mark authored
      - was previously only within string expansions, but cover dictionaries
        as well for consistency
      
      ENH: replace the never-used fileName::caseName() functionality
      
      - stringOps::inplaceReplaceVar() is more general
      
           stringOps::inplaceReplaceVar(myfile, "FOAM_CASE");
      
      STYLE: relax parameter passing when calling some POSIX 'query' functions.
      
      - A std::string is sufficient since the functions use a plain C-string.
        Eg, getEnv("SOMETHING").
        Retain more stringent Foam::word for things like setEnv, since this
        could be useful.
      20e50caf
  26. 20 Dec, 2016 2 commits
    • mark's avatar
      ENH: additional fileName methods · dd1c0d97
      mark authored
         - add an extension to the file name
         - remove a file extension
         - check if a file name has an extension
         - check if a file name has a particular extension (as word),
           or matches a particular grouping of extensions (as wordRe).
      dd1c0d97
    • mark's avatar
      ENH: initializer list constructor for fileName · 033b30c6
      mark authored
      This slightly more convenient when working with char[] input:
      
           fileName file1{ "path", "name", "to", "file.ext" };
      vs.  fileName file1 = fileName(path)/"name"/"to"/"file.ext";
      
      But is a bit more efficient since it avoid most of the intermediate
      copying and resizing incurred by the '/' operator.
      033b30c6
  27. 05 Jul, 2016 1 commit
    • mattijs's avatar
      ENH: OSspecific - softlink handling (fixes #164) · d1c49285
      mattijs authored
      Links are followed in most cases, with some notable exceptions:
      
      - mv, mvBak:
        renames the link, not the underlying file/directory
      
      - rmDir:
        remove the symlink to a directory, does not recurse into the
        underlying directory
      d1c49285
  28. 26 May, 2016 1 commit
  29. 17 Jan, 2016 1 commit
  30. 30 Jun, 2015 1 commit
  31. 10 Dec, 2014 1 commit