OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
LF2.h
Go to the documentation of this file.
1 //
2 // Class LF2
3 // Second order Leap-Frog time integrator
4 //
5 // Copyright (c) 2008 - 2020, Paul Scherrer Institut, Villigen PSI, Switzerland
6 // All rights reserved
7 //
8 // This file is part of OPAL.
9 //
10 // OPAL is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with OPAL. If not, see <https://www.gnu.org/licenses/>.
17 //
18 #ifndef LF2_H
19 #define LF2_H
20 
21 #include "Stepper.h"
22 #include "Physics/Physics.h"
23 
25 template <typename FieldFunction, typename ... Arguments>
26 class LF2 : public Stepper<FieldFunction, Arguments...> {
27 
28 public:
29 
30  LF2(const FieldFunction& fieldfunc) : Stepper<FieldFunction, Arguments ...>(fieldfunc) { }
31 
32 private:
34  const size_t& i,
35  const double& t,
36  const double dt,
37  Arguments& ... args) const;
38 
39 
40  void push_m(Vector_t& R, const Vector_t& P, const double& h) const;
41 
42  bool kick_m(PartBunchBase<double, 3>* bunch, const size_t& i,
43  const double& t, const double& h,
44  Arguments& ... args) const;
45 };
46 
47 #include "LF2.hpp"
48 
49 #endif
Leap-Frog 2nd order.
Definition: LF2.h:26
LF2(const FieldFunction &fieldfunc)
Definition: LF2.h:30
bool doAdvance_m(PartBunchBase< double, 3 > *bunch, const size_t &i, const double &t, const double dt, Arguments &... args) const
Definition: LF2.hpp:21
bool kick_m(PartBunchBase< double, 3 > *bunch, const size_t &i, const double &t, const double &h, Arguments &... args) const
Definition: LF2.hpp:53
void push_m(Vector_t &R, const Vector_t &P, const double &h) const
Definition: LF2.hpp:42