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 \*---------------------------------------------------------------------------*/
26 #include "pointFieldReconstructor.H"
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
30 Foam::pointFieldReconstructor::pointFieldReconstructor
32 const pointMesh& mesh,
33 const PtrList<pointMesh>& procMeshes,
34 const PtrList<labelIOList>& pointProcAddressing,
35 const PtrList<labelIOList>& boundaryProcAddressing
39 procMeshes_(procMeshes),
40 pointProcAddressing_(pointProcAddressing),
41 boundaryProcAddressing_(boundaryProcAddressing),
42 patchPointAddressing_(procMeshes.size())
44 // Inverse-addressing of the patch point labels.
45 labelList pointMap(mesh_.size(), -1);
47 // Create the pointPatch addressing
48 forAll(procMeshes_, proci)
50 const pointMesh& procMesh = procMeshes_[proci];
52 patchPointAddressing_[proci].setSize(procMesh.boundary().size());
54 forAll(procMesh.boundary(), patchi)
56 if (boundaryProcAddressing_[proci][patchi] >= 0)
58 labelList& procPatchAddr = patchPointAddressing_[proci][patchi];
59 procPatchAddr.setSize(procMesh.boundary()[patchi].size(), -1);
61 const labelList& patchPointLabels =
62 mesh_.boundary()[boundaryProcAddressing_[proci][patchi]]
65 // Create the inverse-addressing of the patch point labels.
66 forAll (patchPointLabels, pointi)
68 pointMap[patchPointLabels[pointi]] = pointi;
71 const labelList& procPatchPoints =
72 procMesh.boundary()[patchi].meshPoints();
74 forAll (procPatchPoints, pointi)
76 procPatchAddr[pointi] =
79 pointProcAddressing_[proci][procPatchPoints[pointi]]
83 if (procPatchAddr.size() && min(procPatchAddr) < 0)
87 "pointFieldReconstructor::pointFieldReconstructor"
89 " const pointMesh& mesh,\n"
90 " const PtrList<pointMesh>& procMeshes,\n"
91 " const PtrList<labelIOList>& pointProcAddressing,\n"
92 " const PtrList<labelIOList>& "
93 "boundaryProcAddressing\n"
95 ) << "Incomplete patch point addressing"
104 // ************************************************************************* //