17 #ifndef dealii__tensor_product_polynomials_bubbles_h 18 #define dealii__tensor_product_polynomials_bubbles_h 21 #include <deal.II/base/config.h> 22 #include <deal.II/base/exceptions.h> 23 #include <deal.II/base/tensor.h> 24 #include <deal.II/base/point.h> 25 #include <deal.II/base/polynomial.h> 26 #include <deal.II/base/tensor_product_polynomials.h> 27 #include <deal.II/base/utilities.h> 31 DEAL_II_NAMESPACE_OPEN
78 std::vector<double> &values,
151 unsigned int n ()
const;
169 const unsigned int q_degree = this->
polynomials.size()-1;
170 const unsigned int n_bubbles = ((q_degree<=1)?1:dim);
172 for (
unsigned int i=0; i<n_bubbles; ++i)
205 const unsigned int q_degree = this->
polynomials.size()-1;
207 const unsigned int n_bubbles = ((q_degree<=1)?1:dim);
209 Assert (i<max_q_indices+n_bubbles, ExcInternalError());
224 for (
unsigned int d=0; d<dim ; ++d)
226 derivative_1[d] = 1.;
228 for (
unsigned j=0; j<dim; ++j)
229 derivative_1[d] *= (d==j ? 4*(1-2*p(j)) : 4*p(j)*(1-p(j)));
231 for (
unsigned int i=0; i<q_degree-1; ++i)
232 derivative_1[d]*=2*p(comp)-1;
239 for (
unsigned int j=0; j < dim; ++j)
240 value*=4*p(j)*(1-p(j));
242 double tmp=value*2*(q_degree-1);
243 for (
unsigned int i=0; i<q_degree-2; ++i)
245 derivative_1[comp]+=tmp;
256 for (
unsigned int c=0; c<dim; ++c)
258 v[c][0] = 4*p(c)*(1-p(c));
259 v[c][1] = 4*(1-2*p(c));
264 for (
unsigned int i=0; i<q_degree-1; ++i)
270 double tmp = 2*(q_degree-1);
271 for (
unsigned int i=0; i<q_degree-2; ++i)
280 double tmp=4*(q_degree-2)*(q_degree-1);
281 for (
unsigned int i=0; i<q_degree-3; ++i)
291 for (
unsigned int d1=0; d1<dim; ++d1)
292 for (
unsigned int d2=0; d2<dim; ++d2)
294 grad_grad_1[d1][d2] = v[dim][0];
295 for (
unsigned int x=0; x<dim; ++x)
297 unsigned int derivative=0;
305 grad_grad_1[d1][d2] *= v[x][derivative];
313 for (
unsigned int d=0; d<dim; ++d)
315 grad_grad_2[d][comp] = v[dim][1];
316 grad_grad_3[comp][d] = v[dim][1];
317 for (
unsigned int x=0; x<dim; ++x)
319 grad_grad_2[d][comp] *= v[x][d==x];
320 grad_grad_3[comp][d] *= v[x][d==x];
325 double psi_value = 1.;
326 for (
unsigned int x=0; x<dim; ++x)
327 psi_value *= v[x][0];
329 for (
unsigned int d1=0; d1<dim; ++d1)
330 for (
unsigned int d2=0; d2<dim; ++d2)
331 derivative_2[d1][d2] = grad_grad_1[d1][d2]
333 +grad_grad_3[d1][d2];
334 derivative_2[comp][comp]+=psi_value*v[dim][2];
340 Assert (
false, ExcNotImplemented());
348 DEAL_II_NAMESPACE_CLOSE
unsigned int n_tensor_pols
static const unsigned int invalid_unsigned_int
std::vector< Polynomials::Polynomial< double > > polynomials
Tensor< 1, dim > compute_grad(const unsigned int i, const Point< dim > &p) const
#define Assert(cond, exc)
std::vector< unsigned int > index_map_inverse
Tensor< order, dim > compute_derivative(const unsigned int i, const Point< dim > &p) const
TensorProductPolynomialsBubbles(const std::vector< Pol > &pols)
void compute(const Point< dim > &unit_point, std::vector< double > &values, std::vector< Tensor< 1, dim > > &grads, std::vector< Tensor< 2, dim > > &grad_grads, std::vector< Tensor< 3, dim > > &third_derivatives, std::vector< Tensor< 4, dim > > &fourth_derivatives) const
Tensor< 2, dim > compute_grad_grad(const unsigned int i, const Point< dim > &p) const
std::vector< unsigned int > index_map
double compute_value(const unsigned int i, const Point< dim > &p) const
static const unsigned int dimension