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