1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
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 "pointFieldReconstructor.H"
29 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 Foam::pointFieldReconstructor::pointFieldReconstructor
33 const pointMesh& mesh,
34 const PtrList<pointMesh>& procMeshes,
35 const PtrList<labelIOList>& pointProcAddressing,
36 const PtrList<labelIOList>& boundaryProcAddressing
40 procMeshes_(procMeshes),
41 pointProcAddressing_(pointProcAddressing),
42 boundaryProcAddressing_(boundaryProcAddressing),
43 patchPointAddressing_(procMeshes.size())
45 // Inverse-addressing of the patch point labels.
46 labelList pointMap(mesh_.size(), -1);
48 // Create the pointPatch addressing
49 forAll(procMeshes_, proci)
51 const pointMesh& procMesh = procMeshes_[proci];
53 patchPointAddressing_[proci].setSize(procMesh.boundary().size());
55 forAll(procMesh.boundary(), patchi)
57 if (boundaryProcAddressing_[proci][patchi] >= 0)
59 labelList& procPatchAddr = patchPointAddressing_[proci][patchi];
60 procPatchAddr.setSize(procMesh.boundary()[patchi].size(), -1);
62 const labelList& patchPointLabels =
63 mesh_.boundary()[boundaryProcAddressing_[proci][patchi]]
66 // Create the inverse-addressing of the patch point labels.
67 forAll (patchPointLabels, pointi)
69 pointMap[patchPointLabels[pointi]] = pointi;
72 const labelList& procPatchPoints =
73 procMesh.boundary()[patchi].meshPoints();
75 forAll (procPatchPoints, pointi)
77 procPatchAddr[pointi] =
80 pointProcAddressing_[proci][procPatchPoints[pointi]]
84 if (procPatchAddr.size() && min(procPatchAddr) < 0)
88 "pointFieldReconstructor::pointFieldReconstructor"
90 " const pointMesh& mesh,\n"
91 " const PtrList<pointMesh>& procMeshes,\n"
92 " const PtrList<labelIOList>& pointProcAddressing,\n"
93 " const PtrList<labelIOList>& "
94 "boundaryProcAddressing\n"
96 ) << "Incomplete patch point addressing"
105 // ************************************************************************* //