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_DISCRETESPACE_H
00032 #define SUNDANCE_DISCRETESPACE_H
00033
00034 #include "SundanceDefs.hpp"
00035 #include "SundanceMesh.hpp"
00036 #include "SundanceBasisFamily.hpp"
00037 #include "SundanceSpectralBasis.hpp"
00038 #include "SundanceDOFMapBase.hpp"
00039 #include "PlayaVectorType.hpp"
00040 #include "PlayaVectorSpaceDecl.hpp"
00041 #include "SundanceObjectWithVerbosity.hpp"
00042 #include "SundanceDiscreteSpaceTransfBuilder.hpp"
00043
00044
00045 namespace Sundance
00046 {
00047 class FunctionSupportResolver;
00048 }
00049
00050 namespace Sundance
00051 {
00052 using namespace Teuchos;
00053 using namespace Playa;
00054
00055
00056
00057
00058
00059 class DiscreteSpace
00060 {
00061 public:
00062
00063 DiscreteSpace(){;}
00064
00065 DiscreteSpace(const Mesh& mesh, const BasisFamily& basis,
00066 const VectorType<double>& vecType,
00067 int setupVerb = 0);
00068
00069 DiscreteSpace(const Mesh& mesh, const BasisArray& basis,
00070 const VectorType<double>& vecType,
00071 int setupVerb = 0);
00072
00073
00074 DiscreteSpace(const Mesh& mesh, const BasisArray& basis,
00075 const Array<CellFilter>& regions,
00076 const VectorType<double>& vecType,
00077 int setupVerb = 0);
00078
00079
00080
00081 DiscreteSpace(const Mesh& mesh, const BasisFamily& basis,
00082 const CellFilter& regions,
00083 const VectorType<double>& vecType,
00084 int setupVerb = 0);
00085
00086
00087
00088 DiscreteSpace(const Mesh& mesh, const BasisArray& basis,
00089 const CellFilter& regions,
00090 const VectorType<double>& vecType,
00091 int setupVerb = 0);
00092
00093
00094 DiscreteSpace(const Mesh& mesh, const BasisArray& basis,
00095 const RCP<DOFMapBase>& map,
00096 const VectorType<double>& vecType,
00097 int setupVerb = 0);
00098
00099
00100 DiscreteSpace(const Mesh& mesh, const BasisArray& basis,
00101 const RCP<DOFMapBase>& map,
00102 const RCP<Array<int> >& bcIndices,
00103 const VectorType<double>& vecType,
00104 int setupVerb = 0);
00105
00106
00107 DiscreteSpace(const Mesh& mesh, const BasisFamily& basis,
00108 const SpectralBasis& spBasis,
00109 const VectorType<double>& vecType,
00110 int setupVerb = 0);
00111
00112 DiscreteSpace(const Mesh& mesh, const BasisArray& basis,
00113 const SpectralBasis& spBasis,
00114 const VectorType<double>& vecType,
00115 int setupVerb = 0);
00116
00117
00118 DiscreteSpace(const Mesh& mesh, const BasisArray& basis,
00119 const RCP<FunctionSupportResolver>& fsr,
00120 const VectorType<double>& vecType,
00121 int setupVerb = 0);
00122
00123
00124 const RCP<DOFMapBase>& map() const {return map_;}
00125
00126
00127 int nFunc() const {return basis_.size();}
00128
00129
00130 const BasisArray& basis() const {return basis_;}
00131
00132
00133 Array<std::pair<int,int> > dimStructure() const {return vectorDimStructure(basis());}
00134
00135
00136 Vector<double> createVector() const {return vecSpace_.createMember();}
00137
00138
00139 VectorSpace<double> vecSpace() const {return vecSpace_;}
00140
00141
00142 const Mesh& mesh() const {return mesh_;}
00143
00144
00145 const VectorType<double>& vecType() const {return vecType_;}
00146
00147
00148 void importGhosts(const Vector<double>& x,
00149 RCP<GhostView<double> >& ghostView) const ;
00150
00151
00152 void getAllowedFuncs(const CellFilter& cf, Set<int>& funcs) const ;
00153
00154
00155 const CellFilter& cellFilters(int i) const {return subdomains_[i];}
00156
00157
00158 const RCP<DiscreteSpaceTransfBuilder>& getTransformation() const
00159 { return transformationBuilder_; }
00160
00161 private:
00162
00163
00164 void init(const Array<CellFilter>& regions,
00165 const BasisArray& basis);
00166
00167
00168 void init(const Array<CellFilter>& regions,
00169 const BasisArray& basis,
00170 const RCP<Array<int> >& isBCIndex,
00171 bool partitionBCs);
00172
00173
00174 Array<CellFilter> maximalRegions(int n) const ;
00175
00176
00177 void initVectorSpace(
00178 const RCP<Array<int> >& isBCIndex,
00179 bool partitionBCs);
00180
00181
00182 void initImporter();
00183
00184
00185 int setupVerb_;
00186
00187
00188 RCP<DOFMapBase> map_;
00189
00190
00191 Mesh mesh_;
00192
00193
00194 Array<CellFilter> subdomains_;
00195
00196
00197 BasisArray basis_;
00198
00199
00200 VectorSpace<double> vecSpace_;
00201
00202
00203 VectorType<double> vecType_;
00204
00205
00206 RCP<GhostImporter<double> > ghostImporter_;
00207
00208
00209 RCP<DiscreteSpaceTransfBuilder> transformationBuilder_;
00210
00211 };
00212
00213 }
00214
00215
00216
00217 #endif