slicedFaePatchField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011 OpenFOAM Foundation
9  Copyright (C) 2023 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::slicedFaePatchField
29 
30 Description
31  Specialization of faePatchField which creates the underlying
32  faePatchField as a slice of the given complete field.
33 
34  The destructor is wrapped to avoid deallocation of the storage of the
35  complete fields when this is destroyed.
36 
37  Should only used as a template argument for SlicedGeometricField.
38 
39 SourceFiles
40  slicedFaePatchField.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef Foam_slicedFaePatchField_H
45 #define Foam_slicedFaePatchField_H
46 
47 #include "faePatchField.H"
48 #include "processorFaPatch.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class slicedFaePatchField Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 template<class Type>
60 class slicedFaePatchField
61 :
62  public faePatchField<Type>
63 {
64 public:
65 
66  //- Type for the mesh processor patch
68 
69 
70  //- Runtime type information
71  TypeName("sliced");
72 
73 
74  // Constructors
75 
76  //- Construct from patch, internal field and field to slice
78  (
79  const faPatch&,
81  const Field<Type>& completeOrBoundaryField,
82  const bool isBoundaryOnly = false
83  );
84 
85  //- Construct from patch and internal field
87  (
88  const faPatch&,
90  );
91 
92  //- Construct from patch, internal field and dictionary
94  (
95  const faPatch&,
97  const dictionary&
98  );
99 
100  //- Construct by mapping the given sliced patch field onto a new patch
102  (
104  const faPatch&,
106  const faPatchFieldMapper&
107  );
108 
109  //- Construct as copy
111 
112  //- Construct as copy setting internal field reference
114  (
117  );
118 
119  //- Return clone
120  virtual tmp<faePatchField<Type>> clone() const
121  {
122  return faePatchField<Type>::Clone(*this);
123  }
124 
125  //- Clone with an internal field reference
127  (
129  ) const
130  {
131  return faePatchField<Type>::Clone(*this, iF);
132  }
134 
135  //- Destructor, resets pointers to avoid deletion of underlying field
136  virtual ~slicedFaePatchField();
137 
138 
139  // Member Functions
140 
141  //- True: this patch field fixes a value.
142  virtual bool fixesValue() const { return true; }
143 
144  //- Write includes "value" entry
145  virtual void write(Ostream&) const;
146 
147 
148  // Member Operators
149 
150  virtual void operator=(const UList<Type>&) {}
151 
152  virtual void operator=(const faePatchField<Type>&) {}
153  virtual void operator+=(const faePatchField<Type>&) {}
154  virtual void operator-=(const faePatchField<Type>&) {}
155  virtual void operator*=(const faePatchField<scalar>&) {}
156  virtual void operator/=(const faePatchField<scalar>&) {}
157 
158  virtual void operator+=(const Field<Type>&) {}
159  virtual void operator-=(const Field<Type>&) {}
160 
161  virtual void operator*=(const Field<scalar>&) {}
162  virtual void operator/=(const Field<scalar>&) {}
163 
164  virtual void operator=(const Type&) {}
165  virtual void operator+=(const Type&) {}
166  virtual void operator-=(const Type&) {}
167  virtual void operator*=(const scalar) {}
168  virtual void operator/=(const scalar) {}
169 };
170 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 } // End namespace Foam
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 #ifdef NoRepository
180 #endif
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 #endif
186 // ************************************************************************* //
virtual void operator+=(const faePatchField< Type > &)
virtual tmp< faePatchField< Type > > clone() const
Return clone.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
processorFaPatch processorPatchType
Type for the mesh processor patch.
virtual void operator=(const UList< Type > &)
virtual bool fixesValue() const
True: this patch field fixes a value.
slicedFaePatchField(const faPatch &, const DimensionedField< Type, edgeMesh > &, const Field< Type > &completeOrBoundaryField, const bool isBoundaryOnly=false)
Construct from patch, internal field and field to slice.
Specialization of faePatchField which creates the underlying faePatchField as a slice of the given co...
static tmp< faePatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
virtual void write(Ostream &) const
Write includes "value" entry.
Generic templated field type.
Definition: Field.H:62
virtual void operator*=(const faePatchField< scalar > &)
virtual ~slicedFaePatchField()
Destructor, resets pointers to avoid deletion of underlying field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
virtual void operator/=(const faePatchField< scalar > &)
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Definition: faPatch.H:72
virtual void operator-=(const faePatchField< Type > &)
TypeName("sliced")
Runtime type information.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A class for managing temporary objects.
Definition: HashPtrTable.H:50
A FieldMapper for finite-area patch fields.
Namespace for OpenFOAM.
Processor patch.