|
Wildmeshing Toolkit
|
The 3D twin of AlignEnergy2D: each incident front FACE at the vertex against the field. More...
#include <OffsetPotential.hpp>
Classes | |
| struct | Face |
Public Member Functions | |
| AlignEnergy3D (const std::shared_ptr< const OffsetPotential3D > &potential, std::vector< Face > faces, double outward_sign, double weight) | |
| void | residual (const Eigen::Vector3d &x, const Face &f, double &r, Eigen::Vector3d &J) const |
| r_f and its derivative for one face; r = 0 with J = 0 where grad Phi or the face vanishes. | |
| 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 |
Private Attributes | |
| std::shared_ptr< const OffsetPotential3D > | m_potential |
| std::vector< Face > | m_faces |
| double | m_sign |
| double | m_weight |
The 3D twin of AlignEnergy2D: each incident front FACE at the vertex against the field.
E(x) = w * sum over the vertex's incident front faces f of agree_f (1 - n_f(x) . g(c_f(x)))^2
n_f(x) = sigma_f (q1 - x) x (q2 - x) / |...| is the face's outward unit normal (q1, q2 the two fixed corners; sigma_f = +-1 chosen at construction so the normal points away from the band tet), g(c) = s grad Phi(c) / |grad Phi(c)| the field's outward unit direction at the face centroid c_f = (x + q1 + q2) / 3. Zero when the face lies along the level set, 4 w per face when it points the wrong way. Both dependences on x are differentiated, as in 2D: the normal's rotation (exact) and the field's turning (through the potential's Hessian); the Hessian block is the Gauss-Newton 2 w sum J_f J_f^T.