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