uniformFixedValueFvPatchField: updated copy constructors to clone table only when allocated

This commit is contained in:
Henry
2012-12-22 21:26:32 +00:00
parent 0e1153b6c6
commit c130b38e22

View File

@ -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));
}
}