105 os.writeEntry(
"type",
type());
107 if (!patchType().empty())
118 const UList<Type1>& internalData,
119 const labelUList& addressing,
123 if (
FOAM_UNLIKELY(internalData.size() != primitiveField().size()))
126 <<
"Internal field size: " << internalData.size()
127 <<
" != mesh size: " << primitiveField().size() << nl
128 << abort(FatalError);
137 const label len = pfld.size();
140 if (
FOAM_UNLIKELY((addressing.size() < len) || (this->size() < len)))
143 <<
"patchField size = " << len
144 <<
" but patch size = " << this->size()
145 <<
" and addressing size = " << addressing.size() <<
nl
146 <<
abort(FatalError);
150 for (label i = 0; i < len; ++i)
152 pfld[i] = internalData[addressing[i]];
162 const UList<Type1>& internalData,
163 const labelUList& addressing
166 auto tpfld = tmp<Field<Type1>>::New(this->size());
167 this->patchInternalField(internalData, addressing, tpfld.ref());
205 <<
"Internal field size: " << iF.
size()
206 <<
" != mesh size: " << primitiveField().size() <<
nl
213 <<
"Patch field size: " << pF.
size()
214 <<
" != patch size: " << size() << nl
215 << abort(FatalError);
223 iF[mp[pointi]] += pF[pointi];
233 const Field<Type1>& pF,
240 <<
"Internal field size: " << iF.size()
241 <<
" != mesh size: " << primitiveField().size() << nl
242 << abort(FatalError);
248 <<
"Patch field size: " << pF.size()
249 <<
" != patch size: " << size() <<
nl
250 <<
abort(FatalError);
259 iF[mp[pointi]] += pF[pointi];
269 const Field<Type1>& pF,
270 const labelUList& meshPoints
276 <<
"Internal field size: " << iF.size()
277 <<
" != mesh size: " << primitiveField().size() << nl
278 << abort(FatalError);
284 <<
"Patch field size: " << pF.size()
285 <<
" != meshPoints size: " << meshPoints.size() <<
nl
286 <<
abort(FatalError);
289 forAll(meshPoints, pointi)
291 iF[meshPoints[pointi]] = pF[pointi];
301 const Field<Type1>& pF
323 pointPatchFieldBase::setUpdated(
false);
324 pointPatchFieldBase::setManipulated(
false);
334 const pointPatchField<Type>& ptf
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void size(const label n)
Older name for setAddressableSize.
commsTypes
Communications types.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Template invariant parts for pointPatchField.
const pointPatch & patch() const noexcept
Return the patch.
void setManipulated(bool state) noexcept
Set matrix manipulated state. Currently a no-op for pointPatchField.
void setUpdated(bool state) noexcept
Set updated state.
pointPatchFieldBase(const pointPatch &p)
Construct from patch.
const word & patchType() const noexcept
The optional patch type.
bool updated() const noexcept
True if the boundary condition has already been updated.
Foam::pointPatchFieldMapper.
Abstract base class for point-mesh patch fields.
void patchInternalField(const UList< Type1 > &internalData, const labelUList &addressing, UList< Type1 > &pfld) const
tmp< Field< Type > > patchInternalField() const
Return field created from appropriate internal field values.
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.
const Field< Type > & primitiveField() const noexcept
Return const-reference to the internal field values.
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.
virtual void write(Ostream &os) const
Write.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
label size() const noexcept
Return the patch size.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Evaluate the patch field, sets updated() to false.
pointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
Basic pointPatch represents a set of points from the mesh.
A class for managing temporary objects.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
const dimensionedScalar mp
Proton mass.
const std::string patch
OpenFOAM patch number as a std::string.
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.
List< label > labelList
A List of labels.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
errorManip< error > abort(error &err)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
UList< label > labelUList
A UList of labels.
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.
#define FOAM_UNLIKELY(cond)