diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C index 21f03aea9fb268677fc148a92516ce08448d3963..1f07b1bb14c8f893c204cea6f06628092929e64a 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C @@ -105,7 +105,12 @@ uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField ) : fixedValueFvPatchField<Type>(ptf), - uniformValue_(ptf.uniformValue_().clone().ptr()) + uniformValue_ + ( + ptf.uniformValue_.valid() + ? ptf.uniformValue_().clone().ptr() + : NULL + ) {} @@ -117,11 +122,20 @@ uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField ) : fixedValueFvPatchField<Type>(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<Type>::operator==(uniformValue_->value(t)); + + if (ptf.uniformValue_.valid()) + { + fvPatchField<Type>::operator==(uniformValue_->value(t)); + } }