Skip to content
Snippets Groups Projects
Commit bd1e1ec9 authored by Kutalmış Berçin's avatar Kutalmış Berçin
Browse files

ENH: uniformFixedValue: avoid unallocated autoPtr error

parent ddf9d528
Branches
Tags
No related merge requests found
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2018-2020 OpenCFD Ltd. Copyright (C) 2018-2023 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
...@@ -130,7 +130,11 @@ void Foam::uniformFixedValueFvPatchField<Type>::autoMap ...@@ -130,7 +130,11 @@ void Foam::uniformFixedValueFvPatchField<Type>::autoMap
) )
{ {
fixedValueFvPatchField<Type>::autoMap(mapper); fixedValueFvPatchField<Type>::autoMap(mapper);
refValueFunc_().autoMap(mapper);
if (refValueFunc_)
{
refValueFunc_().autoMap(mapper);
}
if (refValueFunc_().constant()) if (refValueFunc_().constant())
{ {
...@@ -152,7 +156,10 @@ void Foam::uniformFixedValueFvPatchField<Type>::rmap ...@@ -152,7 +156,10 @@ void Foam::uniformFixedValueFvPatchField<Type>::rmap
const uniformFixedValueFvPatchField& tiptf = const uniformFixedValueFvPatchField& tiptf =
refCast<const uniformFixedValueFvPatchField>(ptf); refCast<const uniformFixedValueFvPatchField>(ptf);
refValueFunc_().rmap(tiptf.refValueFunc_(), addr); if (refValueFunc_)
{
refValueFunc_().rmap(tiptf.refValueFunc_(), addr);
}
} }
...@@ -174,7 +181,12 @@ template<class Type> ...@@ -174,7 +181,12 @@ template<class Type>
void Foam::uniformFixedValueFvPatchField<Type>::write(Ostream& os) const void Foam::uniformFixedValueFvPatchField<Type>::write(Ostream& os) const
{ {
fvPatchField<Type>::write(os); fvPatchField<Type>::write(os);
refValueFunc_->writeData(os);
if (refValueFunc_)
{
refValueFunc_->writeData(os);
}
fvPatchField<Type>::writeValueEntry(os); fvPatchField<Type>::writeValueEntry(os);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment