From c130b38e228879414d7ebfd26c22b61eabbe8cc6 Mon Sep 17 00:00:00 2001 From: Henry Date: Sat, 22 Dec 2012 21:26:32 +0000 Subject: [PATCH] uniformFixedValueFvPatchField: updated copy constructors to clone table only when allocated --- .../uniformFixedValueFvPatchField.C | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C index 21f03aea9f..1f07b1bb14 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C @@ -105,7 +105,12 @@ uniformFixedValueFvPatchField::uniformFixedValueFvPatchField ) : fixedValueFvPatchField(ptf), - uniformValue_(ptf.uniformValue_().clone().ptr()) + uniformValue_ + ( + ptf.uniformValue_.valid() + ? ptf.uniformValue_().clone().ptr() + : NULL + ) {} @@ -117,11 +122,20 @@ uniformFixedValueFvPatchField::uniformFixedValueFvPatchField ) : fixedValueFvPatchField(ptf, iF), - uniformValue_(ptf.uniformValue_().clone().ptr()) + uniformValue_ + ( + ptf.uniformValue_.valid() + ? ptf.uniformValue_().clone().ptr() + : NULL + ) { // For safety re-evaluate const scalar t = this->db().time().timeOutputValue(); - fvPatchField::operator==(uniformValue_->value(t)); + + if (ptf.uniformValue_.valid()) + { + fvPatchField::operator==(uniformValue_->value(t)); + } }