81 internalField_(ptf.internalField_)
102 os.writeEntry(
"type",
type());
104 if (!patchType().empty())
106 os.writeEntry(
"patchType", patchType());
112 template<
class Type1>
115 const UList<Type1>& internalData,
121 if (internalData.size() != primitiveField().size())
124 <<
"Internal field size: " << internalData.size()
125 <<
" != mesh size: " << primitiveField().size() <<
nl 129 const label len = this->size();
131 pfld.resize_nocopy(len);
133 for (label i = 0; i < len; ++i)
135 pfld[i] = internalData[addressing[i]];
141 template<
class Type1>
150 this->patchInternalField(internalData, addressing, tpfld.ref());
156 template<
class Type1>
164 this->patchInternalField(internalData,
patch().meshPoints(), tpfld.ref());
173 return patchInternalField(primitiveField());
178 template<
class Type1>
186 if (iF.
size() != primitiveField().size())
189 <<
"Internal field size: " << iF.
size()
190 <<
" != mesh size: " << primitiveField().size() <<
nl 194 if (pF.
size() != size())
197 <<
"Patch field size: " << pF.
size()
198 <<
" != patch size: " << size() <<
nl 207 iF[
mp[pointi]] += pF[pointi];
213 template<
class Type1>
217 const Field<Type1>& pF,
222 if (iF.size() != primitiveField().size())
225 <<
"Internal field size: " << iF.size()
226 <<
" != mesh size: " << primitiveField().size() <<
nl 230 if (pF.size() != size())
233 <<
"Patch field size: " << pF.size()
234 <<
" != patch size: " << size() <<
nl 244 iF[
mp[pointi]] += pF[pointi];
250 template<
class Type1>
254 const Field<Type1>& pF,
259 if (iF.size() != primitiveField().size())
262 <<
"Internal field size: " << iF.size()
263 <<
" != mesh size: " << primitiveField().size() <<
nl 267 if (pF.size() != meshPoints.size())
270 <<
"Patch field size: " << pF.size()
271 <<
" != meshPoints size: " << meshPoints.size() <<
nl 275 forAll(meshPoints, pointi)
277 iF[meshPoints[pointi]] = pF[pointi];
283 template<
class Type1>
287 const Field<Type1>& pF
290 setInInternalField(iF, pF,
patch().meshPoints());
297 pointPatchFieldBase::setUpdated(
true);
309 pointPatchFieldBase::setUpdated(
false);
319 const pointPatchField<Type>& ptf
void size(const label n)
Older name for setAddressableSize.
Template invariant parts for pointPatchField.
pointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
commsTypes
Communications types.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
constexpr char nl
The newline '\n' character (0x0a)
Foam::pointPatchFieldMapper.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
virtual void write(Ostream &os) const
Write.
UList< label > labelUList
A UList of labels.
#define forAll(list, i)
Loop across all elements in list.
Abstract base class for point-mesh patch fields.
Generic templated field type.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
errorManip< error > abort(error &err)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
tmp< Field< Type > > patchInternalField() const
Return field created from appropriate internal field values.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
void setInInternalField(Field< Type1 > &iF, const Field< Type1 > &pF, const labelUList &meshPoints) const
Given the internal field and a patch field, set the patch field in the internal field.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Evaluate the patch field, sets updated() to false.
Basic pointPatch represents a set of points from the mesh.
void addToInternalField(Field< Type1 > &iF, const Field< Type1 > &pF) const
Given the internal field and a patch field, add the patch field to the internal field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const std::string patch
OpenFOAM patch number as a std::string.
List< label > labelList
A List of labels.
A class for managing temporary objects.
const dimensionedScalar mp
Proton mass.