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/1d78850c-0ad5-d425-a4a0-5be4cc79d3a1%40colostate.edu.