Commit c111b59e authored by mattijs's avatar mattijs
Browse files

ENH: fvPatchField: store patchType if construct from words

parent f5abba4d
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -278,6 +278,18 @@ public:
return internalField_;
}
//- Optional patch type
const word& patchType() const
{
return patchType_;
}
//- Optional patch type
word& patchType()
{
return patchType_;
}
//- Return true if this patch field fixes a value
virtual bool fixesValue() const
{
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield |2011 OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -89,6 +89,13 @@ Foam::autoPtr<Foam::pointPatchField<Type> > Foam::pointPatchField<Type>::New
return patchTypeCstrIter()(p, iF);
}
}
else
{
if (pointPatchConstructorTablePtr_->found(p.type()))
{
pfPtr().patchType() = actualPatchType;
}
}
return pfPtr;
}
......
......@@ -308,6 +308,18 @@ public:
return internalField_;
}
//- Optional patch type
const word& patchType() const
{
return patchType_;
}
//- Optional patch type
word& patchType()
{
return patchType_;
}
//- Return the type of the calculated for of fvPatchField
static const word& calculatedType();
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -60,15 +60,15 @@ Foam::tmp<Foam::fvPatchField<Type> > Foam::fvPatchField<Type>::New
<< exit(FatalError);
}
typename patchConstructorTable::iterator patchTypeCstrIter =
patchConstructorTablePtr_->find(p.type());
if
(
actualPatchType == word::null
|| actualPatchType != p.type()
)
{
typename patchConstructorTable::iterator patchTypeCstrIter =
patchConstructorTablePtr_->find(p.type());
if (patchTypeCstrIter != patchConstructorTablePtr_->end())
{
return patchTypeCstrIter()(p, iF);
......@@ -80,7 +80,14 @@ Foam::tmp<Foam::fvPatchField<Type> > Foam::fvPatchField<Type>::New
}
else
{
return cstrIter()(p, iF);
tmp<fvPatchField<Type> > tfvp = cstrIter()(p, iF);
// Check if constraint type override and store patchType if so
if ((patchTypeCstrIter != patchConstructorTablePtr_->end()))
{
tfvp().patchType() = actualPatchType;
}
return tfvp;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment