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
00037
00038
00039
00040
00041
00042 #ifndef SUNDANCE_MIXEDDOFMAPHN_H
00043 #define SUNDANCE_MIXEDDOFMAPHN_H
00044
00045
00046 #include "SundanceDefs.hpp"
00047 #include "SundanceMesh.hpp"
00048 #include "SundanceCellSet.hpp"
00049 #include "SundanceCellFilter.hpp"
00050 #include "SundanceHNDoFMapBaseHomogeneous.hpp"
00051 #include "SundanceBasisFamilyBase.hpp"
00052 #include "SundanceMatrixStore.hpp"
00053
00054 namespace Sundance
00055 {
00056 using namespace Teuchos;
00057
00058 class BasisDOFTopologyBase;
00059
00060
00061
00062
00063
00064
00065
00066
00067 class MixedDOFMapHN : public HNDoFMapBaseHomogeneous
00068 {
00069 public:
00070
00071 MixedDOFMapHN(const Mesh& mesh,
00072 const Array<RCP<BasisDOFTopologyBase> >& basis,
00073 const CellFilter& maxCells,
00074 int setupVerb);
00075
00076
00077 virtual ~MixedDOFMapHN(){;}
00078
00079
00080 RCP<const MapStructure>
00081 getDOFsForCellBatch(int cellDim,
00082 const Array<int>& cellLID,
00083 const Set<int>& requestedFuncSet,
00084 Array<Array<int> >& dofs,
00085 Array<int>& nNodes,
00086 int verbosity) const ;
00087
00088
00089
00090
00091
00092
00093
00094 void getTrafoMatrixForCell(
00095 int cellLID,
00096 int funcID,
00097 int& trafoMatrixSize,
00098 bool& doTransform,
00099 Array<double>& transfMatrix ) const;
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109 void getTrafoMatrixForFacet(
00110 int cellDim,
00111 int cellLID,
00112 int facetIndex,
00113 int funcID,
00114 int& trafoMatrixSize,
00115 bool& doTransform,
00116 Array<double>& transfMatrix ) const;
00117
00118
00119
00120
00121 void getDOFsForHNCell(
00122 int cellDim,
00123 int cellLID,
00124 int funcID,
00125 Array<int>& dofs ,
00126 Array<double>& coefs ) const;
00127
00128
00129 RCP<const MapStructure> mapStruct() const
00130 {return structure_;}
00131
00132
00133 int chunkForFuncID(int funcID) const
00134 {return structure_->chunkForFuncID(funcID);}
00135
00136
00137 int indexForFuncID(int funcID) const
00138 {return structure_->indexForFuncID(funcID);}
00139
00140
00141 int nFuncs(int basisChunk) const
00142 {return nFuncs_[basisChunk];}
00143
00144
00145 int nBasisChunks() const
00146 {return nFuncs_.size();}
00147
00148
00149 const RCP<BasisDOFTopologyBase>& basis(int basisChunk) const
00150 {return structure_->basis(basisChunk);}
00151
00152
00153 const Array<int>& funcID(int basisChunk) const
00154 {return structure_->funcs(basisChunk);}
00155
00156
00157 private:
00158
00159
00160 void checkTable() const ;
00161
00162
00163 inline int getInitialDOFForCell(int cellDim, int cellLID, int basisChunk) const
00164 {
00165 return dofs_[cellDim][basisChunk][cellLID*nDofsPerCell_[basisChunk][cellDim]];
00166 }
00167
00168 inline int* getInitialDOFPtrForCell(int cellDim, int cellLID, int basisChunk)
00169 {
00170 return &(dofs_[cellDim][basisChunk][cellLID*nDofsPerCell_[basisChunk][cellDim]]);
00171 }
00172
00173 inline const int* getInitialDOFPtrForCell(int cellDim, int cellLID,
00174 int basisChunk) const
00175 {
00176 return &(dofs_[cellDim][basisChunk][cellLID*nDofsPerCell_[basisChunk][cellDim]]);
00177 }
00178
00179
00180 void allocate(const Mesh& mesh);
00181
00182
00183 void buildMaximalDofTable();
00184
00185 bool hasBeenAssigned(int cellDim, int cellLID) const
00186 {return hasBeenAssigned_[cellDim][cellLID];}
00187
00188 void markAsAssigned(int cellDim, int cellLID)
00189 {hasBeenAssigned_[cellDim][cellLID] = true;}
00190
00191
00192 void initMap();
00193
00194
00195 void setDOFs(int basisChunk, int cellDim, int cellLID,
00196 int& nextDOF, bool isRemote=false);
00197
00198
00199 void shareDOFs(int cellDim,
00200 const Array<Array<int> >& outgoingCellRequests);
00201
00202
00203 void computeOffsets(int dim, int localCount);
00204
00205
00206 static int uninitializedVal() {return -1;}
00207
00208
00209 CellFilter maxCells_;
00210
00211
00212 int dim_;
00213
00214
00215
00216
00217
00218
00219 Array<Array<Array<int> > > dofs_;
00220
00221
00222
00223
00224
00225
00226 mutable Array<Array<int> > maximalDofs_;
00227
00228
00229 mutable bool haveMaximalDofs_;
00230
00231
00232
00233
00234 Array<Array<Array<Array<Array<int> > > > > localNodePtrs_;
00235
00236
00237
00238
00239 int nPoints_;
00240
00241
00242 Array<bool> hasCellHanging_;
00243
00244
00245 Array< Array<bool> > isElementHanging_;
00246
00247
00248 Sundance::Map< int , Array<int> > HN_To_globalFacetsLID_;
00249
00250
00251 Sundance::Map< int , Array<int> > HN_To_globalFacetsDim_;
00252
00253
00254 Sundance::Map< int , Array<double> > HN_To_coeffs_;
00255
00256
00257
00258
00259 Sundance::Map< int , Array < int > > maxCellLIDwithHN_to_TrafoMatrix_;
00260
00261
00262 MatrixStore matrixStore_;
00263
00264
00265 mutable Array<RCP<BasisFamilyBase> > basis_;
00266
00267
00268
00269
00270
00271
00272 Array<Array<int> > nNodesPerCell_;
00273
00274
00275
00276
00277 Array<Array<int> > nDofsPerCell_;
00278
00279
00280
00281
00282 Array<Array<int> > totalNNodesPerCell_;
00283
00284
00285
00286
00287 Array<Array<int> > totalNDofsPerCell_;
00288
00289
00290
00291 Array<int> cellHasAnyDOFs_;
00292
00293
00294
00295
00296 Array<Array<int> > numFacets_;
00297
00298
00299
00300 Array<Array<int> > originalFacetOrientation_;
00301
00302
00303 Array<Array<int> > hasBeenAssigned_;
00304
00305
00306 RCP<const MapStructure> structure_;
00307
00308
00309 Array<int> nFuncs_;
00310 };
00311 }
00312
00313
00314 #endif