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,
120 if (
FOAM_UNLIKELY(internalData.size() != primitiveField().size()))
123 <<
"Internal field size: " << internalData.size()
124 <<
" != mesh size: " << primitiveField().size() <<
nl 134 const label len = pfld.size();
137 if (
FOAM_UNLIKELY((addressing.size() < len) || (this->size() < len)))
140 <<
"patchField size = " << len
141 <<
" but patch size = " << this->size()
142 <<
" and addressing size = " << addressing.size() <<
nl 147 for (label i = 0; i < len; ++i)
149 pfld[i] = internalData[addressing[i]];
155 template<
class Type1>
164 this->patchInternalField(internalData, addressing, tpfld.ref());
170 template<
class Type1>
178 this->patchInternalField(internalData,
patch().meshPoints(), tpfld.ref());
187 return patchInternalField(primitiveField());
192 template<
class Type1>
202 <<
"Internal field size: " << iF.
size()
203 <<
" != mesh size: " << primitiveField().size() <<
nl 210 <<
"Patch field size: " << pF.
size()
211 <<
" != patch size: " << size() <<
nl 220 iF[
mp[pointi]] += pF[pointi];
226 template<
class Type1>
230 const Field<Type1>& pF,
237 <<
"Internal field size: " << iF.size()
238 <<
" != mesh size: " << primitiveField().size() <<
nl 245 <<
"Patch field size: " << pF.size()
246 <<
" != patch size: " << size() <<
nl 256 iF[
mp[pointi]] += pF[pointi];
262 template<
class Type1>
266 const Field<Type1>& pF,
273 <<
"Internal field size: " << iF.size()
274 <<
" != mesh size: " << primitiveField().size() <<
nl 281 <<
"Patch field size: " << pF.size()
282 <<
" != meshPoints size: " << meshPoints.size() <<
nl 286 forAll(meshPoints, pointi)
288 iF[meshPoints[pointi]] = pF[pointi];
294 template<
class Type1>
298 const Field<Type1>& pF
301 setInInternalField(iF, pF,
patch().meshPoints());
308 pointPatchFieldBase::setUpdated(
true);
320 pointPatchFieldBase::setUpdated(
false);
321 pointPatchFieldBase::setManipulated(
false);
331 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.
#define FOAM_UNLIKELY(cond)
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.