edgeVertex.H
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
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef edgeVertex_H
00037 #define edgeVertex_H
00038
00039 #include "label.H"
00040 #include "polyMesh.H"
00041
00042
00043
00044 namespace Foam
00045 {
00046
00047
00048 class refineCell;
00049
00050
00051
00052
00053
00054 class edgeVertex
00055 {
00056
00057
00058
00059
00060 const polyMesh& mesh_;
00061
00062
00063
00064
00065 edgeVertex(const edgeVertex&);
00066
00067
00068 void operator=(const edgeVertex&);
00069
00070
00071 public:
00072
00073
00074
00075
00076
00077 static void updateLabels(const labelList& map, List<refineCell>&);
00078
00079
00080
00081 static void updateLabels(const labelList& map, Map<label>&);
00082
00083
00084
00085 static void updateLabels(const labelList& map, labelHashSet&);
00086
00087
00088
00089
00090
00091
00092 edgeVertex(const polyMesh& mesh)
00093 :
00094 mesh_(mesh)
00095 {}
00096
00097
00098
00099
00100 const polyMesh& mesh() const
00101 {
00102 return mesh_;
00103 }
00104
00105
00106
00107
00108
00109 static bool isEdge(const primitiveMesh& mesh, const label eVert)
00110 {
00111 if (eVert < 0 || eVert >= (mesh.nPoints() + mesh.nEdges()))
00112 {
00113 FatalErrorIn
00114 (
00115 "edgeVertex::isEdge(const primitiveMesh&, const label)"
00116 ) << "EdgeVertex " << eVert << " out of range "
00117 << mesh.nPoints() << " to "
00118 << (mesh.nPoints() + mesh.nEdges() - 1)
00119 << abort(FatalError);
00120 }
00121
00122 return eVert >= mesh.nPoints();
00123 }
00124 bool isEdge(const label eVert) const
00125 {
00126 return isEdge(mesh_, eVert);
00127 }
00128
00129
00130 static label getEdge(const primitiveMesh& mesh, const label eVert)
00131 {
00132 if (!isEdge(mesh, eVert))
00133 {
00134 FatalErrorIn
00135 (
00136 "edgeVertex::getEdge(const primitiveMesh&, const label)"
00137 ) << "EdgeVertex " << eVert << " not an edge"
00138 << abort(FatalError);
00139 }
00140 return eVert - mesh.nPoints();
00141 }
00142 label getEdge(const label eVert) const
00143 {
00144 return getEdge(mesh_, eVert);
00145 }
00146
00147
00148 static label getVertex(const primitiveMesh& mesh, const label eVert)
00149 {
00150 if (isEdge(mesh, eVert) || (eVert < 0))
00151 {
00152 FatalErrorIn
00153 (
00154 "edgeVertex::getVertex(const primitiveMesh&, const label)"
00155 ) << "EdgeVertex " << eVert << " not a vertex"
00156 << abort(FatalError);
00157 }
00158 return eVert;
00159 }
00160 label getVertex(const label eVert) const
00161 {
00162 return getVertex(mesh_, eVert);
00163 }
00164
00165
00166 static label vertToEVert(const primitiveMesh& mesh, const label vertI)
00167 {
00168 if ((vertI < 0) || (vertI >= mesh.nPoints()))
00169 {
00170 FatalErrorIn
00171 (
00172 "edgeVertex::vertToEVert(const primitiveMesh&, const label)"
00173 ) << "Illegal vertex number " << vertI
00174 << abort(FatalError);
00175 }
00176 return vertI;
00177 }
00178 label vertToEVert(const label vertI) const
00179 {
00180 return vertToEVert(mesh_, vertI);
00181 }
00182
00183
00184 static label edgeToEVert(const primitiveMesh& mesh, const label edgeI)
00185 {
00186 if ((edgeI < 0) || (edgeI >= mesh.nEdges()))
00187 {
00188 FatalErrorIn
00189 (
00190 "edgeVertex::edgeToEVert(const primitiveMesh&const label)"
00191 ) << "Illegal edge number " << edgeI
00192 << abort(FatalError);
00193 }
00194 return mesh.nPoints() + edgeI;
00195 }
00196 label edgeToEVert(const label edgeI) const
00197 {
00198 return edgeToEVert(mesh_, edgeI);
00199 }
00200
00201
00202 static point coord
00203 (
00204 const primitiveMesh&,
00205 const label cut,
00206 const scalar weight
00207 );
00208 point coord(const label cut, const scalar weight) const
00209 {
00210 return coord(mesh_, cut, weight);
00211 }
00212
00213
00214 static label cutPairToEdge
00215 (
00216 const primitiveMesh&,
00217 const label cut0,
00218 const label cut1
00219 );
00220 label cutPairToEdge(const label cut0, const label cut1) const
00221 {
00222 return cutPairToEdge(mesh_, cut0, cut1);
00223 }
00224
00225
00226 Ostream& writeCut(Ostream& os, const label cut, const scalar) const;
00227
00228
00229 Ostream& writeCuts(Ostream& os, const labelList&, const scalarField&)
00230 const;
00231 };
00232
00233
00234
00235
00236 }
00237
00238
00239
00240 #endif
00241
00242
Copyright © 2000-2009 OpenCFD Ltd