31 const word& patchFieldType,
32 const word& actualPatchType,
34 const DimensionedField<Type, volMesh>& iF
39 Info<<
"fvPatchField<Type>::New(const word&, const word&, "
40 "const fvPatch&, const DimensionedField<Type, volMesh>&) :"
47 typename patchConstructorTable::iterator cstrIter =
48 patchConstructorTablePtr_->find(patchFieldType);
50 if (cstrIter == patchConstructorTablePtr_->end())
53 <<
"Unknown patchField type "
54 << patchFieldType <<
nl <<
nl
55 <<
"Valid patchField types are :" <<
endl
56 << patchConstructorTablePtr_->sortedToc()
60 typename patchConstructorTable::iterator patchTypeCstrIter =
61 patchConstructorTablePtr_->find(
p.type());
65 actualPatchType == word::null
66 || actualPatchType !=
p.type()
69 if (patchTypeCstrIter != patchConstructorTablePtr_->end())
71 return patchTypeCstrIter()(
p, iF);
75 return cstrIter()(
p, iF);
80 tmp<fvPatchField<Type> > tfvp = cstrIter()(
p, iF);
83 if ((patchTypeCstrIter != patchConstructorTablePtr_->end()))
85 tfvp().patchType() = actualPatchType;
95 const word& patchFieldType,
97 const DimensionedField<Type, volMesh>& iF
100 return New(patchFieldType, word::null,
p, iF);
108 const DimensionedField<Type, volMesh>& iF,
109 const dictionary&
dict
112 const word patchFieldType(
dict.lookup(
"type"));
116 Info<<
"fvPatchField<Type>::New(const fvPatch&, "
117 "const DimensionedField<Type, volMesh>&, "
118 "const dictionary&) : patchFieldType=" << patchFieldType
122 typename dictionaryConstructorTable::iterator cstrIter
123 = dictionaryConstructorTablePtr_->find(patchFieldType);
125 if (cstrIter == dictionaryConstructorTablePtr_->end())
127 if (!disallowGenericFvPatchField)
129 cstrIter = dictionaryConstructorTablePtr_->find(
"generic");
132 if (cstrIter == dictionaryConstructorTablePtr_->end())
137 ) <<
"Unknown patchField type " << patchFieldType
138 <<
" for patch type " <<
p.type() <<
nl <<
nl
139 <<
"Valid patchField types are :" <<
endl
140 << dictionaryConstructorTablePtr_->sortedToc()
147 !
dict.found(
"patchType")
148 || word(
dict.lookup(
"patchType")) !=
p.type()
151 typename dictionaryConstructorTable::iterator patchTypeCstrIter
152 = dictionaryConstructorTablePtr_->find(
p.type());
156 patchTypeCstrIter != dictionaryConstructorTablePtr_->end()
157 && patchTypeCstrIter() != cstrIter()
163 ) <<
"inconsistent patch and patchField types for \n"
164 " patch type " <<
p.type()
165 <<
" and patchField type " << patchFieldType
170 return cstrIter()(
p, iF,
dict);
177 const fvPatchField<Type>& ptf,
179 const DimensionedField<Type, volMesh>& iF,
180 const fvPatchFieldMapper& pfMapper
185 Info<<
"fvPatchField<Type>::New(const fvPatchField<Type>&, "
186 "const fvPatch&, const DimensionedField<Type, volMesh>&, "
187 "const fvPatchFieldMapper&) : "
188 "constructing fvPatchField<Type>"
192 typename patchMapperConstructorTable::iterator cstrIter =
193 patchMapperConstructorTablePtr_->find(ptf.type());
195 if (cstrIter == patchMapperConstructorTablePtr_->end())
198 <<
"Unknown patchField type " << ptf.type() <<
nl <<
nl
199 <<
"Valid patchField types are :" <<
endl
200 << patchMapperConstructorTablePtr_->sortedToc()
204 return cstrIter()(ptf,
p, iF, pfMapper);