1 #ifndef INTEG_ALGOIM_HPP 2 #define INTEG_ALGOIM_HPP 7 #include <algoim_quad.hpp> 18 template<
typename float_type>
24 u[0] = float_type(1.);
31 for (i = 1; i <
p; i++)
48 template<
typename float_type>
50 float_type*
u, float_type* d)
54 u[0] = float_type(1.);
55 d[0] = float_type(0.);
61 const float_type xpy = x + y, ptx =
p*x;
62 float_type z = float_type(1.);
64 for (i = 1; i <
p; i++)
66 d[i] =
b[i]*z*(i*xpy - ptx);
86 template <
typename float_type>
94 template <
typename float_type>
96 float_type *
u, float_type *d)
144 : el(el_), lsfun(lsfun_) { }
148 T operator() (
const blitz::TinyVector<T,3>& x)
const 158 const Array<int>& dof_map=el->GetDofMap();
161 for (
int oo = 0, kk = 0; kk <= el_order; kk++)
162 for (
int jj = 0; jj <= el_order; jj++)
163 for (
int ii = 0; ii <= el_order; ii++)
165 res=res-u1[ii]*u2[jj]*u3[kk]*lsfun(dof_map[oo++]);
172 blitz::TinyVector<T,3> grad(
const blitz::TinyVector<T,3>& x)
const 186 blitz::TinyVector<T,3> res(T(0.0),T(0.0),T(0.0));
188 const Array<int>& dof_map=el->GetDofMap();
190 for (
int oo = 0, kk = 0; kk <= el_order; kk++)
191 for (
int jj = 0; jj <= el_order; jj++)
192 for (
int ii = 0; ii <= el_order; ii++)
194 res[0]=res[0]-d1[ii]*u2[jj]*u3[kk]*lsfun(dof_map[oo]);
195 res[1]=res[1]-u1[ii]*d2[jj]*u3[kk]*lsfun(dof_map[oo]);
196 res[2]=res[2]-u1[ii]*u2[jj]*d3[kk]*lsfun(dof_map[oo]);
204 PositiveTensorFiniteElement* el;
212 LevelSet2D(PositiveTensorFiniteElement* el_, Vector& lsfun_)
213 :el(el_), lsfun(lsfun_) { }
217 T operator() (
const blitz::TinyVector<T,2>& x)
const 225 const Array<int>& dof_map=el->GetDofMap();
229 for (
int oo = 0, jj = 0; jj <= el_order; jj++)
230 for (
int ii = 0; ii <= el_order; ii++)
232 res=res-u1[ii]*u2[jj]*lsfun(dof_map[oo++]);
239 blitz::TinyVector<T,2> grad(
const blitz::TinyVector<T,2>& x)
const 250 blitz::TinyVector<T,2> res(T(0.0),T(0.0));
252 const Array<int>& dof_map=el->GetDofMap();
254 for (
int oo = 0, jj = 0; jj <= el_order; jj++)
255 for (
int ii = 0; ii <= el_order; ii++)
257 res[0]=res[0]-(d1[ii]*u2[jj])*lsfun(dof_map[oo]);
258 res[1]=res[1]-(u1[ii]*d2[jj])*lsfun(dof_map[oo]);
267 PositiveTensorFiniteElement* el;
272 IntegrationRule* sir;
273 IntegrationRule* vir;
274 PositiveTensorFiniteElement *pe;
Abstract class for all finite elements.
void CalcBernstein(const int p, const float_type x, float_type *u)
Templated evaluation of Bernstein basis.
void trans(const Vector &u, Vector &x)
Class for an integration rule - an Array of IntegrationPoint.
const IntegrationRule * GetSurfaceIntegrationRule()
const IntegrationRule * GetVolumeIntegrationRule()
void CalcBinomTerms(const int p, const float_type x, const float_type y, float_type *u)
Templated version of CalcBinomTerms.
double p(const Vector &x, double t)
static const int * Binom(const int p)
Get a pointer to an array containing the binomial coefficients "p choose k" for k=0,...,p for the given p.
~AlgoimIntegrationRule()
Destructor of the Algoim object.
AlgoimIntegrationRule(int o, const FiniteElement &el, ElementTransformation &trans, const Vector &lsfun)
double u(const Vector &xvec)
int GetOrder() const
Returns the order of the finite element. In the case of anisotropic orders, returns the maximum order...