pointSet.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "pointSet.H"
00028 #include "mapPolyMesh.H"
00029 #include "polyMesh.H"
00030 #include "syncTools.H"
00031
00032 #include "addToRunTimeSelectionTable.H"
00033
00034
00035
00036 namespace Foam
00037 {
00038
00039
00040
00041 defineTypeNameAndDebug(pointSet, 0);
00042
00043 addToRunTimeSelectionTable(topoSet, pointSet, word);
00044 addToRunTimeSelectionTable(topoSet, pointSet, size);
00045
00046
00047
00048
00049 pointSet::pointSet(const IOobject& obj)
00050 :
00051 topoSet(obj, typeName)
00052 {}
00053
00054
00055 pointSet::pointSet
00056 (
00057 const polyMesh& mesh,
00058 const word& name,
00059 readOption r,
00060 writeOption w
00061 )
00062 :
00063 topoSet(mesh, typeName, name, r, w)
00064 {
00065 check(mesh.nPoints());
00066 }
00067
00068
00069 pointSet::pointSet
00070 (
00071 const polyMesh& mesh,
00072 const word& name,
00073 const label size,
00074 writeOption w
00075 )
00076 :
00077 topoSet(mesh, name, size, w)
00078 {}
00079
00080
00081 pointSet::pointSet
00082 (
00083 const polyMesh& mesh,
00084 const word& name,
00085 const labelHashSet& set,
00086 writeOption w
00087 )
00088 :
00089 topoSet(mesh, name, set, w)
00090 {}
00091
00092
00093
00094
00095 pointSet::~pointSet()
00096 {}
00097
00098
00099
00100
00101 void pointSet::sync(const polyMesh& mesh)
00102 {
00103
00104
00105 boolList contents(mesh.nPoints(), false);
00106
00107 forAllConstIter(pointSet, *this, iter)
00108 {
00109 contents[iter.key()] = true;
00110 }
00111 syncTools::syncPointList
00112 (
00113 mesh,
00114 contents,
00115 orEqOp<bool>(),
00116 false,
00117 false
00118 );
00119
00120
00121
00122 labelHashSet newContents(size());
00123
00124 forAll(contents, pointI)
00125 {
00126 if (contents[pointI])
00127 {
00128 newContents.insert(pointI);
00129 }
00130 }
00131
00132 transfer(newContents);
00133 }
00134
00135
00136 label pointSet::maxSize(const polyMesh& mesh) const
00137 {
00138 return mesh.nPoints();
00139 }
00140
00141
00142 void pointSet::updateMesh(const mapPolyMesh& morphMap)
00143 {
00144 updateLabels(morphMap.reversePointMap());
00145 }
00146
00147
00148 void pointSet::writeDebug
00149 (
00150 Ostream& os,
00151 const primitiveMesh& mesh,
00152 const label maxLen
00153 ) const
00154 {
00155 topoSet::writeDebug(os, mesh.points(), maxLen);
00156 }
00157
00158
00159
00160 }
00161
00162
Copyright © 2000-2009 OpenCFD Ltd