Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • openfoam openfoam
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 426
    • Issues 426
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 9
    • Merge requests 9
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • openfoamopenfoam
  • Merge requests
  • !326

ENH: regIOobject store() now also registers the object

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Mark OLESEN requested to merge feature-regIOobject-store into develop Jan 13, 2020
  • Overview 0
  • Commits 1
  • Changes 4
  • previously the store() method just set the ownedByRegistry flag. Now ensure that it is indeed registered first.

  • support register/store of tmp<> items. The tmp parameter is not cleared, but changed from PTR to CREF to allow further use.

    The implicit registration allows code simplification using the GeometricField::New factory method, for example.

    Old Code

    volScalarField* ptr = new volScalarField
    (
        IOobject
        (
            fieldName,
            mesh.time().timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::NO_WRITE,
            true  // Register
        ),
        mesh,
        dimless,
        zeroGradientFvPatchField<scalar>::typeName
    );
    ptr->store();

    New Code

    auto tptr = volScalarField::New
    (
        fieldName,
        mesh,
        dimless,
        zeroGradientFvPatchField<scalar>::typeName
    );
    regIOobject::store(tptr);

    or even regIOobject::store ( volScalarField::New ( fieldName, mesh, dimless, zeroGradientFvPatchField::typeName ) );

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: feature-regIOobject-store