OSHUN  beta
Arbitrary Order Spherical-Harmonic 1D-3P Vlasov-Fokker-Planck-Maxwell code
Output_Data::PLegendre1D Class Reference

#include <export.h>

Public Member Functions

 PLegendre1D (size_t Nl, size_t Nm, size_t Np, float pmin, float pmax, size_t Npx)
 
 PLegendre1D (const PLegendre1D &other)
 
 ~PLegendre1D ()
 
size_t dim () const
 
Array2D< float > & operator() (size_t i)
 
Array2D< float > operator() (size_t i) const
 

Private Attributes

vector< Array2D< float > > * plegendre
 
size_t lmax
 

Detailed Description

Definition at line 241 of file export.h.

Constructor & Destructor Documentation

◆ PLegendre1D() [1/2]

Output_Data::PLegendre1D::PLegendre1D ( size_t  Nl,
size_t  Nm,
size_t  Np,
float  pmin,
float  pmax,
size_t  Npx 
)

Definition at line 816 of file export.cpp.

References Algorithms::Legendre(), and Algorithms::MakeAxis().

817  {
818 
819  size_t sz(0);
820 
821  valarray<float> p( Algorithms::MakeAxis(pmin, pmax, Np)),
822  px(Algorithms::MakeAxis(float(-1.0)*pmax, pmax, Npx));
823 
824 // Generate the structure to save the polynomials
825  sz = ((Nm+1)*(2*Nl-Nm+2))/2;
826 //
827  plegendre = new vector< Array2D<float>>(sz,Array2D<float>(Npx,Np)) ;
828  // for (size_t m(0); m < Nm+1; ++m) {
829  // for (size_t l(m); l < Nl+1; ++l) {
830  // (*plegendre).push_back( Array2D<float>(Npx,Np) );
831  // ++sz;
832  // }
833  // }
834  size_t k(0);
835 // Generate the polynomial values for each cos(theta) = px/p
836  for (size_t j(0); j < p.size(); ++j) {
837  float invp(1.0/p[j]);
838  for (size_t i(0); i < px.size(); ++i) {
839 
840 // For given px/p generate all the polynomial values ...
841 // valarray<float> vL( Algorithms::Legendre( px[i]*invp, Nl, Nm ) );
842  Array2D<float> vL( Algorithms::Legendre( px[i]*invp, Nl, Nm ) );
843  // std::cout << "\n x = " << px[i]*invp << ", sqrt(1-x^2) = " << sqrt(1.0-px[i]*invp*px[i]*invp) ;
844 // ... and save them
845  // std::cout << "dim = " << vL.dim() << "\n";
846  // std::cout << "dim1:" << vL.dim1() << "\n";
847  // std::cout << "dim2:" << vL.dim1() << "\n\n";
848  for (size_t l(0); l < Nl+1; ++l){
849  for (size_t m=0; m<((Nm<l)?Nm:l)+1; ++m){
850  // for (size_t k(0); k < sz; ++k) {
851  k = ((l < Nm+1)?((l*(l+1))/2+m):(l*(Nm+1)-(Nm*(Nm+1))/2 + m));
852 
853  (*plegendre)[k](i,j) = vL(l,m);
854 
855  std::cout << "\n LP(" << l << "," << m << "," << k << ") = " << vL(l,m);
856 
857  }
858  // (*plegendre)[k](i,j) = vL(k);
859  }
860 
861  // exit(1);
862  }
863  }
864 
865 }
valarray< T > Legendre(const T x, const size_t Nl)
vector< Array2D< float > > * plegendre
Definition: export.h:255
valarray< T > MakeAxis(const T min, const T max, const size_t N)
Here is the call graph for this function:

◆ PLegendre1D() [2/2]

Output_Data::PLegendre1D::PLegendre1D ( const PLegendre1D other)

Definition at line 868 of file export.cpp.

References dim().

868  {
869 
870 // Generate the structure to save the polynomials
871  plegendre = new vector< Array2D<float> > ;
872  for (size_t i(0); i < other.dim(); ++i) {
873  (*plegendre).push_back( other(i) );
874  }
875 }
vector< Array2D< float > > * plegendre
Definition: export.h:255
Here is the call graph for this function:

◆ ~PLegendre1D()

Output_Data::PLegendre1D::~PLegendre1D ( )

Definition at line 878 of file export.cpp.

878  {
879  delete plegendre;
880 }
vector< Array2D< float > > * plegendre
Definition: export.h:255

Member Function Documentation

◆ dim()

size_t Output_Data::PLegendre1D::dim ( ) const
inline

Definition at line 250 of file export.h.

Referenced by PLegendre1D().

250 { return (*plegendre).size(); }
Here is the caller graph for this function:

◆ operator()() [1/2]

Array2D<float>& Output_Data::PLegendre1D::operator() ( size_t  i)
inline

Definition at line 251 of file export.h.

251 { return (*plegendre)[i]; }
vector< Array2D< float > > * plegendre
Definition: export.h:255

◆ operator()() [2/2]

Array2D<float> Output_Data::PLegendre1D::operator() ( size_t  i) const
inline

Definition at line 252 of file export.h.

252 { return (*plegendre)[i]; }
vector< Array2D< float > > * plegendre
Definition: export.h:255

Field Documentation

◆ lmax

size_t Output_Data::PLegendre1D::lmax
private

Definition at line 256 of file export.h.

◆ plegendre

vector< Array2D<float> >* Output_Data::PLegendre1D::plegendre
private

Definition at line 255 of file export.h.


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