BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / finiteVolume / fields / fvPatchFields / derived / fixedJump / fixedJumpFvPatchField.H
blobc746b975cf1e1c78323ad99d595ad7042c19aa70
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software: you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by
13     the Free Software Foundation, either version 3 of the License, or
14     (at your option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::fixedJumpFvPatchField
27 Description
28     Base class for "jump" of a field<type>
30 SourceFiles
31     fixedJumpFvPatchField.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef fixedJumpFvPatchField_H
36 #define fixedJumpFvPatchField_H
38 #include "jumpCyclicFvPatchField.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 namespace Foam
45 /*---------------------------------------------------------------------------*\
46                     Class fixedJumpFvPatchField Declaration
47 \*---------------------------------------------------------------------------*/
49 template<class Type>
50 class fixedJumpFvPatchField
52     public jumpCyclicFvPatchField<Type>
55 protected:
57     // Protected data
59         //- "jump" field
60         Field<Type> jump_;
63 public:
66     // Constructors
68         //- Construct from patch and internal field
69         fixedJumpFvPatchField
70         (
71             const fvPatch&,
72             const DimensionedField<Type, volMesh>&
73         );
75         //- Construct from patch, internal field and dictionary
76         fixedJumpFvPatchField
77         (
78             const fvPatch&,
79             const DimensionedField<Type, volMesh>&,
80             const dictionary&
81         );
83         //- Construct by mapping given fixedJumpFvPatchField onto a
84         //  new patch
85         fixedJumpFvPatchField
86         (
87             const fixedJumpFvPatchField<Type>&,
88             const fvPatch&,
89             const DimensionedField<Type, volMesh>&,
90             const fvPatchFieldMapper&
91         );
93         //- Construct as copy
94         fixedJumpFvPatchField
95         (
96             const fixedJumpFvPatchField<Type>&
97         );
99         //- Construct and return a clone
100         virtual tmp<fvPatchField<Type> > clone() const
101         {
102             return tmp<fvPatchField<Type> >
103             (
104                 new fixedJumpFvPatchField<Type>(*this)
105             );
106         }
108         //- Construct as copy setting internal field reference
109         fixedJumpFvPatchField
110         (
111             const fixedJumpFvPatchField<Type>&,
112             const DimensionedField<Type, volMesh>&
113         );
115         //- Construct and return a clone setting internal field reference
116         virtual tmp<fvPatchField<Type> > clone
117         (
118             const DimensionedField<Type, volMesh>& iF
119         ) const
120         {
121             return tmp<fvPatchField<Type> >
122             (
123                 new fixedJumpFvPatchField<Type>(*this, iF)
124             );
125         }
128     // Member functions
130         // Access
132             //- Return the "jump" across the patch.
133             virtual tmp<Field<Type> > jump() const
134             {
135                 if (this->cyclicPatch().owner())
136                 {
137                     return jump_;
138                 }
139                 else
140                 {
141                     return refCast<const fixedJumpFvPatchField<Type> >
142                     (
143                         this->neighbourPatchField()
144                     ).jump();
145                 }
146             }
149         // Mapping functions
151             //- Map (and resize as needed) from self given a mapping object
152             virtual void autoMap
153             (
154                 const fvPatchFieldMapper&
155             );
157             //- Reverse map the given fvPatchField onto this fvPatchField
158             virtual void rmap
159             (
160                 const fvPatchField<Type>&,
161                 const labelList&
162             );
165         //- Write
166         virtual void write(Ostream&) const;
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 } // End namespace Foam
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 #ifdef NoRepository
177 #   include "fixedJumpFvPatchField.C"
178 #endif
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 #endif
184 // ************************************************************************* //