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