/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017,2022 OpenFOAM Foundation Copyright (C) 2015-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- 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 . Class Foam::GeometricBoundaryField Description Generic GeometricBoundaryField class. SourceFiles GeometricBoundaryField.C \*---------------------------------------------------------------------------*/ #ifndef Foam_GeometricBoundaryField_H #define Foam_GeometricBoundaryField_H #include "dimensionedTypes.H" #include "DimensionedField.H" #include "FieldField.H" #include "lduInterfaceFieldPtrsList.H" #include "LduInterfaceFieldPtrsList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { // Forward Declarations class dictionary; template class PatchField, class GeoMesh> class GeometricField; /*---------------------------------------------------------------------------*\ Class GeometricBoundaryField Declaration \*---------------------------------------------------------------------------*/ template class PatchField, class GeoMesh> class GeometricBoundaryField : public FieldField { public: // Public Typedefs //- The boundary mesh type for the boundary fields typedef typename GeoMesh::BoundaryMesh BoundaryMesh; //- The internal field type associated with the boundary fields typedef DimensionedField Internal; //- The patch field type for the boundary fields typedef PatchField Patch; private: // Private Data //- Reference to BoundaryMesh for which this field is defined const BoundaryMesh& bmesh_; public: // Constructors //- Construct from a BoundaryMesh, setting patches later explicit GeometricBoundaryField(const BoundaryMesh& bmesh); //- Construct from a BoundaryMesh, reference to the internal field //- and a patch type GeometricBoundaryField ( const BoundaryMesh& bmesh, const DimensionedField& field, const word& patchFieldType = PatchField::calculatedType() ); //- Construct from a BoundaryMesh, reference to the internal field //- and a wordList of patch types and optional the actual patch //- types (to override constraint patches) GeometricBoundaryField ( const BoundaryMesh& bmesh, const DimensionedField& field, const wordList& wantedPatchTypes, const wordList& actualPatchTypes = wordList() ); //- Construct from a BoundaryMesh, reference to the internal field //- and a PtrList> (to be cloned) GeometricBoundaryField ( const BoundaryMesh& bmesh, const DimensionedField& field, const PtrList>& ptfl ); //- Construct as copy, setting the reference to the internal field GeometricBoundaryField ( const DimensionedField& field, const GeometricBoundaryField& btf ); //- Construct as copy, setting the reference to the internal field //- and resetting type of field for given patch IDs GeometricBoundaryField ( const DimensionedField& field, const GeometricBoundaryField& btf, const labelList& patchIDs, const word& patchFieldName ); //- Copy construct // Dangerous because Field may be set to a field which gets deleted // Need new type of BoundaryField, one which is part of a geometric // field for which snGrad etc. may be called and a free standing // BoundaryField for which such operations are unavailable. GeometricBoundaryField(const GeometricBoundaryField& btf); //- Construct from dictionary GeometricBoundaryField ( const BoundaryMesh& bmesh, const DimensionedField& field, const dictionary& dict ); // Member Functions //- Read the boundary field void readField ( const DimensionedField& field, const dictionary& dict ); //- Update the boundary condition coefficients void updateCoeffs(); //- Evaluate boundary conditions void evaluate(); //- Evaluate boundary conditions on a subset of coupled patches template void evaluateCoupled(); //- Return a list of the patch types wordList types() const; //- Return boundary field of values neighbouring the boundary GeometricBoundaryField boundaryInternalField() const; //- Return a list of pointers for each patch field with only those //- pointing to interfaces being set LduInterfaceFieldPtrsList interfaces() const; //- Return a list of pointers for each patch field with only those //- pointing to interfaces being set lduInterfaceFieldPtrsList scalarInterfaces() const; //- Write boundary field as dictionary entry void writeEntry(const word& keyword, Ostream& os) const; //- Write dictionary entries of the individual boundary fields. void writeEntries(Ostream& os) const; // Member Operators //- Copy assignment from GeometricBoundaryField void operator=(const GeometricBoundaryField& bf); //- Copy assignment from FieldField\ void operator=(const FieldField& bf); //- Assignment to uniform value void operator=(const Type& val); //- Forced assignment from GeometricBoundaryField void operator==(const GeometricBoundaryField& bf); //- Forced assignment from FieldField\ void operator==(const FieldField& bf); //- Forced assignment to uniform value void operator==(const Type& val); }; template class PatchField, class GeoMesh> Ostream& operator<< ( Ostream&, const GeometricBoundaryField& ); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository #include "GeometricBoundaryField.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif // ************************************************************************* //