Foam::tmp<Foam::fvsPatchField<Type>> Foam::fvsPatchField<Type>::New ( const fvsPatchField<Type>& ptf, const fvPatch& p, const DimensionedField<Type, surfaceMesh>& iF, const fvPatchFieldMapper& pfMapper ) { if (debug) { InfoInFunction << "Constructing fvsPatchField<Type>" << endl; } auto cstrIter = patchMapperConstructorTablePtr_->cfind(ptf.type()); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown patchField type " << ptf.type() << nl << nl << "Valid patchField types :" << endl << patchMapperConstructorTablePtr_->sortedToc() << exit(FatalError); } auto patchTypeCstrIter = patchMapperConstructorTablePtr_->cfind(p.type()); if (patchTypeCstrIter.found()) { return patchTypeCstrIter()(ptf, p, iF, pfMapper); } else { return cstrIter()(ptf, p, iF, pfMapper); } }
tmp<fvsPatchField<Type> > fvsPatchField<Type>::NewCalculatedType ( const fvsPatchField<Type2>& pf ) { typename patchConstructorTable::iterator patchTypeCstrIter = patchConstructorTablePtr_->find(pf.patch().type()); if (patchTypeCstrIter != patchConstructorTablePtr_->end()) { return patchTypeCstrIter() ( pf.patch(), Field<Type>::null() ); } else { return tmp<fvsPatchField<Type> > ( new calculatedFvsPatchField<Type> ( pf.patch(), Field<Type>::null() ) ); } }
tmp<fvsPatchField<Type> > fvsPatchField<Type>::NewCalculatedType ( const fvsPatchField<Type2>& pf ) { return NewCalculatedType(pf.patch()); }
tmp<fvsPatchField<Type> > fvsPatchField<Type>::New ( const fvsPatchField<Type>& ptf, const fvPatch& p, const DimensionedField<Type, surfaceMesh>& iF, const fvPatchFieldMapper& pfMapper ) { if (debug) { Info<< "fvsPatchField<Type>::New(const fvsPatchField<Type>&," " const fvPatch&, const DimensionedField<Type, surfaceMesh>&, " "const fvPatchFieldMapper&) : " "constructing fvsPatchField<Type>" << endl; } typename patchMapperConstructorTable::iterator cstrIter = patchMapperConstructorTablePtr_->find(ptf.type()); if (cstrIter == patchMapperConstructorTablePtr_->end()) { FatalErrorIn ( "fvsPatchField<Type>::New(const fvsPatchField<Type>&, " "const fvPatch&, const Field<Type>&, " "const fvPatchFieldMapper&)" ) << "unknown patch field type " << ptf.type() << endl << endl << "Valid patchField types are :" << endl << patchMapperConstructorTablePtr_->toc() << exit(FatalError); } typename patchMapperConstructorTable::iterator patchTypeCstrIter = patchMapperConstructorTablePtr_->find(p.type()); if (patchTypeCstrIter != patchMapperConstructorTablePtr_->end()) { return patchTypeCstrIter()(ptf, p, iF, pfMapper); } else { return cstrIter()(ptf, p, iF, pfMapper); } }
void Foam::fvsPatchField<Type>::operator/= ( const fvsPatchField<scalar>& ptf ) { if (&patch_ != &ptf.patch()) { FatalErrorInFunction << abort(FatalError); } Field<Type>::operator/=(ptf); }
void Foam::fvsPatchField<Type>::operator*= ( const fvsPatchField<scalar>& ptf ) { if (&patch_ != &ptf.patch()) { FatalErrorInFunction << "incompatible patches for patch fields" << abort(FatalError); } Field<Type>::operator*=(ptf); }
void fvsPatchField<Type>::operator/= ( const fvsPatchField<scalar>& ptf ) { if (&patch_ != &ptf.patch()) { FatalErrorIn ( "PatchField<Type>::operator/=(const fvsPatchField<scalar>& ptf)" ) << " incompatible patches for patch fields" << abort(FatalError); } Field<Type>::operator/=(ptf); }