Hi Prof. Bangerth, Thanks for trying the code. Yes, just checked that we aren't really using a specific deal.II function with AD and wouldn't need to derive our class from Function<dim>. Function<dim, AD> compiled fine with deal.II version 9.2, but it doesn't after this PR <https://github.com/dealii/dealii/pull/14211> improved the check (which is a good check if functions taking in Function<dim> expect real/complex types).
Have a great day. Best, Pranshul. On Saturday, December 24, 2022 at 1:16:27 PM UTC-5 Wolfgang Bangerth wrote: > On 12/23/22 12:06, Pranshul Thakur wrote: > > > > Just a simple declaration of Function (i.e. without using > > Function::vector_value()) gives the error. I have attached the error > along > > with a simplified sample code which produces it. As seen from the code, > double > > works fine but an ADType triggers static_assert while compiling. > > Pranshul, > I have played with this a bit but can't make it work even if I allowed > myself > to change the Function base class to be incompatible. C++ simply wants > that > all functions declared as virtual are always available, and one can't > remove > certain virtual functions from the interface depending on a type argument. > > The question, though, is what you want to do with the Function class you > are > declaring. Function<dim> is only useful if you can pass an object of this > type > to a function that knows what to do with such functions. This works in > deal.II > for scalar types that are real numbers or complex numbers, but not for AD > types. So even if you could declare an object of type Function<dim,AD>, > there > is nothing you can do with such an object. > > Best > W. > > -- > ------------------------------------------------------------------------ > Wolfgang Bangerth email: [email protected] > 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/b6c598de-399f-4f3c-a999-b3e4de2b4f09n%40googlegroups.com.
