Карта сайта Kansoftware
НОВОСТИУСЛУГИРЕШЕНИЯКОНТАКТЫ
Разработка программного обеспечения

Class template velocity_verlet

Boost , Chapter 1. Boost.Numeric.Odeint , Header <boost/numeric/odeint/stepper/velocity_verlet.hpp>

Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

Boost C++ LibrariesHomeLibrariesPeopleFAQMore

PrevUpHomeNext

Class template velocity_verlet

boost::numeric::odeint::velocity_verlet — The Velocity-Verlet algorithm.

Synopsis

// In header: <boost/numeric/odeint/stepper/velocity_verlet.hpp>
template<typename Coor, typename Velocity = Coor, typename Value = double,
         typename Acceleration = Coor, typename Time = Value,
         typename TimeSq = Time,
         typename Algebra = typename algebra_dispatcher< Coor >::algebra_type,
         typename Operations = typename operations_dispatcher< Coor >::operations_type,
         typename Resizer = initially_resizer>
class velocity_verlet : public algebra_stepper_base< Algebra, Operations > {
public:
  // types
  typedef algebra_stepper_base< Algebra, Operations >   algebra_stepper_base_type;
  typedef algebra_stepper_base_type::algebra_type       algebra_type;
  typedef algebra_stepper_base_type::operations_type    operations_type;
  typedef Coor                                          coor_type;
  typedef Velocity                                      velocity_type;
  typedef Acceleration                                  acceleration_type;
  typedef std::pair< coor_type, velocity_type >         state_type;
  typedef std::pair< velocity_type, acceleration_type > deriv_type;
  typedef state_wrapper< acceleration_type >            wrapped_acceleration_type;
  typedef Value                                         value_type;
  typedef Time                                          time_type;
  typedef TimeSq                                        time_square_type;
  typedef Resizer                                       resizer_type;
  typedef stepper_tag                                   stepper_category;
  typedef unsigned short                                order_type;
  // construct/copy/destruct
  velocity_verlet(const algebra_type & = algebra_type());
  // public member functions
  order_type order(void) const;
  template<typename System, typename StateInOut>
    void do_step(System, StateInOut &, time_type, time_type);
  template<typename System, typename StateInOut>
    void do_step(System, const StateInOut &, time_type, time_type);
  template<typename System, typename CoorIn, typename VelocityIn,
           typename AccelerationIn, typename CoorOut, typename VelocityOut,
           typename AccelerationOut>
    void do_step(System, CoorIn const &, VelocityIn const &,
                 AccelerationIn const &, CoorOut &, VelocityOut &,
                 AccelerationOut &, time_type, time_type);
  template<typename StateIn> void adjust_size(const StateIn &);
  void reset(void);
  template<typename AccelerationIn> void initialize(const AccelerationIn &);
  template<typename System, typename CoorIn, typename VelocityIn>
    void initialize(System, const CoorIn &, const VelocityIn &, time_type);
  bool is_initialized(void) const;
  // private member functions
  template<typename System, typename CoorIn, typename VelocityIn>
    void initialize_acc(System, const CoorIn &, const VelocityIn &, time_type);
  template<typename System, typename StateInOut>
    void do_step_v1(System, StateInOut &, time_type, time_type);
  template<typename StateIn> bool resize_impl(const StateIn &);
  acceleration_type & get_current_acc(void);
  const acceleration_type & get_current_acc(void) const;
  acceleration_type & get_old_acc(void);
  const acceleration_type & get_old_acc(void) const;
  void toggle_current_acc(void);
  // public data members
  static const order_type order_value;
};

Description

