Doug,
in addition to what J-P already wrote:

> We had chosen to use deal.ii since most of it looked templated in terms of 
> accepting the float type. However, I noticed that the FEValuesBase returns a 
> 'double', instead of a generic 'value_type' for the Jacobian term.

That depends on the context.

Shape functions are indeed defined as phi(x) returning simply a double. That's 
because of an underlying assumption that x is a location parameterized as 
doubles. So functions such as shape_value(), shape_grad(), etc really just 
return doubles. (This includes the Jacobian of the shape functions, i.e., 
their gradients.) In other words, it's currently not possible to do 
autodifferentiation of the shape functions with regard to the position x.

But functions such as get_function_gradient() which compute quantities such as

   u_h(x) = \sum_j U_j phi(x_j)

are templatized on the data type of the vector U of unknowns. So they should 
allow computing Jacobians of u_h with regard to the coefficients U_j. This is 
what one needs to do to compute residual vectors from energy functionals, and 
Hessian matrices from residual vectors.

The latter functionality is implemented and routinely used. In other words...


> Our goal would be to differentiate through the entire residual (and possibly 
> the time step) with respect to the solution variables and *mesh points*. 

...the former of this works, whereas the latter probably does not.


As J-P already mentioned, the reason for all of this is not a conscious design 
decision, but that nobody who needed this in the past has implemented it. We'd 
be quite happy to accept patches in this direction. It is often useful if you 
posted an example of what you want to do and discussed implementation 
strategies before starting the work -- this makes merging this functionality 
later on easier. I see that you've read through a lot of code already, though, 
so you'll have a good sense of what it'll take.

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.

Reply via email to