Go to the documentation of this file.00001
00002
00003
00004 #ifndef shapeFucntion2d_hh
00005 #define shapeFucntion2d_hh
00006
00007 #include "basics/typedefs.hh"
00008 #include "basics/exceptions.hh"
00009 #include "space/tmatrix.hh"
00010
00011 namespace hp2D {
00012
00013
00014 template<class F>
00015 class Quad;
00016
00017 using concepts::Real;
00018
00019
00020
00026 template<typename F>
00027 class ShapeFunction2D {
00028 public:
00029 ShapeFunction2D();
00030 ShapeFunction2D(const ShapeFunction2D<F>& s);
00031
00033 uint n(uint i) const {
00034 conceptsAssert(i < 2, concepts::Assertion());
00035 conceptsAssert(n_[i] != 0, concepts::Assertion());
00036 return n_[i]; }
00038 void n(uint i, uint value) {
00039 conceptsAssert(i < 2, concepts::Assertion());
00040 n_[i] = value;
00041 }
00042
00044 uint nq(uint i) const {
00045 conceptsAssert(i < 2, concepts::Assertion());
00046 conceptsAssert(nq_[i] != 0, concepts::Assertion());
00047 return nq_[i]; }
00049 void nq(uint i, uint value) {
00050 conceptsAssert(i < 2, concepts::Assertion());
00051 nq_[i] = value;
00052 }
00053
00055 const Real* values(uint i) const {
00056 conceptsAssert(i < 2, concepts::Assertion());
00057 conceptsAssert(values_[i] != 0, concepts::Assertion());
00058 return values_[i]; }
00060 void values(uint i, const Real* value) {
00061 conceptsAssert(i < 2, concepts::Assertion());
00062 values_[i] = value;
00063 }
00064
00066 const Real* abscissas(uint i) const {
00067 conceptsAssert(i < 2, concepts::Assertion());
00068 conceptsAssert(abscissas_[i] != 0, concepts::Assertion());
00069 return abscissas_[i]; }
00071 void abscissas(uint i, const Real* value) {
00072 conceptsAssert(i < 2, concepts::Assertion());
00073 abscissas_[i] = value;
00074 }
00075
00077 const Real* weights(uint i) const {
00078 conceptsAssert(i < 2, concepts::Assertion());
00079 conceptsAssert(weights_[i] != 0, concepts::Assertion());
00080 return weights_[i]; }
00082 void weights(uint i, const Real* value) {
00083 conceptsAssert(i < 2, concepts::Assertion());
00084 weights_[i] = value;
00085 }
00087 const concepts::TMatrixBase<F>* T() const { return T_; }
00089 void T(const concepts::TMatrixBase<F>* T) { T_ = T; }
00091 const concepts::TColumnTensor<bool, 2>* usedIdx() const { return usedIdx_;}
00093 void usedIdx(const concepts::TColumnTensor<bool, 2>* usedIdx)
00094 { usedIdx_ = usedIdx; }
00095 private:
00096 int n_[2], nq_[2];
00097 const F* values_[2];
00098 const Real* abscissas_[2], * weights_[2];
00099 const concepts::TMatrixBase<F>* T_;
00100 const concepts::TColumnTensor<bool, 2>* usedIdx_;
00101 };
00102
00103
00104
00105 template<class F>
00106 ShapeFunction2D<F>
00107 makeShapeFunction2D(const Quad<F>& quad);
00108
00109 }
00110
00111 #endif // shapeFucntion2d_hh