OSHUN  beta
Arbitrary Order Spherical-Harmonic 1D-3P Vlasov-Fokker-Planck-Maxwell code
Algorithms::LEAPs< T > Class Template Reference

#include <lib-algorithms.h>

Public Member Functions

 LEAPs (T &Yin)
 
T & operator() (T &Y, double h, AbstFunctor< T > *F_space, AbstFunctor< T > *F_momentum)
 
T & operator() (T &Y, double h, AbstFunctor< T > *F_space, AbstFunctor< T > *F_momentum, size_t dir)
 

Private Attributes

Y0
 
Yh
 

Detailed Description

template<class T>
class Algorithms::LEAPs< T >

Definition at line 703 of file lib-algorithms.h.

Constructor & Destructor Documentation

◆ LEAPs()

template<class T >
Algorithms::LEAPs< T >::LEAPs ( T &  Yin)
inline

Definition at line 706 of file lib-algorithms.h.

706 : Y0(Yin), Yh(Yin) { }

Member Function Documentation

◆ operator()() [1/2]

template<class T >
T & Algorithms::LEAPs< T >::operator() ( T &  Y,
double  h,
AbstFunctor< T > *  F_space,
AbstFunctor< T > *  F_momentum 
)

Definition at line 718 of file lib-algorithms.h.

718  {
719 // Take a step using LEAPspace
720 
721 // Initialization
722  Y0 = Y;
723 
724  (*F_space)(Y0,Yh); Yh *= 0.5*h; // x = h * F_space(Y0)
725  Y0 += Yh;
726  (*F_momentum)(Y0,Yh); Yh *= h; // p = h * F_momentum(Y0)
727  Y0 += Yh; // Y0 = Y0 + h*Yh
728  (*F_space)(Y0,Yh); Yh *= 0.5*h; // x = h * F_space(Y0)
729  Y0 += Yh;
730 
731  Y = Y0;
732 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
733 
734  return Y;
735  }

◆ operator()() [2/2]

template<class T >
T & Algorithms::LEAPs< T >::operator() ( T &  Y,
double  h,
AbstFunctor< T > *  F_space,
AbstFunctor< T > *  F_momentum,
size_t  dir 
)

Definition at line 737 of file lib-algorithms.h.

737  {
738 // Take a step using LEAPspace
739 
740 // Initialization
741  Y0 = Y;
742 
743 // First step momentum
744  (*F_space)(Y0,Yh); Yh *= 0.5*h; // x = h * F_space(Y0)
745  Y0 += Yh;
746  (*F_momentum)(Y0,Yh); Yh *= h; // p = h * F_momentum(Y0)
747  Y0 += Yh; // Y0 = Y0 + h*Yh
748  (*F_space)(Y0,Yh); Yh *= 0.5*h; // x = h * F_space(Y0)
749  Y0 += Yh;
750 
751  Y = Y0;
752 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
753 
754  return Y;
755  }

Field Documentation

◆ Y0

template<class T >
T Algorithms::LEAPs< T >::Y0
private

Definition at line 714 of file lib-algorithms.h.

◆ Yh

template<class T >
T Algorithms::LEAPs< T >::Yh
private

Definition at line 714 of file lib-algorithms.h.


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