Skip to content
Snippets Groups Projects
Commit 868d5866 authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: Use reference instead of copy

parent 6148d8c4
Branches
Tags
No related merge requests found
...@@ -118,7 +118,7 @@ void Foam::particleForces::cacheFields(const bool store) ...@@ -118,7 +118,7 @@ void Foam::particleForces::cacheFields(const bool store)
{ {
if (store && pressureGradient_) if (store && pressureGradient_)
{ {
const volVectorField U = mesh_.lookupObject<volVectorField>(UName_); const volVectorField& U = mesh_.lookupObject<volVectorField>(UName_);
gradUPtr_ = fvc::grad(U).ptr(); gradUPtr_ = fvc::grad(U).ptr();
} }
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment