Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / src / OpenFOAM / fields / pointPatchFields / constraint / processor / processorPointPatchField.C
bloba2f4e77e803ae867652c0a454a69dc1e21aadf25
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2004-2010 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
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 \*---------------------------------------------------------------------------*/
26 #include "processorPointPatchField.H"
27 //#include "transformField.H"
28 #include "processorPolyPatch.H"
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 namespace Foam
35 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
37 template<class Type>
38 processorPointPatchField<Type>::processorPointPatchField
40     const pointPatch& p,
41     const DimensionedField<Type, pointMesh>& iF
44     coupledPointPatchField<Type>(p, iF),
45     procPatch_(refCast<const processorPointPatch>(p))
49 template<class Type>
50 processorPointPatchField<Type>::processorPointPatchField
52     const pointPatch& p,
53     const DimensionedField<Type, pointMesh>& iF,
54     const dictionary& dict
57     coupledPointPatchField<Type>(p, iF, dict),
58     procPatch_(refCast<const processorPointPatch>(p))
62 template<class Type>
63 processorPointPatchField<Type>::processorPointPatchField
65     const processorPointPatchField<Type>& ptf,
66     const pointPatch& p,
67     const DimensionedField<Type, pointMesh>& iF,
68     const pointPatchFieldMapper& mapper
71     coupledPointPatchField<Type>(ptf, p, iF, mapper),
72     procPatch_(refCast<const processorPointPatch>(ptf.patch()))
76 template<class Type>
77 processorPointPatchField<Type>::processorPointPatchField
79     const processorPointPatchField<Type>& ptf,
80     const DimensionedField<Type, pointMesh>& iF
83     coupledPointPatchField<Type>(ptf, iF),
84     procPatch_(refCast<const processorPointPatch>(ptf.patch()))
88 // * * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * //
90 template<class Type>
91 processorPointPatchField<Type>::~processorPointPatchField()
95 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
97 template<class Type>
98 void processorPointPatchField<Type>::initSwapAddSeparated
100     const Pstream::commsTypes commsType,
101     Field<Type>& pField
103 const
105 //    if (Pstream::parRun())
106 //    {
107 //        // Get internal field into correct order for opposite side
108 //        Field<Type> pf
109 //        (
110 //            this->patchInternalField
111 //            (
112 //                pField,
113 //                procPatch_.reverseMeshPoints()
114 //            )
115 //        );
117 //        OPstream::write
118 //        (
119 //            commsType,
120 //            procPatch_.neighbProcNo(),
121 //            reinterpret_cast<const char*>(pf.begin()),
122 //            pf.byteSize(),
123 //            procPatch_.tag()
124 //        );
125 //    }
129 template<class Type>
130 void processorPointPatchField<Type>::swapAddSeparated
132     const Pstream::commsTypes commsType,
133     Field<Type>& pField
134 ) const
136 //    if (Pstream::parRun())
137 //    {
138 //        Field<Type> pnf(this->size());
140 //        IPstream::read
141 //        (
142 //            commsType,
143 //            procPatch_.neighbProcNo(),
144 //            reinterpret_cast<char*>(pnf.begin()),
145 //            pnf.byteSize(),
146 //            procPatch_.tag()
147 //        );
149 //        if (doTransform())
150 //        {
151 //            const processorPolyPatch& ppp = procPatch_.procPolyPatch();
152 //            const tensor& forwardT = ppp.forwardT();
154 //            transform(pnf, forwardT, pnf);
155 //        }
157 //        addToInternalField(pField, pnf, procPatch_.separatedPoints());
158 //    }
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 } // End namespace Foam
166 // ************************************************************************* //