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_HOMOGENEOUSDOFMAP_H
00032 #define SUNDANCE_HOMOGENEOUSDOFMAP_H
00033
00034
00035 #include "SundanceDefs.hpp"
00036 #include "SundanceMesh.hpp"
00037 #include "SundanceBasisFamily.hpp"
00038 #include "SundanceCellSet.hpp"
00039 #include "SundanceCellFilter.hpp"
00040 #include "SundanceDOFMapBase.hpp"
00041
00042
00043 namespace Sundance
00044 {
00045 using namespace Teuchos;
00046
00047
00048
00049
00050
00051
00052 class HomogeneousDOFMap : public DOFMapBase
00053 {
00054 public:
00055
00056 HomogeneousDOFMap(const Mesh& mesh,
00057 const BasisFamily& basis,
00058 int numFuncs);
00059
00060
00061 HomogeneousDOFMap(const Mesh& mesh,
00062 const BasisFamily& basis,
00063 const Array<CellFilter>& subregions,
00064 int numFuncs);
00065
00066
00067 virtual ~HomogeneousDOFMap(){;}
00068
00069
00070
00071
00072
00073
00074
00075 virtual void getDOFsForCellBatch(int cellDim, const Array<int>& cellLID,
00076 Array<int>& dofs,
00077 Array<Array<int> >& funcIDs,
00078 Array<int>& nNodes) const ;
00079
00080
00081
00082 virtual void print(std::ostream& os) const ;
00083
00084 private:
00085
00086
00087 void allocate(const Mesh& mesh,
00088 const BasisFamily& basis,
00089 int numFuncs);
00090
00091
00092 void buildMaximalDofTable() const ;
00093
00094
00095 bool hasBeenAssigned(int cellDim, int cellLID) const
00096 {return dofs_[cellDim][cellLID][0] != uninitializedVal();}
00097
00098
00099 void initMap();
00100
00101
00102 void setDOFs(int cellDim, int cellLID,
00103 int& nextDOF, bool isRemote=false);
00104
00105
00106 void shareDOFs(int cellDim,
00107 const Array<Array<int> >& outgoingCellRequests);
00108
00109
00110 void computeOffsets(int dim, int localCount);
00111
00112
00113 const Array<int>& funcIDList() const {return funcIDOnCellSet(0);}
00114
00115 static int uninitializedVal() {return -1;}
00116
00117 int dim_;
00118
00119 Array<Array<Array<int> > > dofs_;
00120
00121 mutable Array<int> maximalDofs_;
00122
00123 mutable bool haveMaximalDofs_;
00124
00125 Array<Array<Array<Array<int> > > > localNodePtrs_;
00126
00127 Array<int> nNodesPerCell_;
00128
00129 Array<int> totalNNodesPerCell_;
00130
00131 Array<Array<int> > numFacets_;
00132
00133 Array<Array<int> > originalFacetOrientation_;
00134
00135 bool basisIsContinuous_;
00136
00137
00138 };
00139 }
00140
00141
00142
00143
00144
00145 #endif