16 #ifndef dealii__tensor_product_polynomials_bubbles_h 17 #define dealii__tensor_product_polynomials_bubbles_h 20 #include <deal.II/base/config.h> 21 #include <deal.II/base/exceptions.h> 22 #include <deal.II/base/tensor.h> 23 #include <deal.II/base/point.h> 24 #include <deal.II/base/polynomial.h> 25 #include <deal.II/base/tensor_product_polynomials.h> 26 #include <deal.II/base/utilities.h> 30 DEAL_II_NAMESPACE_OPEN
71 std::vector<double> &values,
144 unsigned int n ()
const;
162 const unsigned int q_degree = this->
polynomials.size()-1;
163 const unsigned int n_bubbles = ((q_degree<=1)?1:dim);
165 for (
unsigned int i=0; i<n_bubbles; ++i)
179 return this->n_tensor_pols+dim;
198 const unsigned int q_degree = this->polynomials.size()-1;
199 const unsigned int max_q_indices = this->n_tensor_pols;
200 const unsigned int n_bubbles = ((q_degree<=1)?1:dim);
208 const unsigned int comp = i - this->n_tensor_pols;
217 for (
unsigned int d=0;
d<dim ; ++
d)
219 derivative_1[
d] = 1.;
221 for (
unsigned j=0; j<dim; ++j)
222 derivative_1[d] *= (d==j ? 4*(1-2*p(j)) : 4*p(j)*(1-p(j)));
224 for (
unsigned int i=0; i<q_degree-1; ++i)
225 derivative_1[d]*=2*p(comp)-1;
232 for (
unsigned int j=0; j < dim; ++j)
233 value*=4*p(j)*(1-p(j));
235 double tmp=value*2*(q_degree-1);
236 for (
unsigned int i=0; i<q_degree-2; ++i)
238 derivative_1[comp]+=tmp;
249 for (
unsigned int c=0; c<dim; ++c)
251 v[c][0] = 4*p(c)*(1-p(c));
252 v[c][1] = 4*(1-2*p(c));
257 for (
unsigned int i=0; i<q_degree-1; ++i)
263 double tmp = 2*(q_degree-1);
264 for (
unsigned int i=0; i<q_degree-2; ++i)
273 double tmp=4*(q_degree-2)*(q_degree-1);
274 for (
unsigned int i=0; i<q_degree-3; ++i)
284 for (
unsigned int d1=0; d1<dim; ++d1)
285 for (
unsigned int d2=0; d2<dim; ++d2)
287 grad_grad_1[d1][d2] = v[dim][0];
288 for (
unsigned int x=0; x<dim; ++x)
290 unsigned int derivative=0;
298 grad_grad_1[d1][d2] *= v[x][derivative];
306 for (
unsigned int d=0;
d<dim; ++
d)
308 grad_grad_2[
d][comp] = v[dim][1];
309 grad_grad_3[comp][
d] = v[dim][1];
310 for (
unsigned int x=0; x<dim; ++x)
312 grad_grad_2[
d][comp] *= v[x][
d==x];
313 grad_grad_3[comp][
d] *= v[x][
d==x];
318 double psi_value = 1.;
319 for (
unsigned int x=0; x<dim; ++x)
320 psi_value *= v[x][0];
322 for (
unsigned int d1=0; d1<dim; ++d1)
323 for (
unsigned int d2=0; d2<dim; ++d2)
324 derivative_2[d1][d2] = grad_grad_1[d1][d2]
326 +grad_grad_3[d1][d2];
327 derivative_2[comp][comp]+=psi_value*v[dim][2];
341 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
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
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 ::ExceptionBase & ExcNotImplemented()
static ::ExceptionBase & ExcInternalError()