21 const std::optional<simplex::Simplex>& variable_simplex_opt)
const
30 const std::optional<simplex::Simplex>& variable_simplex_opt)
const
37 variable_simplex_opt.has_value() ? variable_simplex_opt->
tuple() : std::optional<Tuple>());
39 std::vector<DSVec> ret;
40 ret.reserve(attrs.size());
42 for (
size_t i = 0; i < attrs.size(); ++i) {
44 i == index ? utils::as_DScalar<DScalar>(attrs[i]) : attrs[i].cast<DScalar>());
const attribute::Accessor< T, Mesh, D > create_const_accessor(const attribute::MeshAttributeHandle &handle) const
A CachingAccessor that uses tuples for accessing attributes instead of indices.
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()
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 ...
const attribute::MeshAttributeHandle & attribute_handle() const
int64_t embedded_dimension() const
const Mesh & mesh() const
const PrimitiveType m_primitive_type
const Tuple & tuple() const
std::tuple< std::vector< std::decay_t< typename attribute::ConstMapResult< T > > >, int64_t > get_simplex_attributes(const Mesh &mesh, const wmtk::attribute::Accessor< T > &accessor, const PrimitiveType primitive_type, const simplex::Simplex &simplex_in, const std::optional< wmtk::Tuple > &vertex_marker)
get attributes from a simplex
const Scalar & getValue() const
const Hessian & getHessian() const
const Gradient & getGradient() const