1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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 "distributedTriSurfaceMesh.H"
28 #include "triSurfaceFields.H"
29 #include "mapDistribute.H"
31 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
33 //template<class Type>
34 //void Foam::distributedTriSurfaceMesh::getField
36 // const word& fieldName,
37 // const List<pointIndexHit>& info,
41 // typedef DimensionedField<Type, triSurfaceGeoMesh> DimensionedSurfField;
44 // // Get query data (= local index of triangle)
47 // labelList triangleIndex(info.size());
48 // autoPtr<mapDistribute> mapPtr
56 // const mapDistribute& map = mapPtr();
62 // const DimensionedSurfField& fld = lookupObject<DimensionedSurfField>
66 // const triSurface& s = static_cast<const triSurface&>(*this);
68 // values.setSize(triangleIndex.size());
70 // forAll(triangleIndex, i)
72 // label triI = triangleIndex[i];
73 // values[i] = fld[triI];
77 // // Send back results
78 // // ~~~~~~~~~~~~~~~~~
82 // Pstream::nonBlocking,
83 // List<labelPair>(0),
85 // map.constructMap(), // what to send
86 // map.subMap(), // what to receive
93 void Foam::distributedTriSurfaceMesh::distributeFields
95 const mapDistribute& map
98 typedef DimensionedField<Type, triSurfaceGeoMesh> DimensionedSurfField;
100 HashTable<const DimensionedSurfField*> fields
102 objectRegistry::lookupClass
103 <DimensionedSurfField >()
108 typename HashTable<const DimensionedSurfField*>::iterator fieldIter =
110 fieldIter != fields.end();
114 DimensionedSurfField& field =
115 const_cast<DimensionedSurfField&>(*fieldIter());
117 label oldSize = field.size();
121 Pstream::nonBlocking,
131 Info<< "Mapped " << field.typeName << ' ' << field.name()
132 << " from size " << oldSize << " to size " << field.size()
139 // ************************************************************************* //