Skip to content
Snippets Groups Projects
Commit a57efb5b authored by andy's avatar andy
Browse files

ENH: Minor optimisation

parent 09141f30
Branches
Tags
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -96,11 +96,11 @@ Foam::basicSymmetryFvPatchField<Type>::snGrad() const ...@@ -96,11 +96,11 @@ Foam::basicSymmetryFvPatchField<Type>::snGrad() const
{ {
tmp<vectorField> nHat = this->patch().nf(); tmp<vectorField> nHat = this->patch().nf();
const Field<Type> iF(this->patchInternalField());
return return
( (transform(I - 2.0*sqr(nHat), iF) - iF)
transform(I - 2.0*sqr(nHat), this->patchInternalField()) *(this->patch().deltaCoeffs()/2.0);
- this->patchInternalField()
)*(this->patch().deltaCoeffs()/2.0);
} }
...@@ -114,12 +114,11 @@ void Foam::basicSymmetryFvPatchField<Type>::evaluate(const Pstream::commsTypes) ...@@ -114,12 +114,11 @@ void Foam::basicSymmetryFvPatchField<Type>::evaluate(const Pstream::commsTypes)
tmp<vectorField> nHat = this->patch().nf(); tmp<vectorField> nHat = this->patch().nf();
const Field<Type> iF(this->patchInternalField());
Field<Type>::operator= Field<Type>::operator=
( (
( (iF + transform(I - 2.0*sqr(nHat), iF))/2.0
this->patchInternalField()
+ transform(I - 2.0*sqr(nHat), this->patchInternalField())
)/2.0
); );
transformFvPatchField<Type>::evaluate(); transformFvPatchField<Type>::evaluate();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment