OSHUN  beta
Arbitrary Order Spherical-Harmonic 1D-3P Vlasov-Fokker-Planck-Maxwell code
formulary.h File Reference

Plasma Formulary and Units - Declarations. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  units
 
class  Formulary
 

Functions

template<class T >
valarray< T > Gaussian (const size_t N, const T vmin, const T vmax, const T vth)
 
Formularyformulary ()
 

Detailed Description

Plasma Formulary and Units - Declarations.

Author
PICKSC
Date
September 1, 2016

Declarations for data structures that are related to simple physics concepts: 1) units: a concrete class that combines a label and a numerical value 2) Formulary: A class that enables conversion of units and implements expression from the NRL plasma formulary.

Definition in file formulary.h.

Function Documentation

◆ formulary()

Formulary& formulary ( )

Definition at line 328 of file formulary.cpp.

Referenced by Export_Files::Xport::Export_h5(), and Export_Files::Xport::Xport().

328  {
329  static Formulary f;
330  return f;
331 }
Here is the caller graph for this function:

◆ Gaussian()

template<class T >
valarray<T> Gaussian ( const size_t  N,
const T  vmin,
const T  vmax,
const T  vth 
)

Definition at line 25 of file formulary.h.

25  {
26 
27 // Make axis first
28  valarray<T> G(N);
29  for (size_t i(0); i < N; ++i) {
30  G[i] = static_cast<T>(i);
31  }
32  G *= (vmax-vmin)/(static_cast<T>(N-1));
33  G += vmin;
34 
35 // Make Gaussian
36  T C(pow( 1.0/ (sqrt(2.0*M_PI)*vth), 3));
37  T al( (-0.5) / (vth*vth));
38  for (size_t i(0); i < N; ++i) {
39  G[i] = exp( al * G[i]*G[i] );
40  }
41  G *= C;
42 
43  return G;
44 }