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
00038
00039
00040 #ifndef directMappedPolyPatch_H
00041 #define directMappedPolyPatch_H
00042
00043 #include "polyPatch.H"
00044 #include "dataSchedule.H"
00045
00046
00047
00048 namespace Foam
00049 {
00050
00051
00052
00053
00054
00055 class directMappedPolyPatch
00056 :
00057 public polyPatch
00058 {
00059
00060
00061
00062 const vector offset_;
00063
00064
00065
00066
00067
00068 mutable autoPtr<List<labelPair> > schedulePtr_;
00069
00070
00071 mutable autoPtr<labelListList> sendCellLabelsPtr_;
00072
00073
00074 mutable autoPtr<labelListList> receiveFaceLabelsPtr_;
00075
00076
00077
00078
00079
00080
00081 void collectSamples
00082 (
00083 pointField&,
00084 labelList& patchFaceProcs,
00085 labelList& patchFaces
00086 ) const;
00087
00088
00089 void findSamples
00090 (
00091 const pointField&,
00092 labelList& sampleCellProcs,
00093 labelList& sampleCells
00094 ) const;
00095
00096
00097 void calcMapping() const;
00098
00099
00100 protected:
00101
00102 void clearOut();
00103
00104
00105 virtual void initGeometry()
00106 {
00107 clearOut();
00108 }
00109
00110
00111 virtual void calcGeometry()
00112 {
00113 clearOut();
00114 }
00115
00116
00117 virtual void initMovePoints(const pointField&)
00118 {
00119 clearOut();
00120 }
00121
00122
00123 virtual void movePoints(const pointField& p)
00124 {
00125 clearOut();
00126 }
00127
00128
00129 virtual void initUpdateMesh()
00130 {
00131 clearOut();
00132 }
00133
00134
00135 virtual void updateMesh()
00136 {
00137 clearOut();
00138 }
00139
00140
00141 public:
00142
00143
00144 TypeName("directMappedPatch");
00145
00146
00147
00148
00149
00150 directMappedPolyPatch
00151 (
00152 const word& name,
00153 const label size,
00154 const label start,
00155 const label index,
00156 const polyBoundaryMesh& bm
00157 );
00158
00159
00160 directMappedPolyPatch
00161 (
00162 Istream&,
00163 const label index,
00164 const polyBoundaryMesh&
00165 );
00166
00167
00168 directMappedPolyPatch
00169 (
00170 const word& name,
00171 const dictionary& dict,
00172 const label index,
00173 const polyBoundaryMesh& bm
00174 );
00175
00176
00177 directMappedPolyPatch
00178 (
00179 const directMappedPolyPatch&,
00180 const polyBoundaryMesh&
00181 );
00182
00183
00184
00185 directMappedPolyPatch
00186 (
00187 const directMappedPolyPatch& pp,
00188 const polyBoundaryMesh& bm,
00189 const label index,
00190 const label newSize,
00191 const label newStart
00192 );
00193
00194
00195 virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
00196 {
00197 return autoPtr<polyPatch>(new directMappedPolyPatch(*this, bm));
00198 }
00199
00200
00201
00202 virtual autoPtr<polyPatch> clone
00203 (
00204 const polyBoundaryMesh& bm,
00205 const label index,
00206 const label newSize,
00207 const label newStart
00208 ) const
00209 {
00210 return autoPtr<polyPatch>
00211 (
00212 new directMappedPolyPatch(*this, bm, index, newSize, newStart)
00213 );
00214 }
00215
00216
00217
00218
00219 ~directMappedPolyPatch();
00220
00221
00222
00223
00224
00225 const vector& offset() const
00226 {
00227 return offset_;
00228 }
00229
00230
00231 const List<labelPair>& schedule() const
00232 {
00233 if (!schedulePtr_.valid())
00234 {
00235 calcMapping();
00236 }
00237 return schedulePtr_();
00238 }
00239
00240
00241 const labelListList& sendCellLabels() const
00242 {
00243 if (!sendCellLabelsPtr_.valid())
00244 {
00245 calcMapping();
00246 }
00247 return sendCellLabelsPtr_();
00248 }
00249
00250
00251 const labelListList& receiveFaceLabels() const
00252 {
00253 if (!receiveFaceLabelsPtr_.valid())
00254 {
00255 calcMapping();
00256 }
00257 return receiveFaceLabelsPtr_();
00258 }
00259 };
00260
00261
00262
00263
00264 }
00265
00266
00267
00268 #endif
00269
00270
Copyright © 2000-2007 OpenCFD Ltd