occ
Loading...
Searching...
No Matches
occ::mults::CoordinateSystem Struct Reference

Lightweight POD struct for multipole coordinate system transformations. More...

#include <coordinate_system.h>

Public Member Functions

Vec3 raxyz () const
 
Vec3 rbxyz () const
 
double rax () const
 
double ray () const
 
double raz () const
 
double rbx () const
 
double rby () const
 
double rbz () const
 
double dx () const
 
double dy () const
 
double dz () const
 
double raw_rax () const
 
double raw_ray () const
 
double raw_raz () const
 
double raw_rbx () const
 
double raw_rby () const
 
double raw_rbz () const
 
bool is_valid (double tolerance=1e-12) const
 Validate coordinate system consistency Returns true if all computed quantities are consistent.
 
bool matches_orient_debug (double orient_rax, double orient_ray, double orient_raz, double orient_rbx, double orient_rby, double orient_rbz, double orient_r, double tolerance=1e-6) const
 Check if coordinate system matches Orient's debug output Useful for validating against known Orient calculations.
 

Static Public Member Functions

static CoordinateSystem from_points (const Vec3 &ra_in, const Vec3 &rb_in)
 Initialize coordinate system from two points Following Orient's mlinfo.f90 exactly:
 
static CoordinateSystem from_body_frame (const Vec3 &ra_in, const Vec3 &rb_in, const Mat3 &M_A, const Mat3 &M_B)
 Initialize coordinate system with body-frame unit vectors (Orient's approach)
 

Public Attributes

Vec3 ra
 
Vec3 rb
 
Vec3 rab
 
double r
 
Vec3 er
 
bool use_body_frame = false
 
Vec3 e1r_body
 
Vec3 e2r_body
 
double cxx
 
double cxy
 
double cxz
 
double cyx
 
double cyy
 
double cyz
 
double czx
 
double czy
 
double czz
 

Detailed Description

Lightweight POD struct for multipole coordinate system transformations.

Coordinate definitions:

  • Site A coordinates: ra (raw input coordinates)
  • Site B coordinates: rb (raw input coordinates)
  • Inter-site vector: rab = rb - ra
  • Distance: r = |rab|
  • Unit vector: er = rab / r (points from A to B)

OCC convention for unit vector accessors: rax,ray,raz = +er (unit vector from A to B) rbx,rby,rbz = -er (unit vector from B to A)

Note: Orient uses the OPPOSITE sign convention: Orient rax = -er, Orient rbx = +er The S-function kernel code compensates by swapping which accessor it calls (e.g., using rbx() where Orient uses rax), so the numerical results match Orient exactly despite the naming difference.

Member Function Documentation

◆ dx()

double occ::mults::CoordinateSystem::dx ( ) const
inline

◆ dy()

double occ::mults::CoordinateSystem::dy ( ) const
inline

◆ dz()

double occ::mults::CoordinateSystem::dz ( ) const
inline

◆ from_body_frame()

static CoordinateSystem occ::mults::CoordinateSystem::from_body_frame ( const Vec3 ra_in,
const Vec3 rb_in,
const Mat3 M_A,
const Mat3 M_B 
)
inlinestatic

Initialize coordinate system with body-frame unit vectors (Orient's approach)

This implements Orient's body-frame approach where:

  • Lab frame: er_lab = (rb - ra) / |rb - ra|
  • Body frame for site A: e1r = M_A^T * er_lab
  • Body frame for site B: e2r = -M_B^T * er_lab
  • Orientation matrix: xx = M_A^T * M_B
Parameters
ra_inPosition of site A (lab frame)
rb_inPosition of site B (lab frame)
M_ARotation matrix for molecule A (body to lab)
M_BRotation matrix for molecule B (body to lab)

◆ from_points()

static CoordinateSystem occ::mults::CoordinateSystem::from_points ( const Vec3 ra_in,
const Vec3 rb_in 
)
inlinestatic

Initialize coordinate system from two points Following Orient's mlinfo.f90 exactly:

  • rab = rb - ra (site-to-site vector)
  • r = |rab| (distance)
  • er = rab / r (normalized inter-site vector)
  • Orientation matrix initialized to identity (for point multipoles)

◆ is_valid()

bool occ::mults::CoordinateSystem::is_valid ( double  tolerance = 1e-12) const
inline

Validate coordinate system consistency Returns true if all computed quantities are consistent.

◆ matches_orient_debug()

bool occ::mults::CoordinateSystem::matches_orient_debug ( double  orient_rax,
double  orient_ray,
double  orient_raz,
double  orient_rbx,
double  orient_rby,
double  orient_rbz,
double  orient_r,
double  tolerance = 1e-6 
) const
inline

Check if coordinate system matches Orient's debug output Useful for validating against known Orient calculations.

◆ raw_rax()

double occ::mults::CoordinateSystem::raw_rax ( ) const
inline

◆ raw_ray()

double occ::mults::CoordinateSystem::raw_ray ( ) const
inline

◆ raw_raz()

double occ::mults::CoordinateSystem::raw_raz ( ) const
inline

◆ raw_rbx()

double occ::mults::CoordinateSystem::raw_rbx ( ) const
inline

◆ raw_rby()

double occ::mults::CoordinateSystem::raw_rby ( ) const
inline

◆ raw_rbz()

double occ::mults::CoordinateSystem::raw_rbz ( ) const
inline

◆ rax()

double occ::mults::CoordinateSystem::rax ( ) const
inline

◆ raxyz()

Vec3 occ::mults::CoordinateSystem::raxyz ( ) const
inline

◆ ray()

double occ::mults::CoordinateSystem::ray ( ) const
inline

◆ raz()

double occ::mults::CoordinateSystem::raz ( ) const
inline

◆ rbx()

double occ::mults::CoordinateSystem::rbx ( ) const
inline

◆ rbxyz()

Vec3 occ::mults::CoordinateSystem::rbxyz ( ) const
inline

◆ rby()

double occ::mults::CoordinateSystem::rby ( ) const
inline

◆ rbz()

double occ::mults::CoordinateSystem::rbz ( ) const
inline

Member Data Documentation

◆ cxx

double occ::mults::CoordinateSystem::cxx

◆ cxy

double occ::mults::CoordinateSystem::cxy

◆ cxz

double occ::mults::CoordinateSystem::cxz

◆ cyx

double occ::mults::CoordinateSystem::cyx

◆ cyy

double occ::mults::CoordinateSystem::cyy

◆ cyz

double occ::mults::CoordinateSystem::cyz

◆ czx

double occ::mults::CoordinateSystem::czx

◆ czy

double occ::mults::CoordinateSystem::czy

◆ czz

double occ::mults::CoordinateSystem::czz

◆ e1r_body

Vec3 occ::mults::CoordinateSystem::e1r_body

◆ e2r_body

Vec3 occ::mults::CoordinateSystem::e2r_body

◆ er

Vec3 occ::mults::CoordinateSystem::er

◆ r

double occ::mults::CoordinateSystem::r

◆ ra

Vec3 occ::mults::CoordinateSystem::ra

◆ rab

Vec3 occ::mults::CoordinateSystem::rab

◆ rb

Vec3 occ::mults::CoordinateSystem::rb

◆ use_body_frame

bool occ::mults::CoordinateSystem::use_body_frame = false

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