On 10/26/2017 02:18 AM, 'Maxi Miller' via deal.II User Group wrote:
I added the errors I get while compiling in the log file. My code for
producing it is:
|
std::vector<Table<3,Sacado::Fad::DFad<double>>>grad_N_AD(n_q_points);std::vector<Sacado::Fad::DFad<double>>local_dof_values_AD(cell->get_fe().dofs_per_cell);
for(unsignedinti=0;i<dofs_per_cell;++i)
{
local_dof_values_AD[i]=present_solution(local_dof_indices[i]);
local_dof_values_AD[i].diff(i,dofs_per_cell);
}
fe_values[surface_TE].get_function_gradients_from_local_dof_values(local_dof_values_AD,grad_N_AD);
|
Is that approach correct so far?
This looks reasonable. The code does not compile because of this error:
/opt/dealII/include/deal.II/base/template_constraints.h:388:40: error: no
match for 'operator*' (operand types are 'Sacado::Fad::DFad<double>' and
'dealii::Tensor<1, 2, double>')
typedef decltype(std::declval<T>() * std::declval<U>()) type;
~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
This should, in principle, be covered by the following operator in tensor.h:
template <int rank, int dim,
typename Number,
typename OtherNumber>
inline
Tensor<rank,dim,typename ProductType<typename EnableIfScalar<Number>::type,
OtherNumber>::type>
operator * (const Number &factor,
const Tensor<rank,dim,OtherNumber> &t)
{
// simply forward to the operator above
return t * factor;
}
with Number=DFad<double> and OtherNumber=double. You need to investigate
whether either the ProductType or EnableIfScalar is not defined for this pair
of operands. If you can figure this out, you should be in business.
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email: bange...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.