Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

uniformFixedValueFvPatchField: updated copy constructors to clone tab…

…le only when allocated

Resolves bug-report: http://www.openfoam.org/mantisbt/view.php?id=709
  • Loading branch information...
commit 45bb1ecfe0c7338c152ae0ddd6dadb68fcb81a4a 1 parent 0eb2250
Henry authored
View
26 ...niteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C
@@ -84,10 +84,19 @@ uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField
)
:
fixedValueFvPatchField<Type>(ptf),
- uniformValue_(ptf.uniformValue_().clone().ptr())
+ uniformValue_
+ (
+ ptf.uniformValue_.valid()
+ ? ptf.uniformValue_().clone().ptr()
+ : NULL
+ )
{
const scalar t = this->db().time().timeOutputValue();
- fvPatchField<Type>::operator==(uniformValue_->value(t));
+
+ if (ptf.uniformValue_.valid())
+ {
+ fvPatchField<Type>::operator==(uniformValue_->value(t));
+ }
}
@@ -99,10 +108,19 @@ uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField
)
:
fixedValueFvPatchField<Type>(ptf, iF),
- uniformValue_(ptf.uniformValue_().clone().ptr())
+ uniformValue_
+ (
+ ptf.uniformValue_.valid()
+ ? ptf.uniformValue_().clone().ptr()
+ : NULL
+ )
{
const scalar t = this->db().time().timeOutputValue();
- fvPatchField<Type>::operator==(uniformValue_->value(t));
+
+ if (ptf.uniformValue_.valid())
+ {
+ fvPatchField<Type>::operator==(uniformValue_->value(t));
+ }
}

0 comments on commit 45bb1ec

Please sign in to comment.
Something went wrong with that request. Please try again.