1. 07 Feb, 2019 1 commit
  2. 06 Feb, 2019 3 commits
  3. 23 Jan, 2019 1 commit
    • Mark Olesen's avatar
      BUG: clearing objectRegistry can leak memory (#1180) · 47493f50
      Mark Olesen authored
      - now free anything owned by the registry when doing a clear.
      
      - the myriad of other ways to remove items (and potentially leaking)
        have not yet been addressed:
        * set, erase, retain, filterKeys, filterValues, filterEntries
      47493f50
  4. 21 Jan, 2019 1 commit
  5. 11 Nov, 2018 3 commits
    • Mark Olesen's avatar
      ENH: add objectRegistry::count() methods · 40dc6006
      Mark Olesen authored
      - can be useful for obtaining information about number of fields.
        Eg,
      
             nScalar = mesh.count<volScalarField>(wordre);
      40dc6006
    • Mark Olesen's avatar
      ENH: simplify/extend objectRegistry code with templated predicates · 48d7f9dc
      Mark Olesen authored
      - replace explicit use of wordRe, wordRes, wordHashSet as filters
        with a MatchPredicate.
      
      - support filtering by class based on <Type> or predicates
      48d7f9dc
    • Mark Olesen's avatar
      ENH: add IOobjectList::findObject() method · bf13df15
      Mark Olesen authored
      - naming similar to objectRegistry, with unambiguous resolution.
        The lookup() methods have different return types depending on the
        calling parameter.
      
      STYLE: use IOobjectListTemplates.C for implementations
      
      - previously included as local definition within IOobjectList.C,
        but will be adding more templated methods soon.
      
      - adjust parameters (eg, matchName instead of matcher) to show their
        function
      
      ENH: handle objectRegistry::names<void>(...)
      
      - this is equivalent to no Type restriction, and can be used when
        filtering names. Eg,
      
           obr.names<void>(wordRe..);
      bf13df15
  6. 26 Jul, 2018 1 commit
  7. 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
  8. 02 Aug, 2017 1 commit
    • 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
  9. 18 May, 2017 1 commit
    • Mark Olesen's avatar
      ENH: added classes() method to objectRegistry/IOobjectList · 4001a157
      Mark Olesen authored
      - provides a summary hash of classes used and their associated object names.
      
        The HashTable representation allows us to leverage various HashTable
        methods. This hashed summary view can be useful when querying
        particular aspects, but is most useful when reducing the objects in
        consideration to a particular subset. For example,
      
            const wordHashSet interestingTypes
            {
                volScalarField::typeName,
                volVectorField::typeName
            };
      
            IOobjectList objects(runTime, runTime.timeName());
            HashTable<wordHashSet> classes = objects.classes();
      
            classes.retain(interestingTypes);
      
            // Or do just the opposite:
            classes.erase(unsupportedTypes);
      
        Can also use the underlying HashTable filter methods
      
      STYLE: use templated internals to avoid findString() when matching subsets
      4001a157
  10. 01 Dec, 2016 1 commit
    • mark's avatar
      ENH: improve objectRegistry functionality (issue #322) · 57e70437
      mark authored
      - Recursive searching for objects within a registry is now optional
        (previous it was always done).
      
        A recursive search effectively blocks the construction of sub-sub-registries
        if their names are 'masked' by some parent level sub-registry with
        the same name! (BUG)
      
      - Recursive search is now turned OFF by default, which makes it consistent
        with dictionary and probably causes the least number of surprises.
      
      ----
      Various new convenience methods added:
      
      lookupObjectRef()
      - returns a non-const reference.
        For example,
      
            volScalarField& U = mesh().lookupObjectRef<volScalarField>("U");
      
        Instead of
      
            volScalarField& U = const_cast<volScalarField&>
            (
                mesh().lookupObject<volScalarField>("U")
            );
      
      --
      lookupObjectPtr()
      - returns a const pointer, and nullptr on failure.
        For example,
      
            const volScalarField* Uptr = mesh().lookupObjectPtr<volScalarField>("U");
            if (Uptr)
            {
                const volScalarField& U = *Uptr;
                ...
            }
      
        Instead of
      
            if (mesh().foundObject<volScalarField>("U"))
            {
                const volScalarField& U = mesh().lookupObject<volScalarField>("U");
                ...
            }
      
      --
      lookupObjectRefPtr()
      - returns a non-const pointer, and nullptr on failure.
        For example,
      
            volScalarField* Uptr = mesh().lookupObjectRefPtr<volScalarField>("U");
            if (Uptr)
            {
                volScalarField& U = *Uptr;  // use as reference
                (*Uptr) = ...;              // or use directly
            }
      
        Instead of
      
            if (mesh().foundObject<volScalarField>("U"))
            {
                volScalarField& U = const_cast<volScalarField&>
                (
                    mesh().lookupObject<volScalarField>("U")
                );
            }
      
      --
      sortedNames()
      - now works with template parameters and with regular expression
        matching as well.
        For example,
      
            wordList names  = mesh().sortedNames();
            wordList fields = mesh().sortedName<volScalarField>();
      
        Instead of
      
            wordList names  = mesh().sortedNames();
            wordList fields = mesh().names<volScalarField>();
            Foam::sort(fields);
      
      --
      57e70437
  11. 15 May, 2016 1 commit
    • Henry Weller's avatar
      Patches contributed by Mattijs Janssens: · 1441f8ca
      Henry Weller authored
      splitMeshRegions: handle flipping of faces for surface fields
      
      subsetMesh: subset dimensionedFields
      
      decomposePar: use run-time selection of decomposition constraints. Used to
          keep cells on particular processors. See the decomposeParDict in
      
      $FOAM_UTILITIES/parallel/decomposePar:
        - preserveBaffles: keep baffle faces on same processor
        - preserveFaceZones: keep faceZones owner and neighbour on same processor
        - preservePatches: keep owner and neighbour on same processor. Note: not
          suitable for cyclicAMI since these are not coupled on the patch level
        - singleProcessorFaceSets: keep complete faceSet on a single processor
        - refinementHistory: keep cells originating from a single cell on the
          same processor.
      
      decomposePar: clean up decomposition of refinement data from snappyHexMesh
      
      reconstructPar: reconstruct refinement data (refineHexMesh, snappyHexMesh)
      
      reconstructParMesh: reconstruct refinement data (refineHexMesh, snappyHexMesh)
      
      redistributePar:
        - corrected mapping surfaceFields
        - adding processor patches in order consistent with decomposePar
      
      argList: check that slaves are running same version as master
      
      fvMeshSubset: move to dynamicMesh library
      
      fvMeshDistribute:
        - support for mapping dimensionedFields
        - corrected mapping of surfaceFields
      
      parallel routines: allow parallel running on single processor
      
      Field: support for
        - distributed mapping
        - mapping with flipping
      
      mapDistribute: support for flipping
      
      AMIInterpolation: avoid constructing localPoints
      1441f8ca
  12. 20 Mar, 2016 2 commits
  13. 07 Dec, 2015 1 commit
    • mattijs's avatar
      BUG: objectRegistry: do not clear event number on dependent objects · 44d7f643
      mattijs authored
      This was causing same event number on both U and grad(U) which meant
      that if one of the processors had different event number the trigger
      of gradient caching would not be synchronised. Now instead the overflow
      is detected in the regIOobject::upToDate function and handled consistently
      (by assuming that the events of object will never differ by more than
      labelMax/2)
      44d7f643
  14. 17 Nov, 2015 2 commits
  15. 11 Nov, 2015 1 commit
  16. 10 Nov, 2015 1 commit
  17. 10 Dec, 2014 1 commit