1. 01 Dec, 2016 2 commits
    • Mark Olesen's avatar
      STYLE: simplify logic statement · d5e2b735
      Mark Olesen authored
      d5e2b735
    • Mark Olesen's avatar
      ENH: improve objectRegistry functionality (issue #322) · 92fa5a19
      Mark Olesen 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);
      
      --
      92fa5a19
  2. 08 Nov, 2015 1 commit
  3. 15 Dec, 2014 1 commit
  4. 08 Apr, 2013 1 commit
  5. 05 Apr, 2013 1 commit
  6. 26 Feb, 2013 2 commits
  7. 13 Aug, 2012 1 commit
  8. 09 Aug, 2012 2 commits
  9. 14 Aug, 2011 1 commit
  10. 19 Jan, 2011 1 commit
  11. 14 Jan, 2011 1 commit
  12. 07 Jan, 2011 1 commit
  13. 05 Jan, 2011 2 commits
  14. 08 Dec, 2010 1 commit
  15. 28 Jul, 2010 1 commit
  16. 29 Mar, 2010 1 commit
  17. 12 Mar, 2009 1 commit
  18. 05 Mar, 2009 1 commit
    • Mark Olesen's avatar
      regIOobject, Hasher, IOobject tweak · 7544164d
      Mark Olesen authored
      - regIOobject: don't re-register an unregister object on rename/assignment
      - Hasher: split-off HasherInt with uint32_t specializations
      - IOobject: writeBanner/writeDivider return Stream for easier chaining.
      
      ... also dropped some namespace bracketing while I was at it.
      7544164d
  19. 31 Dec, 2008 1 commit
  20. 25 Jun, 2008 2 commits
  21. 15 Apr, 2008 1 commit