Wildmeshing Toolkit
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
wmtk::optimization::SmoothingEnergy2D Class Reference
Inheritance diagram for wmtk::optimization::SmoothingEnergy2D:

Public Member Functions

 SmoothingEnergy2D (const std::array< Vector2d, 3 > &pts, const double &M, const Vector3d &L_w)
 The smoothing energy of a vertex position on a polyline.
 
TVector initial_position () const
 
double value (const TVector &x) override
 
void gradient (const TVector &x, TVector &gradv) override
 
void hessian (const TVector &x, THessian &hessian) override
 
void hessian (const TVector &x, MatrixXd &hessian) override
 
void solution_changed (const TVector &new_x) override
 

Static Public Member Functions

static void local_mass_and_stiffness (const std::array< Vector2d, 3 > &pts, double &M, Vector3d &L_w)
 
static void uniform_mass_and_stiffness (const std::array< Vector2d, 3 > &pts, double &M, Vector3d &L_w)
 

Private Attributes

std::array< Vector2d, 3 > m_pts
 
Vector3d m_L_w_row
 
double m_M
 
double m_M_inv
 
Vector3d m_LTML_row
 

Constructor & Destructor Documentation

◆ SmoothingEnergy2D()

wmtk::optimization::SmoothingEnergy2D::SmoothingEnergy2D ( const std::array< Vector2d, 3 > &  pts,
const double &  M,
const Vector3d &  L_w 
)

The smoothing energy of a vertex position on a polyline.

Three positions must be provided, the optimized position (p0) and its two neighbors (p1, p2).

Member Data Documentation

◆ m_L_w_row

Vector3d wmtk::optimization::SmoothingEnergy2D::m_L_w_row
private

The first row of stiffness matrix L_w which belongs to the optimized vertex. By convention, this needs to be sorted such that the first entry belongs to the optimized vertex.

The full stiffness matrix L_w has shape NxN (more specifically in our case 3x3 as we have three points), but the rows of fixed vertices are empty. Therefore, we only need to store the one non-empty row of the optimized vertex. By convention of m_pts, this must be the first one, i.e., L_w.row(0).

◆ m_LTML_row

Vector3d wmtk::optimization::SmoothingEnergy2D::m_LTML_row
private

We only need the first row of LTML, because all other vertices are fixed.

L = M_inv * L_w LTML = L^T * M * L = L_w^T * M_inv * L_w We only want to optimize one vertex, so we only need one row of LTML: LTML.row(0) = M_inv * L_w(0,0) * L_w.row(0) <– this is what is stored in m_LTML_row

◆ m_pts

std::array<Vector2d, 3> wmtk::optimization::SmoothingEnergy2D::m_pts
private

The optimized point and its (two) neighbors. For the optimization, we use the convention that m_pts[0] is the optimized vertex and the neighbors m_pts[1] and m_pts[2] are fixed.


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