Алгоритм скорости-ВерлетаМетод моделирования систем молекулярной динамики. Он решает ODE a=f(r,v',t), где r - координаты, v - скорости и a - ускорения, следовательно v = dr/dt, a=dv/dt.

Template Parameters

  1. typenameCoor

    Тип, обозначающий координаты.

  2. <
    typenameVelocity=Coor
    >

    Тип, обозначающий скорости.

  3. typenameValue=double

    Тип значения.

  4. typenameAcceleration=Coor

    Тип, обозначающий ускорение.

  5. <
    typenameTime=Value
    >

    Время, представляющее независимую переменную — время.

  6. <
    typenameTimeSq=Time
    >

    Время, обозначающее квадрат времени.

  7. <
    typenameAlgebra=typenamealgebra_dispatcher<Coor>::algebra_type
    >

    Алгебра.

  8. <
    typenameOperations=typenameoperations_dispatcher<Coor>::operations_type
    >

    Тип операции.

  9. typenameResizer=initially_resizer

    Тип политики резистора.

velocity_verlet public construct/copy/destruct

  1. <
    velocity_verlet(constalgebra_type&algebra=algebra_type());
    >Построение класса<velocity_verlet>. Этот конструктор можно использовать в качестве конструктора по умолчанию, если в алгебре есть конструктор по умолчанию.

    velocity_verlet public member functions

    1. order_typeorder(void)const;

    Параметры:

    <algebra>

    Сделана и хранится копия алгебры.

    Возвращение:

    Возвращает порядок степпера.

  • template<typenameSystem,typenameStateInOut>
     voiddo_step(Systemsystem,StateInOut&x,time_typet,time_typedt);
    Этот метод выполняет один шаг. Преобразует результат на месте.

    Его можно использовать как

    pair<coordinates,velocities>state;
    stepper.do_step(sys,x,t,dt);
    

    Параметры:

    Размер шага.

    Функция системы решает, следовательно, r.h.s. обычного дифференциального уравнения. Он должен соответствовать концепции системы второго порядка.

    t

    Значение времени, в которое должен быть выполнен шаг.

    x

    Состояние ОДЭ, которое должно быть решено. Государство - пара Кора и Скорости.

  • <
    template<typenameSystem,typenameStateInOut>
     voiddo_step(Systemsystem,constStateInOut&x,time_typet,time_typedt);
    >Этот метод выполняет один шаг. Преобразует результат на месте.

    Его можно использовать как

    <
    pair<coordinates,velocities>state;
    stepper.do_step(sys,x,t,dt);
    
    >

    Параметры:

    Размер шага.

    <dt>

    <system>

    Функция системы решает, следовательно, r.h.s. обычного дифференциального уравнения. Он должен соответствовать концепции системы второго порядка.

    <t>

    Значение времени, в которое должен быть выполнен шаг.

    <x>

    Состояние ОДЭ, которое должно быть решено. Государство - пара Кора и Скорости.

  • template<typenameSystem,typenameCoorIn,typenameVelocityIn,
            typenameAccelerationIn,typenameCoorOut,typenameVelocityOut,
            typenameAccelerationOut>
     voiddo_step(Systemsystem,CoorInconst&qin,VelocityInconst&pin,
                  AccelerationInconst&ain,CoorOut&qout,
                  VelocityOut&pout,AccelerationOut&aout,time_typet,
                  time_typedt);
    Этот метод выполняет один шаг. Преобразует результат на месте. В дополнение к другим методам координаты, скорости и ускорения передаются непосредственно на do_step и преобразуются неуместно.

    Его можно использовать как

    coordinatesqin,qout;
    velocitiespin,pout;
    accelerationsain,aout;
    stepper.do_step(sys,qin,pin,ain,qout,pout,aout,t,dt);
    

    Параметры:

    system

    Функция системы решает, следовательно, r.h.s. обычного дифференциального уравнения. Он должен выполнить концепцию Системы Второго Порядка.

    t

    Значение времени, в которое должен быть выполнен шаг.

  • <
    template<typenameStateIn>voidadjust_size(constStateIn&x);
    >Установите размер всех временных ступеней вручную.

    Параметры:

    <x>

    Выводится состояние, из которого выводится размер временной величины, подлежащей изменению.

  • voidreset(void);
    Перезагружает внутреннее состояние этого степпера. После вызова этого метода безопасно использовать весьdo_stepметод без явного инициализации степпера.
  • template<typenameAccelerationIn>voidinitialize(constAccelerationIn&ain);
    Инициализирует внутреннее состояние степпера.

  • <
    template<typenameSystem,typenameCoorIn,typenameVelocityIn>
     voidinitialize(Systemsystem,constCoorIn&qin,constVelocityIn&pin,
                     time_typet);
    >Инициализирует внутреннее состояние степпера.

    Этот способ эквивалентен

    <
    Accelerationa;
    system(qin,pin,a,t);
    stepper.initialize(a);
    
    >

    Параметры:

    Текущие скорости ОДЭ.

    <qin>

    Текущие координаты ОДЭ.

    <system>

    Функция системы для следующих вызовов<do_step>.

    <t>

    Нынешнее время ОДЭ.

  • <
    boolis_initialized(void)const;
    >

    Возвращение:

    Возвращается, если степпер инициализирован.

  • velocity_verlet private member functions

    1. <
      template<typenameSystem,typenameCoorIn,typenameVelocityIn>
       voidinitialize_acc(Systemsystem,constCoorIn&qin,
                           constVelocityIn&pin,time_typet);
      >
    2. <
      template<typenameSystem,typenameStateInOut>
       voiddo_step_v1(Systemsystem,StateInOut&x,time_typet,time_typedt);
      >
    3. <
      template<typenameStateIn>boolresize_impl(constStateIn&x);
      >
    4. <
      acceleration_type&get_current_acc(void);
      >
    5. <
      constacceleration_type&get_current_acc(void)const;
      >
    6. <
      acceleration_type&get_old_acc(void);
      >
    7. <
      constacceleration_type&get_old_acc(void)const;
      >
    8. <
      voidtoggle_current_acc(void);
      >

    PrevUpHomeNext

    Статья Class template velocity_verlet раздела Chapter 1. Boost.Numeric.Odeint Header <boost/numeric/odeint/stepper/velocity_verlet.hpp> может быть полезна для разработчиков на c++ и boost.




    Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.



    :: Главная :: Header <boost/numeric/odeint/stepper/velocity_verlet.hpp> ::


    реклама


    ©KANSoftWare (разработка программного обеспечения, создание программ, создание интерактивных сайтов), 2007
    Top.Mail.Ru

    Время компиляции файла: 2024-08-30 11:47:00
    2025-05-19 17:52:36/0.031620025634766/1