initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / finiteVolume / fields / fvsPatchFields / constraint / processor / processorFvsPatchField.H
blob47b33e89390b671b41cf7dccc66d1c2755ff4320
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::processorFvsPatchField
28 Description
29     Foam::processorFvsPatchField
31 SourceFiles
32     processorFvsPatchField.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef processorFvsPatchField_H
37 #define processorFvsPatchField_H
39 #include "coupledFvsPatchField.H"
40 #include "processorFvPatch.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace Foam
47 /*---------------------------------------------------------------------------*\
48                       Class processorFvsPatch Declaration
49 \*---------------------------------------------------------------------------*/
51 template<class Type>
52 class processorFvsPatchField
54     public coupledFvsPatchField<Type>
56     // Private data
58         //- Local reference cast into the processor patch
59         const processorFvPatch& procPatch_;
62 public:
64     //- Runtime type information
65     TypeName(processorFvPatch::typeName_());
68     // Constructors
70         //- Construct from patch and internal field
71         processorFvsPatchField
72         (
73             const fvPatch&,
74             const DimensionedField<Type, surfaceMesh>&
75         );
77         //- Construct from patch and internal field and patch field
78         processorFvsPatchField
79         (
80             const fvPatch&,
81             const DimensionedField<Type, surfaceMesh>&,
82             const Field<Type>&
83         );
85         //- Construct from patch, internal field and dictionary
86         processorFvsPatchField
87         (
88             const fvPatch&,
89             const DimensionedField<Type, surfaceMesh>&,
90             const dictionary&
91         );
93         //- Construct by mapping given processorFvsPatchField onto a new patch
94         processorFvsPatchField
95         (
96             const processorFvsPatchField<Type>&,
97             const fvPatch&,
98             const DimensionedField<Type, surfaceMesh>&,
99             const fvPatchFieldMapper&
100         );
102         //- Construct as copy
103         processorFvsPatchField(const processorFvsPatchField<Type>&);
105         //- Construct and return a clone
106         virtual tmp<fvsPatchField<Type> > clone() const
107         {
108             return tmp<fvsPatchField<Type> >
109             (
110                 new processorFvsPatchField<Type>(*this)
111             );
112         }
114         //- Construct as copy setting internal field reference
115         processorFvsPatchField
116         (
117             const processorFvsPatchField<Type>&,
118             const DimensionedField<Type, surfaceMesh>&
119         );
121         //- Construct and return a clone setting internal field reference
122         virtual tmp<fvsPatchField<Type> > clone
123         (
124             const DimensionedField<Type, surfaceMesh>& iF
125         ) const
126         {
127             return tmp<fvsPatchField<Type> >
128             (
129                 new processorFvsPatchField<Type>(*this, iF)
130             );
131         }
134     // Destructor
136         ~processorFvsPatchField();
139     // Member functions
141         // Access
143             //- Return true if running parallel
144             virtual bool coupled() const
145             {
146                 if (Pstream::parRun())
147                 {
148                     return true;
149                 }
150                 else
151                 {
152                     return false;
153                 }
154             }
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 } // End namespace Foam
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 #ifdef NoRepository
165 #   include "processorFvsPatchField.C"
166 #endif
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 #endif
172 // ************************************************************************* //