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 bool isEdge(const label eVert) const
00110 {
00111 if (eVert < 0 || eVert >= (mesh_.nPoints() + mesh_.nEdges()))
00112 {
00113 FatalErrorIn("edgeVertex::isEdge(const label)")
00114 << "EdgeVertex " << eVert << " out of range "
00115 << mesh_.nPoints() << " to "
00116 << (mesh_.nPoints() + mesh_.nEdges() - 1)
00117 << abort(FatalError);
00118 }
00119
00120 return eVert >= mesh_.nPoints();
00121 }
00122
00123
00124 label getEdge(const label eVert) const
00125 {
00126 if (!isEdge(eVert))
00127 {
00128 FatalErrorIn("edgeVertex::getEdge(const label)")
00129 << "EdgeVertex " << eVert << " not an edge"
00130 << abort(FatalError);
00131 }
00132 return eVert - mesh_.nPoints();
00133 }
00134
00135
00136 label getVertex(const label eVert) const
00137 {
00138 if (isEdge(eVert) || (eVert < 0))
00139 {
00140 FatalErrorIn("edgeVertex::getVertex(const label)")
00141 << "EdgeVertex " << eVert << " not a vertex"
00142 << abort(FatalError);
00143 }
00144 return eVert;
00145 }
00146
00147
00148 label vertToEVert(const label vertI) const
00149 {
00150 if ((vertI < 0) || (vertI >= mesh_.nPoints()))
00151 {
00152 FatalErrorIn("edgeVertex::vertToEVert(const label)")
00153 << "Illegal vertex number " << vertI
00154 << abort(FatalError);
00155 }
00156 return vertI;
00157 }
00158
00159
00160 label edgeToEVert(const label edgeI) const
00161 {
00162 if ((edgeI < 0) || (edgeI >= mesh_.nEdges()))
00163 {
00164 FatalErrorIn("edgeVertex::edgeToEVert(const label)")
00165 << "Illegal edge number " << edgeI
00166 << abort(FatalError);
00167 }
00168 return mesh_.nPoints() + edgeI;
00169 }
00170
00171
00172 point coord(const label cut, const scalar weight) const;
00173
00174
00175 label cutPairToEdge(const label cut0, const label cut1) const;
00176
00177
00178 Ostream& writeCut(Ostream& os, const label cut, const scalar) const;
00179
00180
00181 Ostream& writeCuts(Ostream& os, const labelList&, const scalarField&)
00182 const;
00183 };
00184
00185
00186
00187
00188 }
00189
00190
00191
00192 #endif
00193
00194