initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / finiteVolume / fields / fvsPatchFields / constraint / processor / processorFvsPatchField.C
blob5aa907a83d6ed7c40e1e3264226add4593a14217
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 \*---------------------------------------------------------------------------*/
27 #include "processorFvsPatchField.H"
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31 namespace Foam
34 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
36 template<class Type>
37 processorFvsPatchField<Type>::processorFvsPatchField
39     const fvPatch& p,
40     const DimensionedField<Type, surfaceMesh>& iF
43     coupledFvsPatchField<Type>(p, iF),
44     procPatch_(refCast<const processorFvPatch>(p))
48 template<class Type>
49 processorFvsPatchField<Type>::processorFvsPatchField
51     const fvPatch& p,
52     const DimensionedField<Type, surfaceMesh>& iF,
53     const Field<Type>& f
56     coupledFvsPatchField<Type>(p, iF, f),
57     procPatch_(refCast<const processorFvPatch>(p))
61 // Construct by mapping given processorFvsPatchField<Type>
62 template<class Type>
63 processorFvsPatchField<Type>::processorFvsPatchField
65     const processorFvsPatchField<Type>& ptf,
66     const fvPatch& p,
67     const DimensionedField<Type, surfaceMesh>& iF,
68     const fvPatchFieldMapper& mapper
71     coupledFvsPatchField<Type>(ptf, p, iF, mapper),
72     procPatch_(refCast<const processorFvPatch>(p))
74     if (!isType<processorFvPatch>(this->patch()))
75     {
76         FatalErrorIn
77         (
78             "processorFvsPatchField<Type>::processorFvsPatchField\n"
79             "(\n"
80             "    const processorFvsPatchField<Type>& ptf,\n"
81             "    const fvPatch& p,\n"
82             "    const DimensionedField<Type, surfaceMesh>& iF,\n"
83             "    const fvPatchFieldMapper& mapper\n"
84             ")\n"
85         )   << "Field type does not correspond to patch type for patch "
86             << this->patch().index() << "." << endl
87             << "Field type: " << typeName << endl
88             << "Patch type: " << this->patch().type()
89             << exit(FatalError);
90     }
94 template<class Type>
95 processorFvsPatchField<Type>::processorFvsPatchField
97     const fvPatch& p,
98     const DimensionedField<Type, surfaceMesh>& iF,
99     const dictionary& dict
102     coupledFvsPatchField<Type>(p, iF, dict),
103     procPatch_(refCast<const processorFvPatch>(p))
105     if (!isType<processorFvPatch>(p))
106     {
107         FatalIOErrorIn
108         (
109             "processorFvsPatchField<Type>::processorFvsPatchField\n"
110             "(\n"
111             "    const fvPatch& p,\n"
112             "    const Field<Type>& field,\n"
113             "    const dictionary& dict\n"
114             ")\n",
115             dict
116         )   << "patch " << this->patch().index() << " not processor type. "
117             << "Patch type = " << p.type()
118             << exit(FatalIOError);
119     }
123 template<class Type>
124 processorFvsPatchField<Type>::processorFvsPatchField
126     const processorFvsPatchField<Type>& ptf
129     coupledFvsPatchField<Type>(ptf),
130     procPatch_(refCast<const processorFvPatch>(ptf.patch()))
134 template<class Type>
135 processorFvsPatchField<Type>::processorFvsPatchField
137     const processorFvsPatchField<Type>& ptf,
138     const DimensionedField<Type, surfaceMesh>& iF
141     coupledFvsPatchField<Type>(ptf, iF),
142     procPatch_(refCast<const processorFvPatch>(ptf.patch()))
146 // * * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * //
148 template<class Type>
149 processorFvsPatchField<Type>::~processorFvsPatchField()
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 } // End namespace Foam
157 // ************************************************************************* //