~esys-p-dev/esys-particle/2.2.1

« back to all changes in this revision

Viewing changes to Model/RotBondedInteraction.cpp

  • Committer: Dion Weatherley
  • Date: 2013-05-08 03:48:53 UTC
  • Revision ID: d.weatherley@uq.edu.au-20130508034853-4wpz5kzv8nlgdmhv
Added VectorFieldSaver output of normal and shear force to RotBondedInteraction

Show diffs side-by-side

added added

removed removed

Lines of Context:
534
534
  return m_force;
535
535
}
536
536
 
 
537
Vec3 CRotBondedInteraction::getNormalForce() const
 
538
{
 
539
  Vec3 dr = (m_p1->getPos() - m_p2->getPos()).unit();
 
540
  Vec3 normalForce = (m_force*dr)*dr;
 
541
  return normalForce;
 
542
}
 
543
 
 
544
Vec3 CRotBondedInteraction::getTangentialForce() const
 
545
{
 
546
  return (m_force - getNormalForce());
 
547
}
 
548
 
537
549
/*!
538
550
  Get the particle member function which returns a scalar field of a given name.
539
551
 
576
588
                                                                                
577
589
  if (name=="force"){
578
590
    vf=&CRotBondedInteraction::getForce;
 
591
  } else if (name=="normal_force"){
 
592
    vf=&CRotBondedInteraction::getNormalForce;
 
593
  } else if (name=="tangential_force"){
 
594
    vf=&CRotBondedInteraction::getTangentialForce;
579
595
  } else {
580
596
    vf=NULL;
581
597
    cerr << "ERROR - invalid name for interaction vector  access function" << endl;