patchFields: Consistent patchType handling across field types
The patchType override logic has been simplified and made consistent between fv, fvs and point patch fields. The "constraintType" attribute has been removed from point fields as it was not being used.
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -115,15 +115,6 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Constraint handling
|
|
||||||
|
|
||||||
//- Return the constraint type this pointPatchField implements
|
|
||||||
virtual const word& constraintType() const
|
|
||||||
{
|
|
||||||
return cyclicPointPatch::typeName;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Cyclic coupled interface functions
|
// Cyclic coupled interface functions
|
||||||
|
|
||||||
//- Return transformation between the coupled patches
|
//- Return transformation between the coupled patches
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -107,17 +107,6 @@ public:
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Constraint handling
|
|
||||||
|
|
||||||
//- Return the constraint type this pointPatchField implements
|
|
||||||
virtual const word& constraintType() const
|
|
||||||
{
|
|
||||||
return type();
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -108,15 +108,6 @@ public:
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Return the constraint type this pointPatchField implements
|
|
||||||
virtual const word& constraintType() const
|
|
||||||
{
|
|
||||||
return internalPointPatch::typeName;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -135,15 +135,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Constraint handling
|
|
||||||
|
|
||||||
//- Return the constraint type this pointPatchField implements
|
|
||||||
virtual const word& constraintType() const
|
|
||||||
{
|
|
||||||
return type();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Evaluation functions
|
// Evaluation functions
|
||||||
|
|
||||||
//- Evaluate the patch field
|
//- Evaluate the patch field
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -107,16 +107,6 @@ public:
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Return the constraint type this pointPatchField implements
|
|
||||||
virtual const word& constraintType() const
|
|
||||||
{
|
|
||||||
return symmetryPointPatch::typeName;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -116,12 +116,6 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Return the constraint type this pointPatchField implements
|
|
||||||
virtual const word& constraintType() const
|
|
||||||
{
|
|
||||||
return symmetryPlanePointPatch::typeName;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Update the patch field
|
//- Update the patch field
|
||||||
virtual void evaluate
|
virtual void evaluate
|
||||||
(
|
(
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -110,12 +110,6 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Return the constraint type this pointPatchField implements
|
|
||||||
virtual const word& constraintType() const
|
|
||||||
{
|
|
||||||
return type();
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Update the patch field
|
//- Update the patch field
|
||||||
virtual void evaluate
|
virtual void evaluate
|
||||||
(
|
(
|
||||||
|
|||||||
@ -283,16 +283,10 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return the constraint type this pointPatchField implements.
|
|
||||||
virtual const word& constraintType() const
|
|
||||||
{
|
|
||||||
return word::null;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return true if this overrides the underlying constraint type
|
//- Return true if this overrides the underlying constraint type
|
||||||
bool overridesConstraint() const
|
bool overridesConstraint() const
|
||||||
{
|
{
|
||||||
if (constraintType() == patch_.constraintType())
|
if (type() == patch_.type())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,7 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
|
Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
|
||||||
@ -36,7 +36,11 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
InfoInFunction << "Constructing pointPatchField<Type>" << endl;
|
InfoInFunction
|
||||||
|
<< "patchFieldType = " << patchFieldType
|
||||||
|
<< ", actualPatchType = " << actualPatchType
|
||||||
|
<< ", patchType = " << p.type()
|
||||||
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
typename pointPatchConstructorTable::iterator cstrIter =
|
typename pointPatchConstructorTable::iterator cstrIter =
|
||||||
@ -45,41 +49,35 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
|
|||||||
if (cstrIter == pointPatchConstructorTablePtr_->end())
|
if (cstrIter == pointPatchConstructorTablePtr_->end())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Unknown patchFieldType type "
|
<< "Unknown patchField type "
|
||||||
<< patchFieldType << nl << nl
|
<< patchFieldType << nl << nl
|
||||||
<< "Valid patchField types are :" << endl
|
<< "Valid patchField types are :" << endl
|
||||||
<< pointPatchConstructorTablePtr_->sortedToc()
|
<< pointPatchConstructorTablePtr_->sortedToc()
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
autoPtr<pointPatchField<Type>> pfPtr(cstrIter()(p, iF));
|
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
actualPatchType == word::null
|
actualPatchType == word::null
|
||||||
|| actualPatchType != p.type()
|
|| actualPatchType != p.type()
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (pfPtr().constraintType() != p.constraintType())
|
|
||||||
{
|
|
||||||
// Use default constraint type
|
|
||||||
typename pointPatchConstructorTable::iterator patchTypeCstrIter =
|
typename pointPatchConstructorTable::iterator patchTypeCstrIter =
|
||||||
pointPatchConstructorTablePtr_->find(p.type());
|
pointPatchConstructorTablePtr_->find(p.type());
|
||||||
|
|
||||||
if (patchTypeCstrIter == pointPatchConstructorTablePtr_->end())
|
if (patchTypeCstrIter != pointPatchConstructorTablePtr_->end())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
|
||||||
<< "inconsistent patch and patchField types for \n"
|
|
||||||
<< " patch type " << p.type()
|
|
||||||
<< " and patchField type " << patchFieldType
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
return patchTypeCstrIter()(p, iF);
|
return patchTypeCstrIter()(p, iF);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return cstrIter()(p, iF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return cstrIter()(p, iF);
|
||||||
}
|
}
|
||||||
|
|
||||||
return pfPtr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -103,13 +101,18 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
word patchFieldType(dict.lookup("type"));
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
InfoInFunction << "Constructing pointPatchField<Type>" << endl;
|
InfoInFunction
|
||||||
|
<< "patchFieldType = " << patchFieldType
|
||||||
|
<< ", actualPatchType = "
|
||||||
|
<< dict.lookupOrDefault<word>("patchType", word::null)
|
||||||
|
<< ", patchType = " << p.type()
|
||||||
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
word patchFieldType(dict.lookup("type"));
|
|
||||||
|
|
||||||
typename dictionaryConstructorTable::iterator cstrIter
|
typename dictionaryConstructorTable::iterator cstrIter
|
||||||
= dictionaryConstructorTablePtr_->find(patchFieldType);
|
= dictionaryConstructorTablePtr_->find(patchFieldType);
|
||||||
|
|
||||||
@ -133,27 +136,20 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Construct (but not necessarily returned)
|
|
||||||
autoPtr<pointPatchField<Type>> pfPtr(cstrIter()(p, iF, dict));
|
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
!dict.found("patchType")
|
!dict.found("patchType")
|
||||||
|| word(dict.lookup("patchType")) != p.type()
|
|| word(dict.lookup("patchType")) != p.type()
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (pfPtr().constraintType() == p.constraintType())
|
typename dictionaryConstructorTable::iterator patchTypeCstrIter =
|
||||||
{
|
dictionaryConstructorTablePtr_->find(p.type());
|
||||||
// Compatible (constraint-wise) with the patch type
|
|
||||||
return pfPtr;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Use default constraint type
|
|
||||||
typename dictionaryConstructorTable::iterator patchTypeCstrIter
|
|
||||||
= dictionaryConstructorTablePtr_->find(p.type());
|
|
||||||
|
|
||||||
if (patchTypeCstrIter == dictionaryConstructorTablePtr_->end())
|
if
|
||||||
|
(
|
||||||
|
patchTypeCstrIter != dictionaryConstructorTablePtr_->end()
|
||||||
|
&& patchTypeCstrIter() != cstrIter()
|
||||||
|
)
|
||||||
{
|
{
|
||||||
FatalIOErrorInFunction
|
FatalIOErrorInFunction
|
||||||
(
|
(
|
||||||
@ -163,9 +159,6 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
|
|||||||
<< " and patchField type " << patchFieldType
|
<< " and patchField type " << patchFieldType
|
||||||
<< exit(FatalIOError);
|
<< exit(FatalIOError);
|
||||||
}
|
}
|
||||||
|
|
||||||
return patchTypeCstrIter()(p, iF, dict);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return cstrIter()(p, iF, dict);
|
return cstrIter()(p, iF, dict);
|
||||||
@ -192,8 +185,7 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
|
|||||||
if (cstrIter == patchMapperConstructorTablePtr_->end())
|
if (cstrIter == patchMapperConstructorTablePtr_->end())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Unknown patchField type "
|
<< "Unknown patchField type " << ptf.type() << nl << nl
|
||||||
<< ptf.type() << nl << nl
|
|
||||||
<< "Valid patchField types are :" << endl
|
<< "Valid patchField types are :" << endl
|
||||||
<< patchMapperConstructorTablePtr_->sortedToc()
|
<< patchMapperConstructorTablePtr_->sortedToc()
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -112,12 +112,6 @@ public:
|
|||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- Return the constraint type this pointPatch implements.
|
|
||||||
virtual const word& constraintType() const
|
|
||||||
{
|
|
||||||
return type();
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return the underlying cyclicPolyPatch
|
//- Return the underlying cyclicPolyPatch
|
||||||
const cyclicPolyPatch& cyclicPatch() const
|
const cyclicPolyPatch& cyclicPatch() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -73,12 +73,6 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Return the constraint type this pointPatch implements.
|
|
||||||
virtual const word& constraintType() const
|
|
||||||
{
|
|
||||||
return type();
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Accumulate the effect of constraint direction of this patch
|
//- Accumulate the effect of constraint direction of this patch
|
||||||
virtual void applyConstraint
|
virtual void applyConstraint
|
||||||
(
|
(
|
||||||
|
|||||||
@ -72,15 +72,6 @@ public:
|
|||||||
:
|
:
|
||||||
facePointPatch(patch, bm)
|
facePointPatch(patch, bm)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Return the constraint type this pointPatch implements.
|
|
||||||
virtual const word& constraintType() const
|
|
||||||
{
|
|
||||||
return type();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -127,12 +127,6 @@ public:
|
|||||||
return procPolyPatch_.comm();
|
return procPolyPatch_.comm();
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return the constraint type this pointPatch implements.
|
|
||||||
virtual const word& constraintType() const
|
|
||||||
{
|
|
||||||
return type();
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return processor number
|
//- Return processor number
|
||||||
int myProcNo() const
|
int myProcNo() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -76,12 +76,6 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Return the constraint type this pointPatch implements.
|
|
||||||
virtual const word& constraintType() const
|
|
||||||
{
|
|
||||||
return type();
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Accumulate the effect of constraint direction of this patch
|
//- Accumulate the effect of constraint direction of this patch
|
||||||
virtual void applyConstraint
|
virtual void applyConstraint
|
||||||
(
|
(
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -75,12 +75,6 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Return the constraint type this pointPatch implements.
|
|
||||||
virtual const word& constraintType() const
|
|
||||||
{
|
|
||||||
return type();
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Accumulate the effect of constraint direction of this patch
|
//- Accumulate the effect of constraint direction of this patch
|
||||||
virtual void applyConstraint
|
virtual void applyConstraint
|
||||||
(
|
(
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -75,12 +75,6 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Return the constraint type this pointPatch implements.
|
|
||||||
virtual const word& constraintType() const
|
|
||||||
{
|
|
||||||
return type();
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Accumulate the effect of constraint direction of this patch
|
//- Accumulate the effect of constraint direction of this patch
|
||||||
virtual void applyConstraint
|
virtual void applyConstraint
|
||||||
(
|
(
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -151,12 +151,6 @@ public:
|
|||||||
//- Return point normals
|
//- Return point normals
|
||||||
virtual const vectorField& pointNormals() const = 0;
|
virtual const vectorField& pointNormals() const = 0;
|
||||||
|
|
||||||
//- Return the constraint type this pointPatch implements.
|
|
||||||
virtual const word& constraintType() const
|
|
||||||
{
|
|
||||||
return word::null;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Accumulate the effect of constraint direction of this patch
|
//- Accumulate the effect of constraint direction of this patch
|
||||||
virtual void applyConstraint
|
virtual void applyConstraint
|
||||||
(
|
(
|
||||||
|
|||||||
@ -38,7 +38,8 @@ Foam::tmp<Foam::fvPatchField<Type>> Foam::fvPatchField<Type>::New
|
|||||||
{
|
{
|
||||||
InfoInFunction
|
InfoInFunction
|
||||||
<< "patchFieldType = " << patchFieldType
|
<< "patchFieldType = " << patchFieldType
|
||||||
<< " : " << p.type()
|
<< ", actualPatchType = " << actualPatchType
|
||||||
|
<< ", patchType = " << p.type()
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,6 +107,9 @@ Foam::tmp<Foam::fvPatchField<Type>> Foam::fvPatchField<Type>::New
|
|||||||
{
|
{
|
||||||
InfoInFunction
|
InfoInFunction
|
||||||
<< "patchFieldType = " << patchFieldType
|
<< "patchFieldType = " << patchFieldType
|
||||||
|
<< ", actualPatchType = "
|
||||||
|
<< dict.lookupOrDefault<word>("patchType", word::null)
|
||||||
|
<< ", patchType = " << p.type()
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -161,6 +161,12 @@ template<class Type>
|
|||||||
void Foam::fvsPatchField<Type>::write(Ostream& os) const
|
void Foam::fvsPatchField<Type>::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
writeEntry(os, "type", type());
|
writeEntry(os, "type", type());
|
||||||
|
|
||||||
|
if (overridesConstraint())
|
||||||
|
{
|
||||||
|
writeEntry(os, "patchType", patch().type());
|
||||||
|
}
|
||||||
|
|
||||||
writeEntry(os, "value", *this);
|
writeEntry(os, "value", *this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -282,6 +282,42 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
// Attributes
|
||||||
|
|
||||||
|
//- Return the type of the calculated for of fvsPatchField
|
||||||
|
static const word& calculatedType();
|
||||||
|
|
||||||
|
//- Return true if this patch field fixes a value.
|
||||||
|
// Needed to check if a level has to be specified while solving
|
||||||
|
// Poissons equations.
|
||||||
|
virtual bool fixesValue() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return true if this patch field is coupled
|
||||||
|
virtual bool coupled() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return true if this overrides the underlying constraint type
|
||||||
|
bool overridesConstraint() const
|
||||||
|
{
|
||||||
|
if (type() == patch_.type())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
typename patchConstructorTable::iterator patchTypeCstrIter
|
||||||
|
= patchConstructorTablePtr_->find(patch_.type());
|
||||||
|
|
||||||
|
return
|
||||||
|
patchTypeCstrIter
|
||||||
|
!= patchConstructorTablePtr_->end();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- Return local objectRegistry
|
//- Return local objectRegistry
|
||||||
@ -306,23 +342,6 @@ public:
|
|||||||
return internalField_;
|
return internalField_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return the type of the calculated for of fvsPatchField
|
|
||||||
static const word& calculatedType();
|
|
||||||
|
|
||||||
//- Return true if this patch field fixes a value.
|
|
||||||
// Needed to check if a level has to be specified while solving
|
|
||||||
// Poissons equations.
|
|
||||||
virtual bool fixesValue() const
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return true if this patch field is coupled
|
|
||||||
virtual bool coupled() const
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Mapping functions
|
// Mapping functions
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -36,7 +36,11 @@ Foam::tmp<Foam::fvsPatchField<Type>> Foam::fvsPatchField<Type>::New
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
InfoInFunction << "Constructing fvsPatchField<Type>" << endl;
|
InfoInFunction
|
||||||
|
<< "patchFieldType = " << patchFieldType
|
||||||
|
<< ", actualPatchType = " << actualPatchType
|
||||||
|
<< ", patchType = " << p.type()
|
||||||
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
typename patchConstructorTable::iterator cstrIter =
|
typename patchConstructorTable::iterator cstrIter =
|
||||||
@ -97,13 +101,18 @@ Foam::tmp<Foam::fvsPatchField<Type>> Foam::fvsPatchField<Type>::New
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
const word patchFieldType(dict.lookup("type"));
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
InfoInFunction << "Constructing fvsPatchField<Type>" << endl;
|
InfoInFunction
|
||||||
|
<< "patchFieldType = " << patchFieldType
|
||||||
|
<< ", actualPatchType = "
|
||||||
|
<< dict.lookupOrDefault<word>("patchType", word::null)
|
||||||
|
<< ", patchType = " << p.type()
|
||||||
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const word patchFieldType(dict.lookup("type"));
|
|
||||||
|
|
||||||
typename dictionaryConstructorTable::iterator cstrIter
|
typename dictionaryConstructorTable::iterator cstrIter
|
||||||
= dictionaryConstructorTablePtr_->find(patchFieldType);
|
= dictionaryConstructorTablePtr_->find(patchFieldType);
|
||||||
|
|
||||||
@ -182,17 +191,7 @@ Foam::tmp<Foam::fvsPatchField<Type>> Foam::fvsPatchField<Type>::New
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
typename patchMapperConstructorTable::iterator
|
|
||||||
patchTypeCstrIter = patchMapperConstructorTablePtr_->find(p.type());
|
|
||||||
|
|
||||||
if (patchTypeCstrIter != patchMapperConstructorTablePtr_->end())
|
|
||||||
{
|
|
||||||
return patchTypeCstrIter()(ptf, p, iF, pfMapper);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return cstrIter()(ptf, p, iF, pfMapper);
|
return cstrIter()(ptf, p, iF, pfMapper);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -109,12 +109,6 @@ public:
|
|||||||
//- Return true if this patch field is coupled
|
//- Return true if this patch field is coupled
|
||||||
virtual bool coupled() const;
|
virtual bool coupled() const;
|
||||||
|
|
||||||
//- Return the constraint type this pointPatch implements.
|
|
||||||
virtual const word& constraintType() const
|
|
||||||
{
|
|
||||||
return type();
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return the underlying cyclicAMIPolyPatch
|
//- Return the underlying cyclicAMIPolyPatch
|
||||||
const cyclicAMIPolyPatch& cyclicAMIPatch() const
|
const cyclicAMIPolyPatch& cyclicAMIPatch() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -160,15 +160,6 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Constraint handling
|
|
||||||
|
|
||||||
//- Return the constraint type this pointPatchField implements
|
|
||||||
virtual const word& constraintType() const
|
|
||||||
{
|
|
||||||
return type();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Cyclic AMI coupled interface functions
|
// Cyclic AMI coupled interface functions
|
||||||
|
|
||||||
//- Return transformation between the coupled patches
|
//- Return transformation between the coupled patches
|
||||||
|
|||||||
Reference in New Issue
Block a user