00001
00005 #ifndef appRaduBform_hh
00006 #define appRaduBform_hh
00007
00008 #include "operator/bilinearForm.hh"
00009 #include "app-radu/element.hh"
00010
00011
00012
00013 template <class F, class K>
00014 class ArbKrnlGal3d000Traits {
00015 public:
00016 static F eval(K& k, const concepts::Real3d& x, const concepts::Real3d& y) {
00017 return k(x, y);
00018 }
00019 };
00020
00021
00022
00029 template <class F, class K>
00030 class ArbKrnlGal3d000 {
00031 public:
00032 typedef ArbKrnlGal3d000Traits<F,K> Traits;
00033
00034
00035 ArbKrnlGal3d000(K& k) : k_(k) {}
00036
00044 void operator()(const Constant3d000<F>& elmX,
00045 const Constant3d000<F>& elmY, F* em) const;
00053 void operator()(const Constant3d001<F>& elmX,
00054 const Constant3d001<F>& elmY, F* em) const;
00062 void operator()(const Constant3d002<F>& elmX,
00063 const Constant3d002<F>& elmY, F* em) const;
00064
00065 virtual ArbKrnlGal3d000* clone() const { return new ArbKrnlGal3d000(k_); }
00066 private:
00067 K& k_;
00068
00070 static const concepts::Real N51_;
00072 static const concepts::Real stroudWght51_[60];
00074 static const concepts::Real N54_;
00076 static const concepts::Real stroudWght54_[56];
00077 };
00078
00079
00080
00087 template <class F, class K>
00088 class ArbKrnlGal3d001 {
00089 public:
00090 typedef ArbKrnlGal3d000Traits<F,K> Traits;
00091
00092
00093 ArbKrnlGal3d001(K& k) : k_(k) {}
00094
00100 void operator()(const Constant3d000<F>& elmX,
00101 const Constant3d000<F>& elmY, F* em, uint gauss) const;
00102 void operator()(const Constant3d001<F>& elmX,
00103 const Constant3d001<F>& elmY, F* em, uint guass) const;
00104 void operator()(const Constant3d002<F>& elmX,
00105 const Constant3d002<F>& elmY, F* em, uint guass) const;
00106
00107 virtual ArbKrnlGal3d001* clone() const { return new ArbKrnlGal3d001(k_); }
00108 private:
00109 K& k_;
00110 };
00111
00112
00113
00121 template <class F, class K>
00122 class ArbKrnl3d000 : public concepts::BilinearForm<F> {
00123 private:
00125 ArbKrnlGal3d000<F, K> qrA_;
00126 ArbKrnlGal3d001<F, K> qrB_;
00127 K& k_;
00129 uint gauss_;
00130
00131 public:
00138 inline ArbKrnl3d000(K& k, uint gauss = 0)
00139 : qrA_(k), qrB_(k), k_(k), gauss_(gauss) {}
00140
00147 void operator()(const concepts::Element<F>& elmX,
00148 const concepts::Element<F>& elmY,
00149 concepts::ElementMatrix<F>& em);
00150
00151 inline void operator()(const Constant3d000<F>& elmX,
00152 const Constant3d000<F>& elmY,
00153 concepts::ElementMatrix<F>& em);
00154 inline void operator()(const Constant3d001<F>& elmX,
00155 const Constant3d001<F>& elmY,
00156 concepts::ElementMatrix<F>& em);
00157 inline void operator()(const Constant3d002<F>& elmX,
00158 const Constant3d002<F>& elmY,
00159 concepts::ElementMatrix<F>& em);
00160
00161 virtual ArbKrnl3d000* clone() const { return new ArbKrnl3d000(k_, gauss_); }
00162 };
00163
00164 template <class F, class K>
00165 inline void ArbKrnl3d000<F, K>::operator()(const Constant3d000<F>& elmX,
00166 const Constant3d000<F>& elmY,
00167 concepts::ElementMatrix<F>& em) {
00168 F m;
00169 if (gauss_) qrB_(elmX, elmY, &m, gauss_);
00170 else qrA_(elmX, elmY, &m);
00171
00172 em.resize(1, 1);
00173 em(0, 0) = m;
00174 }
00175
00176 template <class F, class K>
00177 inline void ArbKrnl3d000<F, K>::operator()(const Constant3d001<F>& elmX,
00178 const Constant3d001<F>& elmY,
00179 concepts::ElementMatrix<F>& em) {
00180 F m;
00181 if (gauss_) qrB_(elmX, elmY, &m, gauss_);
00182 else qrA_(elmX, elmY, &m);
00183
00184 em.resize(1, 1);
00185 em(0, 0) = m;
00186 }
00187
00188 template <class F, class K>
00189 inline void ArbKrnl3d000<F, K>::operator()(const Constant3d002<F>& elmX,
00190 const Constant3d002<F>& elmY,
00191 concepts::ElementMatrix<F>& em) {
00192 F m;
00193 if (gauss_) qrB_(elmX, elmY, &m, gauss_);
00194 else qrA_(elmX, elmY, &m);
00195
00196 em.resize(1, 1);
00197 em(0, 0) = m;
00198 }
00199
00200
00201
00205 template <class F>
00206 class Identity3d : public concepts::BilinearForm<F> {
00207
00208 public:
00215 void operator()(const concepts::Element<F>& elmX,
00216 const concepts::Element<F>& elmY,
00217 concepts::ElementMatrix<F>& em);
00218
00219 inline void operator()(const Constant3d000<F>& elmX,
00220 const Constant3d000<F>& elmY,
00221 concepts::ElementMatrix<F>& em);
00222 inline void operator()(const Constant3d001<F>& elmX,
00223 const Constant3d001<F>& elmY,
00224 concepts::ElementMatrix<F>& em);
00225 inline void operator()(const Constant3d002<F>& elmX,
00226 const Constant3d002<F>& elmY,
00227 concepts::ElementMatrix<F>& em);
00228
00229 virtual Identity3d* clone() const { return new Identity3d(); }
00230 };
00231
00232 template <class F>
00233 inline void Identity3d<F>::operator()(const Constant3d000<F>& elmX,
00234 const Constant3d000<F>& elmY,
00235 concepts::ElementMatrix<F>& em) {
00236 em.resize(1, 1);
00237 em(0, 0) = (elmX.support().key() != elmY.support().key())
00238 ? 0.0 : elmX.size() * 0.16666666666666666666;
00239 }
00240
00241 template <class F>
00242 inline void Identity3d<F>::operator()(const Constant3d001<F>& elmX,
00243 const Constant3d001<F>& elmY,
00244 concepts::ElementMatrix<F>& em) {
00245 em.resize(1, 1);
00246 em(0, 0) = (elmX.support().key() != elmY.support().key())
00247 ? 0.0 : elmX.size() * 0.16666666666666666666;
00248 }
00249
00250 template <class F>
00251 inline void Identity3d<F>::operator()(const Constant3d002<F>& elmX,
00252 const Constant3d002<F>& elmY,
00253 concepts::ElementMatrix<F>& em) {
00254 em.resize(1, 1);
00255 em(0, 0) = (elmX.support().key() != elmY.support().key())
00256 ? 0.0 : elmX.size();
00257 }
00258
00259 #endif // appRaduBform_hh