mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Allow derivation of constraint types (for pointFields only). Allow usage of
non constraint patchFields on constraint patch types (all fields)
This commit is contained in:
@ -72,7 +72,8 @@ GeometricBoundaryField
|
|||||||
(
|
(
|
||||||
const BoundaryMesh& bmesh,
|
const BoundaryMesh& bmesh,
|
||||||
const DimensionedField<Type, GeoMesh>& field,
|
const DimensionedField<Type, GeoMesh>& field,
|
||||||
const wordList& patchFieldTypes
|
const wordList& patchFieldTypes,
|
||||||
|
const wordList& constraintTypes
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
FieldField<PatchField, Type>(bmesh.size()),
|
FieldField<PatchField, Type>(bmesh.size()),
|
||||||
@ -83,18 +84,22 @@ GeometricBoundaryField
|
|||||||
Info<< "GeometricField<Type, PatchField, GeoMesh>::"
|
Info<< "GeometricField<Type, PatchField, GeoMesh>::"
|
||||||
"GeometricBoundaryField::"
|
"GeometricBoundaryField::"
|
||||||
"GeometricBoundaryField(const BoundaryMesh&, "
|
"GeometricBoundaryField(const BoundaryMesh&, "
|
||||||
"const Field<Type>&, const wordList&)"
|
"const Field<Type>&, const wordList&, const wordList&)"
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (patchFieldTypes.size() != this->size())
|
if
|
||||||
|
(
|
||||||
|
patchFieldTypes.size() != this->size()
|
||||||
|
|| (constraintTypes.size() && (constraintTypes.size() != this->size()))
|
||||||
|
)
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"GeometricField<Type, PatchField, GeoMesh>::"
|
"GeometricField<Type, PatchField, GeoMesh>::"
|
||||||
"GeometricBoundaryField::"
|
"GeometricBoundaryField::"
|
||||||
"GeometricBoundaryField(const BoundaryMesh&, "
|
"GeometricBoundaryField(const BoundaryMesh&, "
|
||||||
"const Field<Type>&, const wordList&)"
|
"const Field<Type>&, const wordList&, const wordList&)"
|
||||||
) << "Incorrect number of patch type specifications given" << nl
|
) << "Incorrect number of patch type specifications given" << nl
|
||||||
<< " Number of patches in mesh = " << bmesh.size()
|
<< " Number of patches in mesh = " << bmesh.size()
|
||||||
<< " number of patch type specifications = "
|
<< " number of patch type specifications = "
|
||||||
@ -102,18 +107,38 @@ GeometricBoundaryField
|
|||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(bmesh_, patchi)
|
if (constraintTypes.size())
|
||||||
{
|
{
|
||||||
set
|
forAll(bmesh_, patchi)
|
||||||
(
|
{
|
||||||
patchi,
|
set
|
||||||
PatchField<Type>::New
|
|
||||||
(
|
(
|
||||||
patchFieldTypes[patchi],
|
patchi,
|
||||||
bmesh_[patchi],
|
PatchField<Type>::New
|
||||||
field
|
(
|
||||||
)
|
patchFieldTypes[patchi],
|
||||||
);
|
constraintTypes[patchi],
|
||||||
|
bmesh_[patchi],
|
||||||
|
field
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
forAll(bmesh_, patchi)
|
||||||
|
{
|
||||||
|
set
|
||||||
|
(
|
||||||
|
patchi,
|
||||||
|
PatchField<Type>::New
|
||||||
|
(
|
||||||
|
patchFieldTypes[patchi],
|
||||||
|
bmesh_[patchi],
|
||||||
|
field
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -231,14 +231,15 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
|
|||||||
const IOobject& io,
|
const IOobject& io,
|
||||||
const Mesh& mesh,
|
const Mesh& mesh,
|
||||||
const dimensionSet& ds,
|
const dimensionSet& ds,
|
||||||
const wordList& patchFieldTypes
|
const wordList& patchFieldTypes,
|
||||||
|
const wordList& actualPatchTypes
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
DimensionedField<Type, GeoMesh>(io, mesh, ds),
|
DimensionedField<Type, GeoMesh>(io, mesh, ds),
|
||||||
timeIndex_(this->time().timeIndex()),
|
timeIndex_(this->time().timeIndex()),
|
||||||
field0Ptr_(NULL),
|
field0Ptr_(NULL),
|
||||||
fieldPrevIterPtr_(NULL),
|
fieldPrevIterPtr_(NULL),
|
||||||
boundaryField_(mesh.boundary(), *this, patchFieldTypes)
|
boundaryField_(mesh.boundary(), *this, patchFieldTypes, actualPatchTypes)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
@ -287,14 +288,15 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
|
|||||||
const IOobject& io,
|
const IOobject& io,
|
||||||
const Mesh& mesh,
|
const Mesh& mesh,
|
||||||
const dimensioned<Type>& dt,
|
const dimensioned<Type>& dt,
|
||||||
const wordList& patchFieldTypes
|
const wordList& patchFieldTypes,
|
||||||
|
const wordList& actualPatchTypes
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
DimensionedField<Type, GeoMesh>(io, mesh, dt),
|
DimensionedField<Type, GeoMesh>(io, mesh, dt),
|
||||||
timeIndex_(this->time().timeIndex()),
|
timeIndex_(this->time().timeIndex()),
|
||||||
field0Ptr_(NULL),
|
field0Ptr_(NULL),
|
||||||
fieldPrevIterPtr_(NULL),
|
fieldPrevIterPtr_(NULL),
|
||||||
boundaryField_(mesh.boundary(), *this, patchFieldTypes)
|
boundaryField_(mesh.boundary(), *this, patchFieldTypes, actualPatchTypes)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
@ -653,14 +655,22 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
|
|||||||
(
|
(
|
||||||
const IOobject& io,
|
const IOobject& io,
|
||||||
const GeometricField<Type, PatchField, GeoMesh>& gf,
|
const GeometricField<Type, PatchField, GeoMesh>& gf,
|
||||||
const wordList& patchFieldTypes
|
const wordList& patchFieldTypes,
|
||||||
|
const wordList& actualPatchTypes
|
||||||
|
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
DimensionedField<Type, GeoMesh>(io, gf),
|
DimensionedField<Type, GeoMesh>(io, gf),
|
||||||
timeIndex_(gf.timeIndex()),
|
timeIndex_(gf.timeIndex()),
|
||||||
field0Ptr_(NULL),
|
field0Ptr_(NULL),
|
||||||
fieldPrevIterPtr_(NULL),
|
fieldPrevIterPtr_(NULL),
|
||||||
boundaryField_(this->mesh().boundary(), *this, patchFieldTypes)
|
boundaryField_
|
||||||
|
(
|
||||||
|
this->mesh().boundary(),
|
||||||
|
*this,
|
||||||
|
patchFieldTypes,
|
||||||
|
actualPatchTypes
|
||||||
|
)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -128,12 +128,14 @@ public:
|
|||||||
|
|
||||||
//- Construct from a BoundaryMesh,
|
//- Construct from a BoundaryMesh,
|
||||||
// reference to the internal field
|
// reference to the internal field
|
||||||
// and a wordList of patch types
|
// and a wordList of patch types and optional the actual patch
|
||||||
|
// types (to override constraint patches)
|
||||||
GeometricBoundaryField
|
GeometricBoundaryField
|
||||||
(
|
(
|
||||||
const BoundaryMesh&,
|
const BoundaryMesh&,
|
||||||
const DimensionedInternalField&,
|
const DimensionedInternalField&,
|
||||||
const wordList&
|
const wordList& wantedPatchTypes,
|
||||||
|
const wordList& actualPatchTypes = wordList()
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct from a BoundaryMesh,
|
//- Construct from a BoundaryMesh,
|
||||||
@ -283,7 +285,8 @@ public:
|
|||||||
const IOobject&,
|
const IOobject&,
|
||||||
const Mesh&,
|
const Mesh&,
|
||||||
const dimensionSet&,
|
const dimensionSet&,
|
||||||
const wordList& patchFieldTypes
|
const wordList& wantedPatchTypes,
|
||||||
|
const wordList& actualPatchTypes = wordList()
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Constructor given IOobject, mesh, dimensioned<Type> and patch type.
|
//- Constructor given IOobject, mesh, dimensioned<Type> and patch type.
|
||||||
@ -301,7 +304,8 @@ public:
|
|||||||
const IOobject&,
|
const IOobject&,
|
||||||
const Mesh&,
|
const Mesh&,
|
||||||
const dimensioned<Type>&,
|
const dimensioned<Type>&,
|
||||||
const wordList& patchFieldTypes
|
const wordList& wantedPatchTypes,
|
||||||
|
const wordList& actualPatchTypes = wordList()
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Constructor from components
|
//- Constructor from components
|
||||||
@ -387,7 +391,8 @@ public:
|
|||||||
(
|
(
|
||||||
const IOobject&,
|
const IOobject&,
|
||||||
const GeometricField<Type, PatchField, GeoMesh>&,
|
const GeometricField<Type, PatchField, GeoMesh>&,
|
||||||
const wordList& patchFieldTypes
|
const wordList& patchFieldTypes,
|
||||||
|
const wordList& actualPatchTypes = wordList()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -29,6 +29,7 @@ template<class Type>
|
|||||||
Foam::autoPtr<Foam::pointPatchField<Type> > Foam::pointPatchField<Type>::New
|
Foam::autoPtr<Foam::pointPatchField<Type> > Foam::pointPatchField<Type>::New
|
||||||
(
|
(
|
||||||
const word& patchFieldType,
|
const word& patchFieldType,
|
||||||
|
const word& actualPatchType,
|
||||||
const pointPatch& p,
|
const pointPatch& p,
|
||||||
const DimensionedField<Type, pointMesh>& iF
|
const DimensionedField<Type, pointMesh>& iF
|
||||||
)
|
)
|
||||||
@ -36,7 +37,8 @@ Foam::autoPtr<Foam::pointPatchField<Type> > Foam::pointPatchField<Type>::New
|
|||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "PointPatchField<Type>::"
|
Info<< "PointPatchField<Type>::"
|
||||||
"New(const word&, const pointPatch&, const Field<Type>&) : "
|
"New(const word&, const word&"
|
||||||
|
", const pointPatch&, const Field<Type>&) : "
|
||||||
"constructing pointPatchField<Type>"
|
"constructing pointPatchField<Type>"
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
@ -49,7 +51,7 @@ Foam::autoPtr<Foam::pointPatchField<Type> > Foam::pointPatchField<Type>::New
|
|||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"PointPatchField<Type>::New"
|
"PointPatchField<Type>::New"
|
||||||
"(const word&, const pointPatch&, const Field<Type>&)"
|
"(const word&, const word&, const pointPatch&, const Field<Type>&)"
|
||||||
) << "Unknown patchFieldType type "
|
) << "Unknown patchFieldType type "
|
||||||
<< patchFieldType
|
<< patchFieldType
|
||||||
<< endl << endl
|
<< endl << endl
|
||||||
@ -60,31 +62,48 @@ Foam::autoPtr<Foam::pointPatchField<Type> > Foam::pointPatchField<Type>::New
|
|||||||
|
|
||||||
autoPtr<pointPatchField<Type> > pfPtr(cstrIter()(p, iF));
|
autoPtr<pointPatchField<Type> > pfPtr(cstrIter()(p, iF));
|
||||||
|
|
||||||
if (pfPtr().constraintType() == p.constraintType())
|
if
|
||||||
|
(
|
||||||
|
actualPatchType == word::null
|
||||||
|
|| actualPatchType != p.type()
|
||||||
|
)
|
||||||
{
|
{
|
||||||
// Compatible (constraint-wise) with the patch type
|
if (pfPtr().constraintType() != p.constraintType())
|
||||||
return pfPtr;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Use default constraint type
|
|
||||||
typename pointPatchConstructorTable::iterator patchTypeCstrIter =
|
|
||||||
pointPatchConstructorTablePtr_->find(p.type());
|
|
||||||
|
|
||||||
if (patchTypeCstrIter == pointPatchConstructorTablePtr_->end())
|
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
// Use default constraint type
|
||||||
(
|
typename pointPatchConstructorTable::iterator patchTypeCstrIter =
|
||||||
"PointPatchField<Type>::New"
|
pointPatchConstructorTablePtr_->find(p.type());
|
||||||
"(const word&, const pointPatch&, const Field<Type>&)"
|
|
||||||
) << "inconsistent patch and patchField types for \n"
|
|
||||||
<< " patch type " << p.type()
|
|
||||||
<< " and patchField type " << patchFieldType
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
return patchTypeCstrIter()(p, iF);
|
if (patchTypeCstrIter == pointPatchConstructorTablePtr_->end())
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"PointPatchField<Type>::New"
|
||||||
|
"(const word&, const word&"
|
||||||
|
", const pointPatch&, const Field<Type>&)"
|
||||||
|
) << "inconsistent patch and patchField types for \n"
|
||||||
|
<< " patch type " << p.type()
|
||||||
|
<< " and patchField type " << patchFieldType
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
return patchTypeCstrIter()(p, iF);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return pfPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::autoPtr<Foam::pointPatchField<Type> > Foam::pointPatchField<Type>::New
|
||||||
|
(
|
||||||
|
const word& patchFieldType,
|
||||||
|
const pointPatch& p,
|
||||||
|
const DimensionedField<Type, pointMesh>& iF
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return New(patchFieldType, word::null, p, iF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -35,7 +35,7 @@ Description
|
|||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
pointPatchField.C
|
pointPatchField.C
|
||||||
newpointPatchField.C
|
newPointPatchField.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -199,6 +199,18 @@ public:
|
|||||||
const DimensionedField<Type, pointMesh>&
|
const DimensionedField<Type, pointMesh>&
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Return a pointer to a new patchField created on freestore given
|
||||||
|
// patch and internal field
|
||||||
|
// (does not set the patch field values).
|
||||||
|
// Allows override of constraint type
|
||||||
|
static autoPtr<pointPatchField<Type> > New
|
||||||
|
(
|
||||||
|
const word&,
|
||||||
|
const word& actualPatchType,
|
||||||
|
const pointPatch&,
|
||||||
|
const DimensionedField<Type, pointMesh>&
|
||||||
|
);
|
||||||
|
|
||||||
//- Return a pointer to a new patchField created on freestore from
|
//- Return a pointer to a new patchField created on freestore from
|
||||||
// a given pointPatchField mapped onto a new patch
|
// a given pointPatchField mapped onto a new patch
|
||||||
static autoPtr<pointPatchField<Type> > New
|
static autoPtr<pointPatchField<Type> > New
|
||||||
|
|||||||
@ -226,6 +226,18 @@ public:
|
|||||||
const DimensionedField<Type, volMesh>&
|
const DimensionedField<Type, volMesh>&
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Return a pointer to a new patchField created on freestore given
|
||||||
|
// patch and internal field
|
||||||
|
// (does not set the patch field values).
|
||||||
|
// Allows override of constraint type
|
||||||
|
static tmp<fvPatchField<Type> > New
|
||||||
|
(
|
||||||
|
const word&,
|
||||||
|
const word& actualPatchType,
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<Type, volMesh>&
|
||||||
|
);
|
||||||
|
|
||||||
//- Return a pointer to a new patchField created on freestore from
|
//- Return a pointer to a new patchField created on freestore from
|
||||||
// a given fvPatchField mapped onto a new patch
|
// a given fvPatchField mapped onto a new patch
|
||||||
static tmp<fvPatchField<Type> > New
|
static tmp<fvPatchField<Type> > New
|
||||||
|
|||||||
@ -29,14 +29,16 @@ template<class Type>
|
|||||||
Foam::tmp<Foam::fvPatchField<Type> > Foam::fvPatchField<Type>::New
|
Foam::tmp<Foam::fvPatchField<Type> > Foam::fvPatchField<Type>::New
|
||||||
(
|
(
|
||||||
const word& patchFieldType,
|
const word& patchFieldType,
|
||||||
|
const word& actualPatchType,
|
||||||
const fvPatch& p,
|
const fvPatch& p,
|
||||||
const DimensionedField<Type, volMesh>& iF
|
const DimensionedField<Type, volMesh>& iF
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "fvPatchField<Type>::New(const word&, const fvPatch&, "
|
Info<< "fvPatchField<Type>::New(const word&, const word&, "
|
||||||
"const DimensionedField<Type, volMesh>&) : patchFieldType="
|
"const fvPatch&, const DimensionedField<Type, volMesh>&) :"
|
||||||
|
" patchFieldType="
|
||||||
<< patchFieldType
|
<< patchFieldType
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
@ -48,7 +50,7 @@ Foam::tmp<Foam::fvPatchField<Type> > Foam::fvPatchField<Type>::New
|
|||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"fvPatchField<Type>::New(const word&, const fvPatch&, "
|
"fvPatchField<Type>::New(const word&, const word&, const fvPatch&, "
|
||||||
"const DimensionedField<Type, volMesh>&)"
|
"const DimensionedField<Type, volMesh>&)"
|
||||||
) << "Unknown patchTypefield type " << patchFieldType
|
) << "Unknown patchTypefield type " << patchFieldType
|
||||||
<< endl << endl
|
<< endl << endl
|
||||||
@ -57,12 +59,23 @@ Foam::tmp<Foam::fvPatchField<Type> > Foam::fvPatchField<Type>::New
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
typename patchConstructorTable::iterator patchTypeCstrIter =
|
if
|
||||||
patchConstructorTablePtr_->find(p.type());
|
(
|
||||||
|
actualPatchType == word::null
|
||||||
if (patchTypeCstrIter != patchConstructorTablePtr_->end())
|
|| actualPatchType != p.type()
|
||||||
|
)
|
||||||
{
|
{
|
||||||
return patchTypeCstrIter()(p, iF);
|
typename patchConstructorTable::iterator patchTypeCstrIter =
|
||||||
|
patchConstructorTablePtr_->find(p.type());
|
||||||
|
|
||||||
|
if (patchTypeCstrIter != patchConstructorTablePtr_->end())
|
||||||
|
{
|
||||||
|
return patchTypeCstrIter()(p, iF);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return cstrIter()(p, iF);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -71,6 +84,18 @@ Foam::tmp<Foam::fvPatchField<Type> > Foam::fvPatchField<Type>::New
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::tmp<Foam::fvPatchField<Type> > Foam::fvPatchField<Type>::New
|
||||||
|
(
|
||||||
|
const word& patchFieldType,
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<Type, volMesh>& iF
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return New(patchFieldType, word::null, p, iF);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::tmp<Foam::fvPatchField<Type> > Foam::fvPatchField<Type>::New
|
Foam::tmp<Foam::fvPatchField<Type> > Foam::fvPatchField<Type>::New
|
||||||
(
|
(
|
||||||
|
|||||||
@ -216,6 +216,18 @@ public:
|
|||||||
const DimensionedField<Type, surfaceMesh>&
|
const DimensionedField<Type, surfaceMesh>&
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Return a pointer to a new patchField created on freestore given
|
||||||
|
// patch and internal field
|
||||||
|
// (does not set the patch field values)
|
||||||
|
// Allows override of constraint type
|
||||||
|
static tmp<fvsPatchField<Type> > New
|
||||||
|
(
|
||||||
|
const word&,
|
||||||
|
const word& actualPatchType,
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<Type, surfaceMesh>&
|
||||||
|
);
|
||||||
|
|
||||||
//- Return a pointer to a new patchField created on freestore from
|
//- Return a pointer to a new patchField created on freestore from
|
||||||
// a given fvsPatchField mapped onto a new patch
|
// a given fvsPatchField mapped onto a new patch
|
||||||
static tmp<fvsPatchField<Type> > New
|
static tmp<fvsPatchField<Type> > New
|
||||||
|
|||||||
@ -34,14 +34,15 @@ template<class Type>
|
|||||||
tmp<fvsPatchField<Type> > fvsPatchField<Type>::New
|
tmp<fvsPatchField<Type> > fvsPatchField<Type>::New
|
||||||
(
|
(
|
||||||
const word& patchFieldType,
|
const word& patchFieldType,
|
||||||
|
const word& actualPatchType,
|
||||||
const fvPatch& p,
|
const fvPatch& p,
|
||||||
const DimensionedField<Type, surfaceMesh>& iF
|
const DimensionedField<Type, surfaceMesh>& iF
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "fvsPatchField<Type>::New(const word&, const fvPatch&, "
|
Info<< "fvsPatchField<Type>::New(const word&, const word&"
|
||||||
"const Field<Type>&) : "
|
", const fvPatch&, const Field<Type>&) : "
|
||||||
"constructing fvsPatchField<Type>"
|
"constructing fvsPatchField<Type>"
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
@ -53,8 +54,8 @@ tmp<fvsPatchField<Type> > fvsPatchField<Type>::New
|
|||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"fvsPatchField<Type>::New(const word&, const fvPatch&, "
|
"fvsPatchField<Type>::New(const word&, const word&, const fvPatch&"
|
||||||
"const Field<Type>&)"
|
", const Field<Type>&)"
|
||||||
) << "Unknown patchTypefield type " << patchFieldType
|
) << "Unknown patchTypefield type " << patchFieldType
|
||||||
<< endl << endl
|
<< endl << endl
|
||||||
<< "Valid patchField types are :" << endl
|
<< "Valid patchField types are :" << endl
|
||||||
@ -62,12 +63,23 @@ tmp<fvsPatchField<Type> > fvsPatchField<Type>::New
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
typename patchConstructorTable::iterator patchTypeCstrIter =
|
if
|
||||||
patchConstructorTablePtr_->find(p.type());
|
(
|
||||||
|
actualPatchType == word::null
|
||||||
if (patchTypeCstrIter != patchConstructorTablePtr_->end())
|
|| actualPatchType != p.type()
|
||||||
|
)
|
||||||
{
|
{
|
||||||
return patchTypeCstrIter()(p, iF);
|
typename patchConstructorTable::iterator patchTypeCstrIter =
|
||||||
|
patchConstructorTablePtr_->find(p.type());
|
||||||
|
|
||||||
|
if (patchTypeCstrIter != patchConstructorTablePtr_->end())
|
||||||
|
{
|
||||||
|
return patchTypeCstrIter()(p, iF);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return cstrIter()(p, iF);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -76,6 +88,18 @@ tmp<fvsPatchField<Type> > fvsPatchField<Type>::New
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
tmp<fvsPatchField<Type> > fvsPatchField<Type>::New
|
||||||
|
(
|
||||||
|
const word& patchFieldType,
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<Type, surfaceMesh>& iF
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return New(patchFieldType, word::null, p, iF);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
tmp<fvsPatchField<Type> > fvsPatchField<Type>::New
|
tmp<fvsPatchField<Type> > fvsPatchField<Type>::New
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user