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_MIXEDDOFMAP_H
00032 #define SUNDANCE_MIXEDDOFMAP_H
00033
00034
00035 #include "SundanceDefs.hpp"
00036 #include "SundanceMesh.hpp"
00037 #include "SundanceCellSet.hpp"
00038 #include "SundanceCellFilter.hpp"
00039 #include "SundanceSpatiallyHomogeneousDOFMapBase.hpp"
00040
00041 namespace Sundance
00042 {
00043 using namespace Teuchos;
00044
00045 class BasisDOFTopologyBase;
00046
00047
00048
00049
00050
00051
00052 class MixedDOFMap : public SpatiallyHomogeneousDOFMapBase
00053 {
00054 public:
00055
00056 MixedDOFMap(const Mesh& mesh,
00057 const Array<RCP<BasisDOFTopologyBase> >& basis,
00058 const CellFilter& maxCells,
00059 int setupVerb);
00060
00061
00062 virtual ~MixedDOFMap(){;}
00063
00064
00065 RCP<const MapStructure>
00066 getDOFsForCellBatch(int cellDim,
00067 const Array<int>& cellLID,
00068 const Set<int>& requestedFuncSet,
00069 Array<Array<int> >& dofs,
00070 Array<int>& nNodes,
00071 int verbosity) const ;
00072
00073
00074 RCP<const MapStructure> mapStruct() const
00075 {return structure_;}
00076
00077
00078 int chunkForFuncID(int funcID) const
00079 {return structure_->chunkForFuncID(funcID);}
00080
00081
00082 int indexForFuncID(int funcID) const
00083 {return structure_->indexForFuncID(funcID);}
00084
00085
00086 int nFuncs(int basisChunk) const
00087 {return nFuncs_[basisChunk];}
00088
00089
00090 int nBasisChunks() const
00091 {return nFuncs_.size();}
00092
00093
00094 const RCP<BasisDOFTopologyBase>& basis(int basisChunk) const
00095 {return structure_->basis(basisChunk);}
00096
00097
00098 const Array<int>& funcID(int basisChunk) const
00099 {return structure_->funcs(basisChunk);}
00100
00101
00102 private:
00103
00104
00105 void checkTable() const ;
00106
00107
00108 inline int getInitialDOFForCell(int cellDim, int cellLID, int basisChunk) const
00109 {
00110 return dofs_[cellDim][basisChunk][cellLID*nDofsPerCell_[basisChunk][cellDim]];
00111 }
00112
00113 inline int* getInitialDOFPtrForCell(int cellDim, int cellLID, int basisChunk)
00114 {
00115 return &(dofs_[cellDim][basisChunk][cellLID*nDofsPerCell_[basisChunk][cellDim]]);
00116 }
00117
00118 inline const int* getInitialDOFPtrForCell(int cellDim, int cellLID,
00119 int basisChunk) const
00120 {
00121 return &(dofs_[cellDim][basisChunk][cellLID*nDofsPerCell_[basisChunk][cellDim]]);
00122 }
00123
00124
00125 void allocate(const Mesh& mesh);
00126
00127
00128 void buildMaximalDofTable() const ;
00129
00130 bool hasBeenAssigned(int cellDim, int cellLID) const
00131 {return hasBeenAssigned_[cellDim][cellLID];}
00132
00133 void markAsAssigned(int cellDim, int cellLID)
00134 {hasBeenAssigned_[cellDim][cellLID] = true;}
00135
00136
00137 void initMap();
00138
00139
00140 void setDOFs(int basisChunk, int cellDim, int cellLID,
00141 int& nextDOF, bool isRemote=false);
00142
00143
00144 void shareDOFs(int cellDim,
00145 const Array<Array<int> >& outgoingCellRequests);
00146
00147
00148 void computeOffsets(int dim, int localCount);
00149
00150
00151 static int uninitializedVal() {return -1;}
00152
00153
00154 CellFilter maxCells_;
00155
00156
00157 int dim_;
00158
00159
00160
00161
00162
00163
00164 Array<Array<Array<int> > > dofs_;
00165
00166
00167
00168
00169
00170
00171 mutable Array<Array<int> > maximalDofs_;
00172
00173
00174 mutable bool haveMaximalDofs_;
00175
00176
00177
00178
00179 Array<Array<Array<Array<Array<int> > > > > localNodePtrs_;
00180
00181
00182
00183
00184 Array<Array<int> > nNodesPerCell_;
00185
00186
00187
00188
00189 Array<Array<int> > nDofsPerCell_;
00190
00191
00192
00193
00194 Array<Array<int> > totalNNodesPerCell_;
00195
00196
00197
00198
00199 Array<Array<int> > totalNDofsPerCell_;
00200
00201
00202
00203 Array<int> cellHasAnyDOFs_;
00204
00205
00206
00207
00208 Array<Array<int> > numFacets_;
00209
00210
00211
00212 Array<Array<int> > originalFacetOrientation_;
00213
00214
00215 Array<Array<int> > hasBeenAssigned_;
00216
00217
00218 RCP<const MapStructure> structure_;
00219
00220
00221 Array<int> nFuncs_;
00222 };
00223 }
00224
00225
00226 #endif