/*---------------------------------------------------------------------------*\ ========= | \\ / 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::fvsPatchField::fvsPatchField ( const fvPatch& p, const DimensionedField& iF ) : Field(p.size()), patch_(p), internalField_(iF) {} template Foam::fvsPatchField::fvsPatchField ( const fvPatch& p, const DimensionedField& iF, const Field& f ) : Field(f), patch_(p), internalField_(iF) {} template Foam::fvsPatchField::fvsPatchField ( const fvPatch& p, const DimensionedField& iF, const dictionary& dict, const bool valueRequired ) : Field(p.size()), patch_(p), internalField_(iF) { if (valueRequired) { if (dict.found("value")) { Field::operator= ( Field("value", iF.dimensions(), dict, p.size()) ); } else { FatalIOErrorInFunction ( dict ) << "essential value entry not provided" << exit(FatalIOError); } } } template Foam::fvsPatchField::fvsPatchField ( const fvsPatchField& ptf, const fvPatch& p, const DimensionedField& iF, const fieldMapper& mapper, const bool mappingRequired ) : Field(p.size()), patch_(p), internalField_(iF) { if (mappingRequired) { mapper(*this, ptf); } } template Foam::fvsPatchField::fvsPatchField ( const fvsPatchField& ptf, const DimensionedField& iF ) : Field(static_cast&>(ptf)), patch_(ptf.patch_), internalField_(iF) {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template const Foam::objectRegistry& Foam::fvsPatchField::db() const { return patch_.mesh(); } template const Foam::Time& Foam::fvsPatchField::time() const { return patch_.time(); } template void Foam::fvsPatchField::check(const fvsPatchField& ptf) const { if (&patch_ != &(ptf.patch_)) { FatalErrorInFunction << "different patches for fvsPatchFields" << abort(FatalError); } } template void Foam::fvsPatchField::map ( const fvsPatchField& ptf, const fieldMapper& mapper ) { mapper(*this, ptf); } template void Foam::fvsPatchField::reset(const fvsPatchField& ptf) { Field::reset(ptf); } template void Foam::fvsPatchField::write(Ostream& os) const { writeEntry(os, "type", type()); if (overridesConstraint()) { writeEntry(os, "patchType", patch().type()); } } // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template void Foam::fvsPatchField::operator= ( const UList& ul ) { Field::operator=(ul); } template void Foam::fvsPatchField::operator= ( const Field& ul ) { Field::operator=(ul); } template void Foam::fvsPatchField::operator= ( const fvsPatchField& ptf ) { check(ptf); Field::operator=(static_cast&>(ptf)); } template void Foam::fvsPatchField::operator= ( const expression::Assignment>& a ) { a.assign(static_cast&>(*this)); } template template void Foam::fvsPatchField::operator=(const Expression& e) { operator= ( static_cast>&> ( expression::assignment> ( expression::access(e, expression::Base()) ) ) ); } template void Foam::fvsPatchField::operator+= ( const fvsPatchField& ptf ) { check(ptf); Field::operator+=(ptf); } template void Foam::fvsPatchField::operator-= ( const fvsPatchField& ptf ) { check(ptf); Field::operator-=(ptf); } template void Foam::fvsPatchField::operator*= ( const fvsPatchField& ptf ) { if (&patch_ != &ptf.patch()) { FatalErrorInFunction << "incompatible patches for patch fields" << abort(FatalError); } Field::operator*=(ptf); } template void Foam::fvsPatchField::operator/= ( const fvsPatchField& ptf ) { if (&patch_ != &ptf.patch()) { FatalErrorInFunction << abort(FatalError); } Field::operator/=(ptf); } template void Foam::fvsPatchField::operator+= ( const Field& tf ) { Field::operator+=(tf); } template void Foam::fvsPatchField::operator-= ( const Field& tf ) { Field::operator-=(tf); } template void Foam::fvsPatchField::operator*= ( const scalarField& tf ) { Field::operator*=(tf); } template void Foam::fvsPatchField::operator/= ( const scalarField& tf ) { Field::operator/=(tf); } template void Foam::fvsPatchField::operator= ( const Type& t ) { Field::operator=(t); } template void Foam::fvsPatchField::operator+= ( const Type& t ) { Field::operator+=(t); } template void Foam::fvsPatchField::operator-= ( const Type& t ) { Field::operator-=(t); } template void Foam::fvsPatchField::operator*= ( const scalar s ) { Field::operator*=(s); } template void Foam::fvsPatchField::operator/= ( const scalar s ) { Field::operator/=(s); } template void Foam::fvsPatchField::operator== ( const fvsPatchField& ptf ) { Field::operator=(static_cast&>(ptf)); } template void Foam::fvsPatchField::operator== ( const Field& tf ) { Field::operator=(tf); } template void Foam::fvsPatchField::operator== ( const Type& t ) { Field::operator=(t); } template void Foam::fvsPatchField::operator== ( const expression::Assignment>& a ) { a.assign(static_cast&>(*this)); } template template void Foam::fvsPatchField::operator==(const Expression& e) { operator== ( static_cast>&> ( expression::assignment> ( expression::access(e, expression::Base()) ) ) ); } // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // template Foam::Ostream& Foam::operator<<(Ostream& os, const fvsPatchField& ptf) { ptf.write(os); os.check("Ostream& operator<<(Ostream&, const fvsPatchField&"); return os; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #include "fvsPatchFieldNew.C" // ************************************************************************* //