Dear John,

> const unsigned int n_q_points = quadrature_formula.size();
> const FEValuesExtractors::Vector velocities (0);
> std::vector<std::vector<Tensor<1,dim> > > velocity_grads(n_q_points);
> 
> fe_values[velocities].get_function_gradients(solution,velocity_grads);
> 
> The exact error is:
> error: no matching function for call to 
> ‘dealii::FEValuesViews::Vector<2, 2>::get_function_gradients(const 
> dealii::BlockVector<double>&, std::vector<std::vector<dealii::Tensor<1, 
> 2>, std::allocator<dealii::Tensor<1, 2> > >, 
> std::allocator<std::vector<dealii::Tensor<1, 2>, 
> std::allocator<dealii::Tensor<1, 2> > > > >&) const’

With the concept of FEValuesViews, we know how many components we have
in the finite element function. For a vector-valued problem, there are
dim components (known at compile time), so we collect the result of the
gradient of a finite element function as a Tensor<2,dim> and not as
std::vector<Tensor<1,dim> > with the vector of length dim. Hence, you
should write
  std::vector<Tensor<2,dim> > velocity_grads(n_q_points);

Does this work for you? The access to velocity_grads is then the same as
you would access std::vector<std::vector<Tensor<1,dim> >, i.e., you
write velocity_grads[q][d] to get the gradient of the d-th component at
quadrature point q.

Best,
Martin

_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to