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_MAPSTRUCTURE_H
00043 #define SUNDANCE_MAPSTRUCTURE_H
00044
00045
00046 #include "SundanceDefs.hpp"
00047 #include "Teuchos_Array.hpp"
00048 #include "Teuchos_RefCountPtr.hpp"
00049
00050 namespace Sundance
00051 {
00052 using namespace Teuchos;
00053
00054 class BasisDOFTopologyBase;
00055
00056
00057
00058
00059 class MapStructure
00060 {
00061 public:
00062
00063 MapStructure(int nTotalFuncs,
00064 const Array<RCP<BasisDOFTopologyBase> >& bases,
00065 const Array<Array<int> >& funcs);
00066
00067 MapStructure(int nTotalFuncs,
00068 const RCP<BasisDOFTopologyBase>& basis,
00069 const Array<Array<int> >& funcs);
00070
00071 MapStructure(int nTotalFuncs,
00072 const RCP<BasisDOFTopologyBase>& basis);
00073
00074
00075 int numBasisChunks() const {return bases_.size();}
00076
00077
00078 const RCP<BasisDOFTopologyBase>& basis(int basisChunk) const
00079 {return bases_[basisChunk];}
00080
00081
00082 int numFuncs(int basisChunk) const
00083 {return funcs_[basisChunk].size();}
00084
00085
00086 const Array<int>& funcs(int basisChunk) const
00087 {return funcs_[basisChunk];}
00088
00089
00090 int chunkForFuncID(int funcID) const ;
00091
00092
00093 int indexForFuncID(int funcID) const ;
00094
00095
00096 std::ostream& print(std::ostream& os) const ;
00097
00098 private:
00099
00100 void init(int nTotalFuncs,
00101 const Array<RCP<BasisDOFTopologyBase> >& bases,
00102 const Array<Array<int> >& funcs);
00103
00104 Array<RCP<BasisDOFTopologyBase> > bases_;
00105 Array<Array<int> > funcs_;
00106 Array<int> chunkForFuncID_;
00107 Array<int> indexForFuncID_;
00108 };
00109
00110
00111 Array<RCP<BasisDOFTopologyBase> > replicate(
00112 const RCP<BasisDOFTopologyBase>& model,
00113 int n);
00114
00115
00116
00117
00118 inline std::ostream& operator<<(std::ostream& os,
00119 const MapStructure& m)
00120 {
00121 return m.print(os);
00122 }
00123
00124 }
00125 #endif