1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31 //- Interpolate point field
34 coupleMap::pointInterpolate
36 const Map<label>& mPointMap,
37 const Map<label>& sPointMap,
38 const Field<Type>& pf,
42 const Map<label>& pointMap = entityMap(coupleMap::POINT);
44 if (pf.size() != pointMap.size())
48 "coupleMap::pointInterpolate"
49 "(const Field<Type> pf)"
50 ) << "given field does not correspond to patch. Patch size: "
51 << pointMap.size() << " field size: " << pf.size()
55 tmp<Field<Type> > tresult
64 Field<Type>& result = tresult();
68 forAllConstIter(Map<label>, pointMap, pIter)
70 result[mPointMap[pIter.key()]] = pf[sPointMap[pIter()]];
75 forAllConstIter(Map<label>, pointMap, pIter)
77 result[sPointMap[pIter()]] = pf[mPointMap[pIter.key()]];
87 coupleMap::pointInterpolate
89 const Map<label>& mPointMap,
90 const Map<label>& sPointMap,
91 const tmp<Field<Type> >& tpf,
95 tmp<Field<Type> > tint =
97 pointInterpolate<Type>(mPointMap, sPointMap, tpf(), reverse)
104 //- Interpolate point field
107 coupleMap::faceInterpolate
111 const Field<Type>& pf,
115 const Map<label>& faceMap = entityMap(coupleMap::FACE);
117 if (pf.size() != faceMap.size())
121 "coupleMap::faceInterpolate"
122 "(const Field<Type> pf)"
123 ) << "given field does not correspond to patch. Patch size: "
124 << faceMap.size() << " field size: " << pf.size()
125 << abort(FatalError);
128 tmp<Field<Type> > tresult
137 Field<Type>& result = tresult();
141 forAllConstIter(Map<label>, faceMap, fIter)
143 result[fIter.key() - mStart] = pf[fIter() - sStart];
148 forAllConstIter(Map<label>, faceMap, fIter)
150 result[fIter() - sStart] = pf[fIter.key() - mStart];
160 coupleMap::faceInterpolate
164 const tmp<Field<Type> >& tpf,
168 tmp<Field<Type> > tint =
170 faceInterpolate<Type>(mStart, sStart, tpf(), reverse)
177 inline label& coupleMap::patchIndex() const
183 inline label coupleMap::masterIndex() const
189 inline label coupleMap::slaveIndex() const
195 inline bool coupleMap::isTwoDMesh() const
201 inline bool coupleMap::isLocal() const
207 inline bool coupleMap::isProcessor() const
213 inline bool coupleMap::isSend() const
219 inline bool coupleMap::isRecv() const
225 inline coupleMap::EntitySizeList& coupleMap::nEntities() const
231 inline label& coupleMap::nEntities(const label eType) const
233 return nEntities_[eType];
237 inline Map<label>& coupleMap::entityMap(const label eType) const
239 return entityMap_[eType];
243 inline Map<label>& coupleMap::reverseEntityMap(const label eType) const
245 return reverseEntityMap_[eType];
249 inline coupleMap::EntityBufferList& coupleMap::entityBuffer() const
251 return entityBuffer_;
255 inline labelList& coupleMap::entityBuffer(const label eType) const
257 return entityBuffer_[eType];
261 inline labelList& coupleMap::entityIndices() const
263 return entityIndices_;
267 inline List<coupleMap::opType>& coupleMap::entityOperations() const
269 return entityOperations_;
273 inline labelList& coupleMap::patchIndices() const
275 return patchIndices_;
279 inline pointField& coupleMap::moveNewPoints() const
281 return moveNewPoints_;
285 inline pointField& coupleMap::moveOldPoints() const
287 return moveOldPoints_;
291 inline Map<labelList>& coupleMap::subMeshPointMap() const
293 return subMeshPointMap_;
297 inline Map<labelList>& coupleMap::subMeshEdgeMap() const
299 return subMeshEdgeMap_;
303 } // End namespace Foam
305 // ************************************************************************* //