21 using DScalar =
DScalar2<double, Eigen::Matrix<double, -1, 1>, Eigen::Matrix<double, -1, -1>>;
23 using DSVec = Eigen::VectorX<DScalar>;
26 std::is_same_v<Scalar, double>);
65 const std::optional<simplex::Simplex>& variable_simplex_opt = {})
const;
70 const std::optional<simplex::Simplex>& variable_simplex_opt = {})
const;
85 const std::vector<DSVec>& coordinates)
const = 0;
A CachingAccessor that uses tuples for accessing attributes instead of indices.
This is an extension of the PerSimplexFunction class that uses autodiff encoding for differentiations...
Eigen::VectorXd get_gradient(const simplex::Simplex &domain_simplex, const simplex::Simplex &variable_simplex) const override
Eigen::MatrixXd get_hessian(const simplex::Simplex &domain_simplex, const simplex::Simplex &variable_simplex) const override
std::vector< DSVec > get_coordinates(const simplex::Simplex &domain_simplex, const std::optional< simplex::Simplex > &variable_simplex_opt={}) const
This is a helper function that obtains the coordinates of the variables for the function f(x) where f...
PerSimplexAutodiffFunction(const Mesh &mesh, const PrimitiveType primitive_type, const attribute::MeshAttributeHandle &variable_attribute_handle)
double get_value(const simplex::Simplex &domain_simplex) const override
This function is defined over a simplex (normally a triangle or tetrahedron).
~PerSimplexAutodiffFunction()
Eigen::VectorX< DScalar > DSVec
virtual DScalar eval(const simplex::Simplex &domain_simplex, const std::vector< DSVec > &coordinates) const =0
This function defines a function f(x) where f is defined over a simplex domain and the variables for ...
typename DScalar::Scalar Scalar
const Mesh & mesh() const
Automatic differentiation scalar with first- and second-order derivatives.