Skip to content
Snippets Groups Projects
user avatar
Mark Olesen authored
ENH: improve objectRegistry functionality (issue #322)

- 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().lookup...
5f9be34a
Name Last commit Last update