ENH: allow modification of tmp state (cached or uncached)

- simplifies handling.
  * enables unprotecting to avoid accidentally cloning.
  * removes the need for dedicated constructor or factory forms.
  * simplfies DimensionedField and GeometricField New factory methods

- update objectRegistry management method (internal use)

  old:  bool cacheTemporaryObject(...)
  new:  bool is_cacheTemporaryObject(...)

  to clarify that it is a query, not a request for caching etc.
This commit is contained in:
Mark Olesen
2023-10-18 09:29:28 +02:00
parent 7cc6d52345
commit 28b6a5b85a
10 changed files with 414 additions and 157 deletions

View File

@ -222,13 +222,14 @@ bool Foam::functionObjects::writeObjects::write()
// TBD:
// If the object is a temporary field expression wrap with tmp<...>
// if (obj.db().cacheTemporaryObject(objName))
// if (obj.db().is_cacheTemporaryObject(obj))
// {
// obj.IOobject::rename("tmp<" + objName + ">");
// const word oldName(obj.name());
// obj.IOobject::rename("tmp<" + oldName + ">");
//
// Log << " writing object " << obj.name() << endl;
// obj.write();
// obj.IOobject::rename(objName);
// obj.IOobject::rename(oldName);
// }
// else
{