From 25f98bf7cf29b0cce64f0fd07e3c6ba3a309c01b Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Fri, 12 Feb 2016 14:12:05 +0000 Subject: [PATCH] valuePointPatchField: Change assignment to use the object's internalField rather than that of the argument Avoids dependency on the state of the argument pointPatchField the internalField of which may have been de-allocated --- .../fixedValue/fixedValuePointPatchField.H | 7 +-- .../basic/value/valuePointPatchField.C | 4 +- .../pointPatchField/pointPatchField.H | 43 +++---------------- 3 files changed, 11 insertions(+), 43 deletions(-) diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/fixedValue/fixedValuePointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/basic/fixedValue/fixedValuePointPatchField.H index 3b0aa4e59f..1e101b8f88 100644 --- a/src/OpenFOAM/fields/pointPatchFields/basic/fixedValue/fixedValuePointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/basic/fixedValue/fixedValuePointPatchField.H @@ -136,11 +136,8 @@ public: // Disable assignment operators - virtual void operator=(const Field&) - {} - - virtual void operator=(const Type&) - {} + virtual void operator=(const Field&){} + virtual void operator=(const Type&){} }; diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.C index e40a781a35..d72d22b81a 100644 --- a/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.C @@ -201,7 +201,7 @@ void Foam::valuePointPatchField::operator= const pointPatchField& ptf ) { - Field::operator=(ptf.patchInternalField()); + Field::operator=(this->patchInternalField()); } @@ -242,7 +242,7 @@ void Foam::valuePointPatchField::operator== const pointPatchField& ptf ) { - Field::operator=(ptf.patchInternalField()); + Field::operator=(this->patchInternalField()); } diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H index d7ef103d16..ba296fb124 100644 --- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H @@ -432,35 +432,11 @@ public: // Member operators - virtual void operator= - ( - const pointPatchField& - ) - {} - - virtual void operator+= - ( - const pointPatchField& - ) - {} - - virtual void operator-= - ( - const pointPatchField& - ) - {} - - virtual void operator*= - ( - const pointPatchField& - ) - {} - - virtual void operator/= - ( - const pointPatchField& - ) - {} + virtual void operator=(const pointPatchField&){} + virtual void operator+=(const pointPatchField&){} + virtual void operator-=(const pointPatchField&){} + virtual void operator*=(const pointPatchField&){} + virtual void operator/=(const pointPatchField&){} virtual void operator=(const Field&){} virtual void operator+=(const Field&){} @@ -480,12 +456,7 @@ public: // By generic these do nothing unless the patch actually has boundary // values - virtual void operator== - ( - const pointPatchField& - ) - {} - + virtual void operator==(const pointPatchField&){} virtual void operator==(const Field&){} virtual void operator==(const Type&){} @@ -527,7 +498,7 @@ const pointPatchField& operator+ #endif -#define addToPointPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField) \ +#define addToPointPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField) \ addToRunTimeSelectionTable \ ( \ PatchTypeField, \