QMCPACK
OneDimNumGridFunctor< T > Struct Template Reference

adaptor class to handle a temporary OneDimCubicSpline on a numerical grid. More...

+ Collaboration diagram for OneDimNumGridFunctor< T >:

Public Types

using GridType = NumericalGrid< T >
 
using FuncType = OneDimCubicSpline< T >
 

Public Member Functions

 OneDimNumGridFunctor ()
 
r (int i) const
 
operator() (int i) const
 
rmax () const
 
rmin () const
 
splint (T r)
 
void put (int npoints, std::istream &fin)
 
bool put (xmlNodePtr cur)
 

Public Attributes

FuncType myFunc
 

Detailed Description

template<class T>
struct qmcplusplus::OneDimNumGridFunctor< T >

adaptor class to handle a temporary OneDimCubicSpline on a numerical grid.

Definition at line 27 of file OneDimNumGridFunctor.h.

Member Typedef Documentation

◆ FuncType

Definition at line 30 of file OneDimNumGridFunctor.h.

◆ GridType

using GridType = NumericalGrid<T>

Definition at line 29 of file OneDimNumGridFunctor.h.

Constructor & Destructor Documentation

◆ OneDimNumGridFunctor()

Definition at line 34 of file OneDimNumGridFunctor.h.

References OneDimCubicSpline< Td, Tg, CTd, CTg >::m_grid, and OneDimNumGridFunctor< T >::myFunc.

34 { myFunc.m_grid = std::make_unique<GridType>(); }
std::unique_ptr< grid_type > m_grid
pointer to the radial grid

Member Function Documentation

◆ operator()()

T operator() ( int  i) const
inline

Definition at line 37 of file OneDimNumGridFunctor.h.

References OneDimNumGridFunctor< T >::myFunc.

37 { return myFunc(i); }

◆ put() [1/2]

void put ( int  npoints,
std::istream &  fin 
)
inline

Definition at line 45 of file OneDimNumGridFunctor.h.

References OneDimCubicSpline< Td, Tg, CTd, CTg >::m_grid, OneDimNumGridFunctor< T >::myFunc, OneDimGridFunctor< Td, Tg, CTd, CTg >::resize(), NumericalGrid< T, CT >::resize(), and OneDimCubicSpline< Td, Tg, CTd, CTg >::spline().

Referenced by ECPotentialBuilder::useSimpleTableFormat().

46  {
47  auto& myGrid = dynamic_cast<GridType&>(*myFunc.m_grid);
48  myGrid.resize(npoints);
49  myFunc.resize(npoints);
50  for (int j = 0; j < npoints; j++)
51  {
52  fin >> myGrid(j) >> myFunc(j);
53  }
54  myGrid.set(myGrid(0), myGrid(npoints - 1), npoints);
55  T yprime_i = (myFunc(1) - myFunc(0)) / (myGrid(1) - myGrid(0));
56  myFunc.spline(0, yprime_i, npoints - 1, 0.0);
57  }
std::unique_ptr< grid_type > m_grid
pointer to the radial grid
void spline(int imin, value_type yp1, int imax, value_type ypn) override
Evaluate the 2nd derivative on the grid points.
GridType
The different types of grids that we currently allow.
Definition: Grid.h:29
void resize(int n)
resize the number of data points

◆ put() [2/2]

bool put ( xmlNodePtr  cur)
inline

Definition at line 59 of file OneDimNumGridFunctor.h.

59 { return true; }

◆ r()

T r ( int  i) const
inline

Definition at line 36 of file OneDimNumGridFunctor.h.

References OneDimCubicSpline< Td, Tg, CTd, CTg >::m_grid, and OneDimNumGridFunctor< T >::myFunc.

Referenced by OneDimNumGridFunctor< T >::splint().

36 { return (*myFunc.m_grid)[i]; }
std::unique_ptr< grid_type > m_grid
pointer to the radial grid

◆ rmax()

T rmax ( ) const
inline

Definition at line 39 of file OneDimNumGridFunctor.h.

References OneDimCubicSpline< Td, Tg, CTd, CTg >::m_grid, and OneDimNumGridFunctor< T >::myFunc.

Referenced by ECPotentialBuilder::useSimpleTableFormat().

39 { return myFunc.m_grid->rmax(); }
std::unique_ptr< grid_type > m_grid
pointer to the radial grid

◆ rmin()

T rmin ( ) const
inline

Definition at line 41 of file OneDimNumGridFunctor.h.

References OneDimCubicSpline< Td, Tg, CTd, CTg >::m_grid, and OneDimNumGridFunctor< T >::myFunc.

41 { return myFunc.m_grid->rmin(); }
std::unique_ptr< grid_type > m_grid
pointer to the radial grid

◆ splint()

Member Data Documentation

◆ myFunc


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