Wildmeshing Toolkit
AMIPS.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <optional>
7 
8 namespace wmtk::function {
9 
10 double Tet_AMIPS_energy(const std::array<double, 12>& T);
11 double Tri_AMIPS_energy(const std::array<double, 6>& T);
12 
13 void Tet_AMIPS_jacobian(const std::array<double, 12>& T, Eigen::Vector3d& j);
14 void Tri_AMIPS_jacobian(const std::array<double, 6>& T, Eigen::Vector2d& j);
15 
16 void Tet_AMIPS_hessian(const std::array<double, 12>& T, Eigen::Matrix3d& h);
17 void Tri_AMIPS_hessian(const std::array<double, 6>& T, Eigen::Matrix2d& h);
18 
19 class AMIPS : public PerSimplexFunction
20 {
21 public:
29 
30  ~AMIPS(){};
31 
32 public:
33  double get_value(const simplex::Simplex& domain_simplex) const override;
34 
35  Eigen::VectorXd get_gradient(
36  const simplex::Simplex& domain_simplex,
37  const simplex::Simplex& variable_simplex) const override;
38  Eigen::MatrixXd get_hessian(
39  const simplex::Simplex& domain_simplex,
40  const simplex::Simplex& variable_simplex) const override;
41 
42 public:
43  template <int64_t NV, int64_t DIM>
44  std::array<double, NV * DIM> get_raw_coordinates(
45  const simplex::Simplex& domain_simplex,
46  const std::optional<simplex::Simplex>& variable_simplex = {}) const;
47 };
48 
49 } // namespace wmtk::function
Eigen::VectorXd get_gradient(const simplex::Simplex &domain_simplex, const simplex::Simplex &variable_simplex) const override
Definition: AMIPS.cpp:703
std::array< double, NV *DIM > get_raw_coordinates(const simplex::Simplex &domain_simplex, const std::optional< simplex::Simplex > &variable_simplex={}) const
Definition: AMIPS.cpp:638
AMIPS(const Mesh &mesh, const attribute::MeshAttributeHandle &attribute_handle)
Construct a new AMIPS function.
Definition: AMIPS.cpp:682
Eigen::MatrixXd get_hessian(const simplex::Simplex &domain_simplex, const simplex::Simplex &variable_simplex) const override
Definition: AMIPS.cpp:719
double get_value(const simplex::Simplex &domain_simplex) const override
This function is defined over a simplex (normally a triangle or tetrahedron).
Definition: AMIPS.cpp:687
const attribute::MeshAttributeHandle & attribute_handle() const
void Tet_AMIPS_jacobian(const std::array< double, 12 > &T, Eigen::Vector3d &result_0)
Definition: AMIPS.cpp:75
void Tri_AMIPS_hessian(const std::array< double, 6 > &T, Eigen::Matrix2d &result_0)
Definition: AMIPS.cpp:542
void Tri_AMIPS_jacobian(const std::array< double, 6 > &T, Eigen::Vector2d &result_0)
Definition: AMIPS.cpp:503
double Tet_AMIPS_energy(const std::array< double, 12 > &T)
Definition: AMIPS.cpp:375
void Tet_AMIPS_hessian(const std::array< double, 12 > &T, Eigen::Matrix3d &result_0)
Definition: AMIPS.cpp:172
double Tri_AMIPS_energy(const std::array< double, 6 > &T)
Definition: AMIPS.cpp:473
Vector< double, 3 > Vector3d
Definition: Types.hpp:39