occ
Loading...
Searching...
No Matches
occ::mults::RigidBodyProjection Class Reference

Projection matrix for removing rigid-body modes from optimization. More...

#include <optimization_projection.h>

Public Member Functions

 RigidBodyProjection (size_t n_molecules)
 Construct projection for N rigid bodies.
 
size_t full_dof () const
 Get number of original degrees of freedom (6N)
 
size_t projected_dof () const
 Get number of projected degrees of freedom (6N-6)
 
Vec project_gradient (const Vec &grad_full) const
 Project full gradient to reduced space.
 
Vec reconstruct_full (const Vec &x_proj, const Vec &x_base) const
 Reconstruct full coordinates from projected coordinates.
 
Vec project_coordinates (const Vec &x_full, const Vec &x_base) const
 Project full coordinates to reduced space.
 
const Matprojection_matrix () const
 Get projection matrix (for debugging/analysis)
 

Detailed Description

Projection matrix for removing rigid-body modes from optimization.

For a system of N rigid bodies with 6N degrees of freedom (3 position + 3 orientation each), there are 6 spurious modes corresponding to global translation (3) and global rotation (3). These cause the Hessian to have 6 zero eigenvalues, leading to divergence in optimization.

Orient's approach (BUILDO routine):

  • Construct a projection matrix P that removes these 6 modes
  • Optimize in the (6N-6) dimensional space
  • Gradient projection: grad_proj = P^T * grad_full
  • Coordinate reconstruction: x_full = x_base + P * x_proj

For 2 molecules (N=2):

  • 12 DOF → 6 DOF (relative position + relative orientation)
  • Simplest approach: Fix molecule 1 at origin with identity rotation
  • Optimize only molecule 2's position and orientation relative to molecule 1

Constructor & Destructor Documentation

◆ RigidBodyProjection()

occ::mults::RigidBodyProjection::RigidBodyProjection ( size_t  n_molecules)
explicit

Construct projection for N rigid bodies.

Parameters
n_moleculesNumber of rigid bodies

Member Function Documentation

◆ full_dof()

size_t occ::mults::RigidBodyProjection::full_dof ( ) const
inline

Get number of original degrees of freedom (6N)

◆ project_coordinates()

Vec occ::mults::RigidBodyProjection::project_coordinates ( const Vec x_full,
const Vec x_base 
) const

Project full coordinates to reduced space.

Given full coordinates, project to (6N-6) space relative to base: x_proj = P^T * (x_full - x_base)

Parameters
x_fullCoordinates in full 6N space
x_baseBase configuration
Returns
Coordinates in (6N-6) projected space

◆ project_gradient()

Vec occ::mults::RigidBodyProjection::project_gradient ( const Vec grad_full) const

Project full gradient to reduced space.

For optimization, we need: grad_proj = P^T * grad_full This removes components corresponding to global translation/rotation.

Parameters
grad_fullGradient in full 6N space
Returns
Gradient in (6N-6) projected space

◆ projected_dof()

size_t occ::mults::RigidBodyProjection::projected_dof ( ) const
inline

Get number of projected degrees of freedom (6N-6)

◆ projection_matrix()

const Mat & occ::mults::RigidBodyProjection::projection_matrix ( ) const
inline

Get projection matrix (for debugging/analysis)

Returns
(6N-6) × 6N projection matrix

◆ reconstruct_full()

Vec occ::mults::RigidBodyProjection::reconstruct_full ( const Vec x_proj,
const Vec x_base 
) const

Reconstruct full coordinates from projected coordinates.

Given projected coordinates x_proj in (6N-6) space, reconstruct full coordinates: x_full = x_base + P * x_proj

Parameters
x_projCoordinates in (6N-6) projected space
x_baseBase configuration (typically initial geometry)
Returns
Coordinates in full 6N space

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