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();
292 return internalField_.dimensions();
295 if (
notNull(internalNonDynamicField_))
297 return internalNonDynamicField_.dimensions();
301 <<
"Dimensions of internal object " << internalIo_.name()
302 <<
" could not be determined"
305 return NullObjectRef<dimensionSet>();
315 return internalField_;
319 <<
"Internal field " << internalIo_.name() <<
" is not of type "
323 return NullObjectRef<LagrangianInternalDynamicField<Type>>();
333 return patch_.mesh().sub(internalField_);
336 if (
notNull(internalNonDynamicField_))
338 return patch_.mesh().sub(internalNonDynamicField_);
342 <<
"Internal field " << internalIo_.name() <<
" is not of type "
355 return patch_.mesh().sub(internalField_.primitiveField());
358 if (
notNull(internalNonDynamicField_))
360 return patch_.mesh().sub(internalNonDynamicField_.primitiveField());
364 <<
"Internal field " << internalIo_.name() <<
" is not of type "
408 return internalSubField();
412 #define MEMBER_OPERATOR(MemberOp, FieldOp, OtherType, OtherDimensions) \
414 template<class Type> \
415 void Foam::LagrangianPatchField<Type>::operator MemberOp \
417 const LagrangianPatchField<OtherType>& ptf \
420 if (&patch_ != &(ptf.patch_)) \
422 FatalErrorInFunction \
423 << "different patches for LagrangianPatchField<Type>s" \
424 << abort(FatalError); \
427 if (!patch_.boundaryMesh().mesh().changing()) return; \
429 OtherDimensions == ptf.internalDimensions(); \
431 LagrangianSubSubField<Type> thisSsf(internalSubField()); \
432 thisSsf FieldOp ptf.internalSubField(); \
435 template<class Type> \
436 void Foam::LagrangianPatchField<Type>::operator MemberOp \
438 const LagrangianSubField<OtherType>& sf \
441 if (!patch_.boundaryMesh().mesh().changing()) return; \
443 OtherDimensions == sf.dimensions(); \
445 SubField<Type> thisSf(primitiveSubField()); \
446 thisSf FieldOp sf.primitiveField(); \
449 template<class Type> \
450 void Foam::LagrangianPatchField<Type>::operator MemberOp \
452 const LagrangianSubSubField<OtherType>& ssf \
455 if (!patch_.boundaryMesh().mesh().changing()) return; \
457 OtherDimensions == ssf.dimensions(); \
459 SubField<Type> thisSf(primitiveSubField()); \
460 thisSf FieldOp ssf.primitiveField(); \
463 template<class Type> \
464 void Foam::LagrangianPatchField<Type>::operator MemberOp \
466 const UList<OtherType>& f \
469 if (!patch_.boundaryMesh().mesh().changing()) return; \
471 SubField<Type> thisSf(primitiveSubField()); \
475 template<class Type> \
476 void Foam::LagrangianPatchField<Type>::operator MemberOp(const OtherType& t) \
478 if (!patch_.boundaryMesh().mesh().changing()) return; \
480 SubField<Type> thisSf(primitiveSubField()); \
491 #undef MEMBER_OPERATOR
507 "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.
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 LagrangianScalarInternalDynamicField &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.
SubField< Type > primitiveSubField() const
Generate a primitive sub field corresponding to this patch.
const LagrangianInternalDynamicField< Type > & internalField() const
Return internal field reference.
virtual void evaluate(PstreamBuffers &, const LagrangianScalarInternalDynamicField &fraction)
Evaluate the patch field.
Base class for Lagrangian patches.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual Ostream & write(const char)=0
Write character.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
Pre-declare related SubField type.
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.
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,.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimless
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
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)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.