Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autodiff function for coefficient [add-ad-coeff] #4256

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

IdoAkkerman
Copy link
Contributor

This PR defines as helper class that can convert user provided functions in to first order derivatives, that can be used by the various XXXFunctionCoefficient classes.

The functions need to to be provided as either
void vectorTDFun(const Vector& param, const ADVector& x, ADVector& f)
or
void vectorTDFun(const Vector& param, const ADVector& x, const ADFloat t, ADVector& f)
where ADVector is of type std:vector<ADFloat> and ADFloat is equivalent to real_t with additional autodiff functionality.

A full suite of unit tests is provided. This also gives a usage examples.

Envisioned usages: convergence tests based on norms including derivatives.

Functionality could - in principle -be extended to Hessian, Laplacian and other higher order derivatives.

Credit were credit is due: large inspiration has been taken from the autodiff miniapp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant