Wildmeshing Toolkit
wmtk::function::TriangleAMIPS Class Reference

This is the implementation of the AMIPS energy function of a triangle mesh that can be embedded in 2d or 3d. More...

#include <TriangleAMIPS.hpp>

Inheritance diagram for wmtk::function::TriangleAMIPS:
[legend]
Collaboration diagram for wmtk::function::TriangleAMIPS:
[legend]

Public Member Functions

 TriangleAMIPS (const TriMesh &mesh, const attribute::MeshAttributeHandle &vertex_attribute_handle)
 
 ~TriangleAMIPS ()
 
- Public Member Functions inherited from wmtk::function::PerSimplexAutodiffFunction
 PerSimplexAutodiffFunction (const Mesh &mesh, const PrimitiveType primitive_type, const attribute::MeshAttributeHandle &variable_attribute_handle)
 
 ~PerSimplexAutodiffFunction ()
 
double get_value (const simplex::Simplex &domain_simplex) const override
 This function is defined over a simplex (normally a triangle or tetrahedron). More...
 
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
 
- Public Member Functions inherited from wmtk::function::PerSimplexFunction
 PerSimplexFunction (const Mesh &mesh, const PrimitiveType primitive_type, const attribute::MeshAttributeHandle &variable_attribute_handle)
 
virtual ~PerSimplexFunction ()
 
const Meshmesh () const
 
const attribute::MeshAttributeHandleattribute_handle () const
 
int64_t embedded_dimension () const
 

Protected Member Functions

DScalar eval (const simplex::Simplex &domain_simplex, const std::vector< DSVec > &coordinates) const override
 This function defines a function f(x) where f is defined over a simplex domain and the variables for f are the n vertices coordinates of the simplex. More...
 
- Protected Member Functions inherited from wmtk::function::PerSimplexAutodiffFunction
std::vector< DSVecget_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 is defined over a domain consists of the input argument domain_tuples. More...
 
std::vector< DSVecget_coordinates (const attribute::Accessor< double > &accessor, const simplex::Simplex &domain_simplex, const std::optional< simplex::Simplex > &variable_simplex_opt={}) const
 

Additional Inherited Members

- Public Types inherited from wmtk::function::PerSimplexAutodiffFunction
using DScalar = DScalar2< double, Eigen::Matrix< double, -1, 1 >, Eigen::Matrix< double, -1, -1 > >
 
using Scalar = typename DScalar::Scalar
 
using DSVec = Eigen::VectorX< DScalar >
 
- Protected Attributes inherited from wmtk::function::PerSimplexFunction
const PrimitiveType m_primitive_type
 

Detailed Description

This is the implementation of the AMIPS energy function of a triangle mesh that can be embedded in 2d or 3d.

It uses autodiff encoding for differentiations.

Definition at line 11 of file TriangleAMIPS.hpp.

Constructor & Destructor Documentation

◆ TriangleAMIPS()

wmtk::function::TriangleAMIPS::TriangleAMIPS ( const TriMesh mesh,
const attribute::MeshAttributeHandle vertex_attribute_handle 
)

Definition at line 9 of file TriangleAMIPS.cpp.

References wmtk::Vertex.

◆ ~TriangleAMIPS()

wmtk::function::TriangleAMIPS::~TriangleAMIPS ( )
default

Member Function Documentation

◆ eval()

DScalar wmtk::function::TriangleAMIPS::eval ( const simplex::Simplex domain_simplex,
const std::vector< DSVec > &  coordinates 
) const
overrideprotectedvirtual

This function defines a function f(x) where f is defined over a simplex domain and the variables for f are the n vertices coordinates of the simplex.

The input coordinates are obtained through the get_coordinates function. They are encoded in autodiff type so that the function can be differentiated through autodiff.

Parameters
coordinates
Returns
DScalar

Implements wmtk::function::PerSimplexAutodiffFunction.

Definition at line 21 of file TriangleAMIPS.cpp.

References wmtk::function::utils::amips(), wmtk::function::PerSimplexFunction::embedded_dimension(), wmtk::simplex::Simplex::primitive_type(), and wmtk::Triangle.

Here is the call graph for this function:

The documentation for this class was generated from the following files: