47 internalNonDynamicField_
68 internalNonDynamicField_
82 internalIo_(ptf.internalIo_),
83 internalField_(ptf.internalField_),
84 internalNonDynamicField_(ptf.internalNonDynamicField_)
101 internalNonDynamicField_
122 internalNonDynamicField_
136 const word& actualPatchType,
146 typename LagrangianPatchConstructorTable::iterator cstrIter =
149 if (cstrIter == LagrangianPatchConstructorTablePtr_->end())
152 <<
"Unknown patchField type "
154 <<
"Valid patchField types are :" <<
endl
155 << LagrangianPatchConstructorTablePtr_->sortedToc()
162 || actualPatchType !=
p.type()
165 typename LagrangianPatchConstructorTable::iterator patchTypeCstrIter =
166 LagrangianPatchConstructorTablePtr_->find(
p.type());
168 if (patchTypeCstrIter != LagrangianPatchConstructorTablePtr_->end())
170 return patchTypeCstrIter()(
p, iIo);
174 return cstrIter()(
p, iIo);
179 return cstrIter()(
p, iIo);
213 typename dictionaryConstructorTable::iterator cstrIter
216 if (cstrIter == dictionaryConstructorTablePtr_->end())
218 if (!disallowGenericLagrangianPatchField)
220 cstrIter = dictionaryConstructorTablePtr_->find(
"generic");
223 if (cstrIter == dictionaryConstructorTablePtr_->end())
227 <<
" for patch type " <<
p.type() <<
nl <<
nl
228 <<
"Valid patchField types are :" <<
endl
229 << dictionaryConstructorTablePtr_->sortedToc()
240 typename dictionaryConstructorTable::iterator patchTypeCstrIter
241 = dictionaryConstructorTablePtr_->find(
p.type());
245 patchTypeCstrIter != dictionaryConstructorTablePtr_->end()
246 && patchTypeCstrIter() != cstrIter()
252 ) <<
"inconsistent patch and patchField types for \n"
253 " patch type " <<
p.type()
259 return cstrIter()(
p, iIo,
dict);
275 return patch_.boundaryMesh().mesh();
282 return patch_.boundaryMesh().mesh().
time();
299 return internalField_.dimensions();
302 if (
notNull(internalNonDynamicField_))
304 return internalNonDynamicField_.dimensions();
308 <<
"Dimensions of internal object " << internalIo_.name()
309 <<
" could not be determined"
312 return NullObjectRef<dimensionSet>();
322 return internalField_;
326 <<
"Internal field " << internalIo_.name() <<
" is not of type "
330 return NullObjectRef<LagrangianInternalDynamicField<Type>>();
340 return patch_.mesh().sub(internalField_);
343 if (
notNull(internalNonDynamicField_))
345 return patch_.mesh().sub(internalNonDynamicField_);
349 <<
"Internal field " << internalIo_.name() <<
" is not of type "
362 return patch_.mesh().sub(internalField_.primitiveField());
365 if (
notNull(internalNonDynamicField_))
367 return patch_.mesh().sub(internalNonDynamicField_.primitiveField());
371 <<
"Internal field " << internalIo_.name() <<
" is not of type "
415 return internalSubField();
419 #define MEMBER_OPERATOR(MemberOp, FieldOp, OtherType, OtherDimensions) \
421 template<class Type> \
422 void Foam::LagrangianPatchField<Type>::operator MemberOp \
424 const LagrangianPatchField<OtherType>& ptf \
427 if (&patch_ != &(ptf.patch_)) \
429 FatalErrorInFunction \
430 << "different patches for LagrangianPatchField<Type>s" \
431 << abort(FatalError); \
434 if (!patch_.boundaryMesh().mesh().changing()) return; \
436 OtherDimensions == ptf.internalDimensions(); \
438 LagrangianSubSubField<Type> thisSsf(internalSubField()); \
439 thisSsf FieldOp ptf.internalSubField(); \
442 template<class Type> \
443 void Foam::LagrangianPatchField<Type>::operator MemberOp \
445 const LagrangianSubField<OtherType>& sf \
448 if (!patch_.boundaryMesh().mesh().changing()) return; \
450 OtherDimensions == sf.dimensions(); \
452 SubField<Type> thisSf(primitiveSubField()); \
453 thisSf FieldOp sf.primitiveField(); \
456 template<class Type> \
457 void Foam::LagrangianPatchField<Type>::operator MemberOp \
459 const LagrangianSubSubField<OtherType>& ssf \
462 if (!patch_.boundaryMesh().mesh().changing()) return; \
464 OtherDimensions == ssf.dimensions(); \
466 SubField<Type> thisSf(primitiveSubField()); \
467 thisSf FieldOp ssf.primitiveField(); \
470 template<class Type> \
471 void Foam::LagrangianPatchField<Type>::operator MemberOp \
473 const UList<OtherType>& f \
476 if (!patch_.boundaryMesh().mesh().changing()) return; \
478 SubField<Type> thisSf(primitiveSubField()); \
482 template<class Type> \
483 void Foam::LagrangianPatchField<Type>::operator MemberOp(const OtherType& t) \
485 if (!patch_.boundaryMesh().mesh().changing()) return; \
487 SubField<Type> thisSf(primitiveSubField()); \
498 #undef MEMBER_OPERATOR
514 "Ostream& operator<<(Ostream&, const LagrangianPatchField<Type>&)"
#define MEMBER_OPERATOR(MemberOp, FieldOp, OtherType, OtherDimensions)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Base class for Lagrangian boundary conditions.
virtual ~LagrangianPatchField()
Destructor.
static autoPtr< LagrangianPatchField< Type > > New(const word &patchFieldType, const word &actualPatchType, const LagrangianPatch &p, const regIOobject &)
Return a pointer to a new LagrangianPatchField with a given type.
const dimensionSet & internalDimensions() const
Return internal dimensions reference.
tmp< LagrangianSubSubField< Type > > operator()() const
Generate a sub-sub field corresponding to this patch.
const Time & time() const
Return time.
virtual void write(Ostream &) const
Write.
virtual void reset(const LagrangianPatchField< Type > &)
Reset to the given LagrangianPatchField.
const LagrangianPatch & patch() const
Return patch.
const objectRegistry & db() const
Return local objectRegistry.
virtual void initEvaluate(PstreamBuffers &, const LagrangianInternalScalarDynamicField &fraction)
Initialise evaluation of the patch field.
friend class LagrangianPatchField
Declare friendship with patch fields of different types.
tmp< LagrangianSubSubField< Type > > internalSubField() const
Generate an internal sub field corresponding to this patch.
virtual void evaluate(PstreamBuffers &, const LagrangianInternalScalarDynamicField &fraction)
Evaluate the patch field.
SubField< Type > primitiveSubField() const
Generate a primitive sub field corresponding to this patch.
const LagrangianInternalDynamicField< Type > & internalField() const
Return internal field reference.
Base class for Lagrangian patches.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual Ostream & write(const token &)
Write token.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
Pre-declare related SubField type.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Dimension set for the base types.
Registry of regIOobjects.
const Time & time() const
Return time.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
A class for managing temporary objects.
A class for handling words, derived from string.
static const word null
An empty word.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define InfoInFunction
Report an information message using Foam::Info.
errorManipArg< error, int > exit(error &err, const int errNo=1)
To & refCastNull(From &r)
Reference type cast template function,.
const dimensionSet & dimless
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool notNull(const T &t)
Return true if t is not a reference to the nullObject of type T.
const T & NullObjectRef()
Return const reference to the nullObject of type T.
word patchFieldType(const PatchField &pf)
tmp< DimensionedField< TypeR, GeoMesh, Field > > New(const tmp< DimensionedField< TypeR, GeoMesh, Field >> &tdf1, const word &name, const dimensionSet &dimensions)
void writeEntry(Ostream &os, const word &key, const DimensionedFieldFunction< DimensionedFieldType > &f)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.