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
00037 #ifndef faPatch_H
00038 #define faPatch_H
00039
00040 #include "patchIdentifier.H"
00041 #include "labelList.H"
00042 #include "pointField.H"
00043 #include "typeInfo.H"
00044 #include "autoPtr.H"
00045 #include "runTimeSelectionTables.H"
00046
00047
00048
00049 namespace Foam
00050 {
00051
00052 class faBoundaryMesh;
00053
00054
00055
00056
00057
00058 class faPatch
00059 :
00060 public labelList,
00061 public patchIdentifier
00062 {
00063 private:
00064
00065
00066
00067
00068 const label ngbPolyPatchIndex_;
00069
00070
00071 const faBoundaryMesh& boundaryMesh_;
00072
00073
00074
00075
00076
00077 faPatch(const faPatch&);
00078
00079
00080 void operator=(const faPatch&);
00081
00082 protected:
00083
00084
00085 friend class faBoundaryMesh;
00086
00087
00088 virtual void initGeometry()
00089 {}
00090
00091
00092 virtual void calcGeometry()
00093 {}
00094
00095
00096 public:
00097
00098 typedef faBoundaryMesh BoundaryMesh;
00099
00100
00101
00102 TypeName("patch");
00103
00104
00105
00106 declareRunTimeSelectionTable
00107 (
00108 autoPtr,
00109 faPatch,
00110 dictionary,
00111 (
00112 const word& name,
00113 const dictionary& dict,
00114 const label index,
00115 const faBoundaryMesh& bm
00116 ),
00117 (name, dict, index, bm)
00118 );
00119
00120
00121
00122
00123
00124 faPatch
00125 (
00126 const word& name,
00127 const labelList& edgeLabels,
00128 const label index,
00129 const faBoundaryMesh& bm
00130 );
00131
00132
00133 faPatch
00134 (
00135 const word& name,
00136 const dictionary& dict,
00137 const label index,
00138 const faBoundaryMesh& bm
00139 );
00140
00141
00142 faPatch(const faPatch&, const faBoundaryMesh&);
00143
00144
00145
00146
00147
00148 static autoPtr<faPatch> New
00149 (
00150 const word& name,
00151 const dictionary& dict,
00152 const label index,
00153 const faBoundaryMesh& bm
00154 );
00155
00156
00157
00158
00159 virtual ~faPatch();
00160
00161
00162
00163
00164
00165 label ngbPolyPatchIndex() const;
00166
00167
00168 const faBoundaryMesh& boundaryMesh() const;
00169
00170
00171 label start() const;
00172
00173
00174 virtual label size() const
00175 {
00176 return labelList::size();
00177 }
00178
00179
00180 template<class T>
00181 typename List<T>::subList patchSlice(const List<T>& l) const
00182 {
00183 return typename List<T>::subList(l, size(), start());
00184 }
00185
00186
00187 virtual void movePoints(const pointField&);
00188
00189
00190 virtual void write(Ostream&) const;
00191
00192
00193 virtual void writeDict(Ostream&) const;
00194
00195
00196
00197
00198
00199 labelList pointLabels() const;
00200
00201
00202 labelListList pointEdges() const;
00203
00204
00205 labelList ngbPolyPatchFaces() const;
00206
00207
00208 tmp<vectorField> ngbPolyPatchFaceNormals() const;
00209
00210
00211 tmp<vectorField> ngbPolyPatchPointNormals() const;
00212
00213
00214 labelList::subList edgeFaces() const;
00215
00216
00217 const vectorField& edgeCentres() const;
00218
00219
00220 const vectorField& edgeLengths() const;
00221
00222
00223 const scalarField& magEdgeLengths() const;
00224
00225
00226 tmp<vectorField> edgeNormals() const;
00227
00228
00229 tmp<vectorField> edgeFaceCentres() const;
00230
00231
00232
00233
00234 virtual tmp<vectorField> delta() const;
00235
00236
00237
00238
00239
00240 virtual void makeWeights(scalarField&) const;
00241
00242
00243 const scalarField& weights() const;
00244
00245
00246 virtual void makeDeltaCoeffs(scalarField&) const;
00247
00248
00249 const scalarField& deltaCoeffs() const;
00250
00251
00252
00253
00254 friend Ostream& operator<<(Ostream&, const faPatch&);
00255 };
00256
00257
00258
00259
00260 }
00261
00262
00263
00264 #endif
00265
00266