31 const word& patchFieldType,
32 const word& actualPatchType,
34 const DimensionedField<Type, pointMesh>& iF
39 Info<<
"PointPatchField<Type>::"
40 "New(const word&, const word&"
41 ", const pointPatch&, const Field<Type>&) : "
42 "constructing pointPatchField<Type>"
46 typename pointPatchConstructorTable::iterator cstrIter =
47 pointPatchConstructorTablePtr_->find(patchFieldType);
49 if (cstrIter == pointPatchConstructorTablePtr_->end())
52 <<
"Unknown patchFieldType type "
53 << patchFieldType <<
nl <<
nl
54 <<
"Valid patchField types are :" <<
endl
55 << pointPatchConstructorTablePtr_->sortedToc()
59 autoPtr<pointPatchField<Type> > pfPtr(cstrIter()(
p, iF));
63 actualPatchType == word::null
64 || actualPatchType !=
p.type()
67 if (pfPtr().constraintType() !=
p.constraintType())
70 typename pointPatchConstructorTable::iterator patchTypeCstrIter =
71 pointPatchConstructorTablePtr_->find(
p.type());
73 if (patchTypeCstrIter == pointPatchConstructorTablePtr_->end())
76 <<
"inconsistent patch and patchField types for \n"
77 <<
" patch type " <<
p.type()
78 <<
" and patchField type " << patchFieldType
82 return patchTypeCstrIter()(
p, iF);
87 if (pointPatchConstructorTablePtr_->found(
p.type()))
89 pfPtr().patchType() = actualPatchType;
100 const word& patchFieldType,
102 const DimensionedField<Type, pointMesh>& iF
105 return New(patchFieldType, word::null,
p, iF);
113 const DimensionedField<Type, pointMesh>& iF,
114 const dictionary&
dict
119 Info<<
"PointPatchField<Type>::"
120 "New(const pointPatch&, const Field<Type>&, const dictionary&)"
121 " : constructing pointPatchField<Type>"
125 word patchFieldType(
dict.lookup(
"type"));
127 typename dictionaryConstructorTable::iterator cstrIter
128 = dictionaryConstructorTablePtr_->find(patchFieldType);
130 if (cstrIter == dictionaryConstructorTablePtr_->end())
132 if (!disallowGenericPointPatchField)
134 cstrIter = dictionaryConstructorTablePtr_->find(
"generic");
137 if (cstrIter == dictionaryConstructorTablePtr_->end())
142 ) <<
"Unknown patchField type " << patchFieldType
143 <<
" for patch type " <<
p.type() <<
nl <<
nl
144 <<
"Valid patchField types are :" <<
endl
145 << dictionaryConstructorTablePtr_->sortedToc()
151 autoPtr<pointPatchField<Type> > pfPtr(cstrIter()(
p, iF,
dict));
155 !
dict.found(
"patchType")
156 || word(
dict.lookup(
"patchType")) !=
p.type()
159 if (pfPtr().constraintType() ==
p.constraintType())
167 typename dictionaryConstructorTable::iterator patchTypeCstrIter
168 = dictionaryConstructorTablePtr_->find(
p.type());
170 if (patchTypeCstrIter == dictionaryConstructorTablePtr_->end())
175 ) <<
"inconsistent patch and patchField types for \n"
176 <<
" patch type " <<
p.type()
177 <<
" and patchField type " << patchFieldType
181 return patchTypeCstrIter()(
p, iF,
dict);
185 return cstrIter()(
p, iF,
dict);
194 const pointPatchField<Type>& ptf,
196 const DimensionedField<Type, pointMesh>& iF,
197 const pointPatchFieldMapper& pfMapper
202 Info<<
"PointPatchField<Type>::"
203 "New(const pointPatchField<Type>&,"
204 " const pointPatch&, const Field<Type>&, "
205 "const pointPatchFieldMapper&) : "
206 "constructing pointPatchField<Type>"
210 typename patchMapperConstructorTable::iterator cstrIter =
211 patchMapperConstructorTablePtr_->find(ptf.type());
213 if (cstrIter == patchMapperConstructorTablePtr_->end())
216 <<
"Unknown patchField type "
217 << ptf.type() <<
nl <<
nl
218 <<
"Valid patchField types are :" <<
endl
219 << patchMapperConstructorTablePtr_->sortedToc()
223 return cstrIter()(ptf,
p, iF, pfMapper);