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

#include <lib-algorithms.h>

Public Member Functions

 LEAPv (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::LEAPv< T >

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

Constructor & Destructor Documentation

◆ LEAPv()

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

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

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

Member Function Documentation

◆ operator()() [1/2]

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

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

775  {
776 // Take a step using LEAPmomentum
777 
778 // Initialization
779  Y0 = Y;
780 
781  (*F_momentum)(Y0,Yh); Yh *= 0.5*h; // x = h * F_space(Y0)
782  Y0 += Yh;
783  (*F_space)(Y0,Yh); Yh *= h; // p = h * F_momentum(Y0)
784  Y0 += Yh; // Y0 = Y0 + h*Yh
785  (*F_momentum)(Y0,Yh); Yh *= 0.5*h; // x = h * F_space(Y0)
786  Y0 += Yh;
787 
788  Y = Y0;
789 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
790 
791  return Y;
792  }

◆ operator()() [2/2]

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

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

794  {
795 // Take a step using LEAPmomentum
796 
797 // Initialization
798  Y0 = Y;
799 
800  (*F_momentum)(Y0,Yh); Yh *= 0.5*h; // x = h * F_space(Y0)
801  Y0 += Yh;
802  (*F_space)(Y0,Yh); Yh *= h; // p = h * F_momentum(Y0)
803  Y0 += Yh; // Y0 = Y0 + h*Yh
804  (*F_momentum)(Y0,Yh); Yh *= 0.5*h; // x = h * F_space(Y0)
805  Y0 += Yh;
806 
807  Y = Y0;
808 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
809 
810 
811  return Y;
812  }

Field Documentation

◆ Y0

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

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

◆ Yh

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

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


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