From 6bdcb6f8ceff86746ae2a30f0950a6d804d3aa6a Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Fri, 3 Feb 2017 14:29:07 +0000 Subject: [PATCH] lagrangian::NonInertialFrameForce: Use field references rather than copies Patch contributed by Mattijs Janssens --- .../NonInertialFrame/NonInertialFrameForce.C | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/NonInertialFrame/NonInertialFrameForce.C b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/NonInertialFrame/NonInertialFrameForce.C index 9630f242b..17f57041f 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/NonInertialFrame/NonInertialFrameForce.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/NonInertialFrame/NonInertialFrameForce.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -121,7 +121,7 @@ void Foam::NonInertialFrameForce::cacheFields(const bool store) ) ) { - uniformDimensionedVectorField W = this->mesh().template + const uniformDimensionedVectorField& W = this->mesh().template lookupObject(WName_); W_ = W.value(); @@ -135,7 +135,7 @@ void Foam::NonInertialFrameForce::cacheFields(const bool store) ) ) { - uniformDimensionedVectorField omega = this->mesh().template + const uniformDimensionedVectorField& omega = this->mesh().template lookupObject(omegaName_); omega_ = omega.value(); @@ -149,7 +149,8 @@ void Foam::NonInertialFrameForce::cacheFields(const bool store) ) ) { - uniformDimensionedVectorField omegaDot = this->mesh().template + const uniformDimensionedVectorField& omegaDot = + this->mesh().template lookupObject(omegaDotName_); omegaDot_ = omegaDot.value(); @@ -163,7 +164,7 @@ void Foam::NonInertialFrameForce::cacheFields(const bool store) ) ) { - uniformDimensionedVectorField centreOfRotation = + const uniformDimensionedVectorField& centreOfRotation = this->mesh().template lookupObject (