/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Copyright (C) 2011-2026 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . \*---------------------------------------------------------------------------*/ #include "IOobject.H" #include "dictionary.H" #include "fvMesh.H" #include "fieldMapper.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template Foam::fvPatchField::fvPatchField ( const fvPatch& p, const DimensionedField& iF ) : Field(p.size()), patch_(p), internalField_(iF), updated_(false), manipulatedMatrix_(false) {} template Foam::fvPatchField::fvPatchField ( const fvPatch& p, const DimensionedField& iF, const Field& f ) : Field(f), patch_(p), internalField_(iF), updated_(false), manipulatedMatrix_(false) {} template Foam::fvPatchField::fvPatchField ( const fvPatch& p, const DimensionedField& iF, const dictionary& dict, const bool valueRequired ) : Field(p.size()), libs_(dict.lookupOrDefault("libs", fileNameList::null())), patch_(p), internalField_(iF), updated_(false), manipulatedMatrix_(false) { if (valueRequired) { if (dict.found("value")) { Field::operator= ( Field("value", iF.dimensions(), dict, p.size()) ); } else { FatalIOErrorInFunction(dict) << "Essential entry 'value' missing" << exit(FatalIOError); } } } template Foam::fvPatchField::fvPatchField ( const fvPatchField& ptf, const fvPatch& p, const DimensionedField& iF, const fieldMapper& mapper, const bool mappingRequired ) : Field(p.size()), libs_(ptf.libs_), patch_(p), internalField_(iF), updated_(false), manipulatedMatrix_(false) { if (mappingRequired) { mapper(*this, ptf); } } template Foam::fvPatchField::fvPatchField ( const fvPatchField& ptf, const DimensionedField& iF ) : Field(static_cast&>(ptf)), libs_(ptf.libs_), patch_(ptf.patch_), internalField_(iF), updated_(false), manipulatedMatrix_(false) {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template const Foam::objectRegistry& Foam::fvPatchField::db() const { return patch_.mesh(); } template const Foam::Time& Foam::fvPatchField::time() const { return patch_.time(); } template void Foam::fvPatchField::check(const fvPatchField& ptf) const { if (&patch_ != &(ptf.patch_)) { FatalErrorInFunction << "different patches for fvPatchFields" << abort(FatalError); } } template Foam::tmp> Foam::fvPatchField::snGrad() const { return patch_.deltaCoeffs()*(field() - patchInternalField()); } template Foam::tmp> Foam::fvPatchField::patchInternalField() const { return patch_.patchInternalField(internalField_); } template void Foam::fvPatchField::patchInternalField(Field& pif) const { patch_.patchInternalField(internalField_, pif); } template void Foam::fvPatchField::map ( const fvPatchField& ptf, const fieldMapper& mapper ) { mapper(*this, ptf); } template void Foam::fvPatchField::reset(const fvPatchField& ptf) { Field::reset(ptf); } template void Foam::fvPatchField::updateCoeffs() { updated_ = true; } template void Foam::fvPatchField::evaluate(const Pstream::commsTypes) { if (!updated_) { updateCoeffs(); } updated_ = false; manipulatedMatrix_ = false; } template void Foam::fvPatchField::manipulateMatrix(fvMatrix& matrix) { manipulatedMatrix_ = true; } template void Foam::fvPatchField::write(Ostream& os) const { writeEntry(os, "type", type()); if (overridesConstraint()) { writeEntry(os, "patchType", patch().type()); } if (libs_.size()) { writeEntry(os, "libs", libs_); } } // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template void Foam::fvPatchField::operator= ( const UList& ul ) { Field::operator=(ul); } template void Foam::fvPatchField::operator= ( const Field& ul ) { Field::operator=(ul); } template void Foam::fvPatchField::operator= ( const fvPatchField& ptf ) { check(ptf); Field::operator=(static_cast&>(ptf)); } template void Foam::fvPatchField::operator= ( const expression::Assignment>& a ) { a.assign(static_cast&>(*this)); } template template void Foam::fvPatchField::operator=(const Expression& e) { operator= ( static_cast>&> ( expression::assignment> ( expression::access(e, expression::Base()) ) ) ); } template void Foam::fvPatchField::operator+= ( const fvPatchField& ptf ) { check(ptf); Field::operator+=(ptf); } template void Foam::fvPatchField::operator-= ( const fvPatchField& ptf ) { check(ptf); Field::operator-=(ptf); } template void Foam::fvPatchField::operator*= ( const fvPatchField& ptf ) { if (&patch_ != &ptf.patch()) { FatalErrorInFunction << "incompatible patches for patch fields" << abort(FatalError); } Field::operator*=(ptf); } template void Foam::fvPatchField::operator/= ( const fvPatchField& ptf ) { if (&patch_ != &ptf.patch()) { FatalErrorInFunction << abort(FatalError); } Field::operator/=(ptf); } template void Foam::fvPatchField::operator+= ( const Field& tf ) { Field::operator+=(tf); } template void Foam::fvPatchField::operator-= ( const Field& tf ) { Field::operator-=(tf); } template void Foam::fvPatchField::operator*= ( const scalarField& tf ) { Field::operator*=(tf); } template void Foam::fvPatchField::operator/= ( const scalarField& tf ) { Field::operator/=(tf); } template void Foam::fvPatchField::operator= ( const Type& t ) { Field::operator=(t); } template void Foam::fvPatchField::operator+= ( const Type& t ) { Field::operator+=(t); } template void Foam::fvPatchField::operator-= ( const Type& t ) { Field::operator-=(t); } template void Foam::fvPatchField::operator*= ( const scalar s ) { Field::operator*=(s); } template void Foam::fvPatchField::operator/= ( const scalar s ) { Field::operator/=(s); } template void Foam::fvPatchField::operator== ( const fvPatchField& ptf ) { Field::operator=(static_cast&>(ptf)); } template void Foam::fvPatchField::operator== ( const Field& tf ) { Field::operator=(tf); } template void Foam::fvPatchField::operator== ( const Type& t ) { Field::operator=(t); } template void Foam::fvPatchField::operator== ( const expression::Assignment>& a ) { a.assign(static_cast&>(*this)); } template template void Foam::fvPatchField::operator==(const Expression& e) { operator== ( static_cast>&> ( expression::assignment> ( expression::access(e, expression::Base()) ) ) ); } // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // template Foam::Ostream& Foam::operator<<(Ostream& os, const fvPatchField& ptf) { ptf.write(os); os.check("Ostream& operator<<(Ostream&, const fvPatchField&"); return os; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #include "fvPatchFieldNew.C" // ************************************************************************* //