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 "distributedTriSurfaceMesh.H"
27 #include "triSurfaceFields.H"
28 #include "mapDistribute.H"
30 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
32 //template<class Type>
33 //void Foam::distributedTriSurfaceMesh::getField
35 // const word& fieldName,
36 // const List<pointIndexHit>& info,
40 // typedef DimensionedField<Type, triSurfaceGeoMesh> DimensionedSurfField;
43 // // Get query data (= local index of triangle)
46 // labelList triangleIndex(info.size());
47 // autoPtr<mapDistribute> mapPtr
55 // const mapDistribute& map = mapPtr();
61 // const DimensionedSurfField& fld = lookupObject<DimensionedSurfField>
65 // const triSurface& s = static_cast<const triSurface&>(*this);
67 // values.setSize(triangleIndex.size());
69 // forAll(triangleIndex, i)
71 // label triI = triangleIndex[i];
72 // values[i] = fld[triI];
76 // // Send back results
77 // // ~~~~~~~~~~~~~~~~~
81 // Pstream::nonBlocking,
82 // List<labelPair>(0),
84 // map.constructMap(), // what to send
85 // map.subMap(), // what to receive
92 void Foam::distributedTriSurfaceMesh::distributeFields
94 const mapDistribute& map
97 typedef DimensionedField<Type, triSurfaceGeoMesh> DimensionedSurfField;
99 HashTable<const DimensionedSurfField*> fields
101 objectRegistry::lookupClass
102 <DimensionedSurfField >()
107 typename HashTable<const DimensionedSurfField*>::iterator fieldIter =
109 fieldIter != fields.end();
113 DimensionedSurfField& field =
114 const_cast<DimensionedSurfField&>(*fieldIter());
116 label oldSize = field.size();
120 Pstream::nonBlocking,
130 Info<< "Mapped " << field.typeName << ' ' << field.name()
131 << " from size " << oldSize << " to size " << field.size()
138 // ************************************************************************* //