36 const word& patchFieldType,
37 const word& actualPatchType,
39 const DimensionedField<Type, surfaceMesh>& iF
44 Info<<
"fvsPatchField<Type>::New(const word&, const word&"
45 ", const fvPatch&, const Field<Type>&) : "
46 "constructing fvsPatchField<Type>"
50 typename patchConstructorTable::iterator cstrIter =
51 patchConstructorTablePtr_->find(patchFieldType);
53 if (cstrIter == patchConstructorTablePtr_->end())
56 <<
"Unknown patchField type "
57 << patchFieldType <<
nl <<
nl
58 <<
"Valid patchField types are :" <<
endl
59 << patchConstructorTablePtr_->sortedToc()
65 actualPatchType == word::null
66 || actualPatchType !=
p.type()
69 typename patchConstructorTable::iterator patchTypeCstrIter =
70 patchConstructorTablePtr_->find(
p.type());
72 if (patchTypeCstrIter != patchConstructorTablePtr_->end())
74 return patchTypeCstrIter()(
p, iF);
78 return cstrIter()(
p, iF);
83 return cstrIter()(
p, iF);
91 const word& patchFieldType,
93 const DimensionedField<Type, surfaceMesh>& iF
96 return New(patchFieldType, word::null,
p, iF);
104 const DimensionedField<Type, surfaceMesh>& iF,
105 const dictionary&
dict
110 Info<<
"fvsPatchField<Type>::New(const fvPatch&, const Field<Type>&, "
111 "const dictionary&) : "
112 "constructing fvsPatchField<Type>"
116 const word patchFieldType(
dict.lookup(
"type"));
118 typename dictionaryConstructorTable::iterator cstrIter
119 = dictionaryConstructorTablePtr_->find(patchFieldType);
121 if (cstrIter == dictionaryConstructorTablePtr_->end())
123 if (!disallowGenericFvsPatchField)
125 cstrIter = dictionaryConstructorTablePtr_->find(
"generic");
128 if (cstrIter == dictionaryConstructorTablePtr_->end())
133 ) <<
"Unknown patchField type " << patchFieldType
134 <<
" for patch type " <<
p.type() <<
nl <<
nl
135 <<
"Valid patchField types are :" <<
endl
136 << dictionaryConstructorTablePtr_->sortedToc()
143 !
dict.found(
"patchType")
144 || word(
dict.lookup(
"patchType")) !=
p.type()
147 typename dictionaryConstructorTable::iterator patchTypeCstrIter
148 = dictionaryConstructorTablePtr_->find(
p.type());
152 patchTypeCstrIter != dictionaryConstructorTablePtr_->end()
153 && patchTypeCstrIter() != cstrIter()
159 ) <<
"inconsistent patch and patchField types for \n"
160 " patch type " <<
p.type()
161 <<
" and patchField type " << patchFieldType
166 return cstrIter()(
p, iF,
dict);
175 const fvsPatchField<Type>& ptf,
177 const DimensionedField<Type, surfaceMesh>& iF,
178 const fvPatchFieldMapper& pfMapper
183 Info<<
"fvsPatchField<Type>::New(const fvsPatchField<Type>&,"
184 " const fvPatch&, const Field<Type>&, "
185 "const fvPatchFieldMapper&) : "
186 "constructing fvsPatchField<Type>"
190 typename patchMapperConstructorTable::iterator cstrIter =
191 patchMapperConstructorTablePtr_->find(ptf.type());
193 if (cstrIter == patchMapperConstructorTablePtr_->end())
196 <<
"Unknown patchField type " << ptf.type() <<
nl <<
nl
197 <<
"Valid patchField types are :" <<
endl
198 << patchMapperConstructorTablePtr_->sortedToc()
202 typename patchMapperConstructorTable::iterator
203 patchTypeCstrIter = patchMapperConstructorTablePtr_->find(
p.type());
205 if (patchTypeCstrIter != patchMapperConstructorTablePtr_->end())
207 return patchTypeCstrIter()(ptf,
p, iF, pfMapper);
211 return cstrIter()(ptf,
p, iF, pfMapper);