Barrier

Warning

doxygenfunction: Unable to resolve function “barrier” with arguments None in doxygen xml output for project “IPC Toolkit” from directory: ../build/doxyoutput/xml. Potential matches:

- const Barrier &barrier() const
- double barrier(const double d, const double dhat)

Warning

doxygenfunction: Cannot find function “barrier_gradient” in doxygen xml output for project “IPC Toolkit” from directory: ../build/doxyoutput/xml

Warning

doxygenfunction: Cannot find function “barrier_hessian” in doxygen xml output for project “IPC Toolkit” from directory: ../build/doxyoutput/xml

Adaptive Barrier Stiffness

double ipc::initial_barrier_stiffness(const double bbox_diagonal,
    
const Barrierbarrierconst double dhat,
    
const double average_massconst Eigen::VectorXdgrad_energy,
    
const Eigen::VectorXdgrad_barrier,
    
double& max_barrier_stiffness,
    
const double min_barrier_stiffness_scale = 1e11,
    
const double dmin = 0);

Compute an inital barrier stiffness using the barrier potential gradient.

Parameters:
const double bbox_diagonal

[in] Length of the diagonal of the bounding box of the scene.

const Barrier &barrier

[in] Barrier function.

const double dhat

[in] Activation distance of the barrier.

const double average_mass

[in] Average mass of all bodies.

const Eigen::VectorXd &grad_energy

[in] Gradient of the elasticity energy function.

const Eigen::VectorXd &grad_barrier

[in] Gradient of the barrier potential.

double &max_barrier_stiffness

[out] Maximum stiffness of the barrier.

const double min_barrier_stiffness_scale = 1e11

[in] Scale used to premultiply the minimum barrier stiffness.

const double dmin = 0

[in] Minimum distance between elements.

Returns:

The initial barrier stiffness.

double ipc::update_barrier_stiffness(const double prev_min_distance,
    
const double min_distanceconst double max_barrier_stiffness,
    
const double barrier_stiffnessconst double bbox_diagonal,
    
const double dhat_epsilon_scale = 1e-9const double dmin = 0);

Update the barrier stiffness if the distance is decreasing and less than dhat_epsilon_scale * diag.

Parameters:
const double prev_min_distance

[in] Previous minimum distance between elements.

const double min_distance

[in] Current minimum distance between elements.

const double max_barrier_stiffness

[in] Maximum stiffness of the barrier.

const double barrier_stiffness

[in] Current barrier stiffness.

const double bbox_diagonal

[in] Length of the diagonal of the bounding box of the scene.

const double dhat_epsilon_scale = 1e-9

[in] Update if distance is less than this fraction of the diagonal.

const double dmin = 0

[in] Minimum distance between elements.

Returns:

The updated barrier stiffness.