double Hamiltonian::computeLocalEnergy(std::vector<Particle*> particles) {

    if (m_useNumerical) {
        m_kineticEnergy = computeKineticEnergy(particles);
    } else {
        m_kineticEnergy = computeAnalyticalKineticEnergy(particles);
    }

    m_potentialEnergy = computePotentialEnergy(particles);
    return m_kineticEnergy + m_potentialEnergy;
}
Exemplo n.º 2
0
//==============================================================================
double Joint::getPotentialEnergy() const
{
  return computePotentialEnergy();
}
Exemplo n.º 3
0
//==============================================================================
double MetaSkeleton::computeLagrangian() const
{
  return computeKineticEnergy() - computePotentialEnergy();
}
Exemplo n.º 4
0
//==============================================================================
double MetaSkeleton::getPotentialEnergy() const
{
  return computePotentialEnergy();
}
Exemplo n.º 5
0
scalar TwoDScene::computeTotalEnergy() const
{
  return computeKineticEnergy()+computePotentialEnergy();
}