QMCPACK
CubicBsplineGrid< T, LINEAR_1DGRID, FIRSTDERIV_CONSTRAINTS > Struct Template Reference

specialization for linear grid with PBC More...

+ Collaboration diagram for CubicBsplineGrid< T, LINEAR_1DGRID, FIRSTDERIV_CONSTRAINTS >:

Public Types

using point_type = typename GridTraits< T >::point_type
 
using value_type = typename GridTraits< T >::value_type
 
using container_type = std::vector< T >
 
using size_t = std::size_t
 

Public Member Functions

 CubicBsplineGrid ()
 
bool getGridPoint (point_type x, int &i)
 
void setGrid (point_type start, point_type end, size_t n)
 set linear grid More...
 
void spline (point_type start, point_type end, const container_type &data, container_type &p, bool closed)
 
void spline (point_type start, point_type end, value_type startDeriv, value_type endDeriv, const container_type &data, container_type &p)
 

Public Attributes

int Npts
 number of points More...
 
point_type GridStart
 
point_type GridEnd
 
point_type GridDelta
 
point_type GridDeltaInv
 
point_type GridDeltaInv2
 
point_type L
 
point_type Linv
 
point_type tp [4]
 

Detailed Description

template<class T>
struct CubicBsplineGrid< T, LINEAR_1DGRID, FIRSTDERIV_CONSTRAINTS >

specialization for linear grid with PBC

Definition at line 85 of file CubicBsplineGrid.h.

Member Typedef Documentation

◆ container_type

using container_type = std::vector<T>

Definition at line 89 of file CubicBsplineGrid.h.

◆ point_type

using point_type = typename GridTraits<T>::point_type

Definition at line 87 of file CubicBsplineGrid.h.

◆ size_t

using size_t = std::size_t

Definition at line 90 of file CubicBsplineGrid.h.

◆ value_type

using value_type = typename GridTraits<T>::value_type

Definition at line 88 of file CubicBsplineGrid.h.

Constructor & Destructor Documentation

◆ CubicBsplineGrid()

CubicBsplineGrid ( )
inline

Definition at line 96 of file CubicBsplineGrid.h.

96 {}

Member Function Documentation

◆ getGridPoint()

bool getGridPoint ( point_type  x,
int &  i 
)
inline

Definition at line 98 of file CubicBsplineGrid.h.

References qmcplusplus::floor().

99  {
100  if (x < GridStart || x > GridEnd)
101  return false;
102  point_type delta = x - GridStart;
103  delta -= std::floor(delta * Linv) * L;
104  i = static_cast<int>(delta * GridDeltaInv);
105  point_type t = delta * GridDeltaInv - i;
106  tp[0] = t * t * t;
107  tp[1] = t * t;
108  tp[2] = t;
109  tp[3] = 1.0;
110  return true;
111  }
MakeReturn< UnaryNode< FnFloor, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t floor(const Vector< T1, C1 > &l)

◆ setGrid()

void setGrid ( point_type  start,
point_type  end,
size_t  n 
)
inline

set linear grid

Parameters
startstarting grid
endending grid
nsize of data

Definition at line 118 of file CubicBsplineGrid.h.

References qmcplusplus::n.

◆ spline() [1/2]

void spline ( point_type  start,
point_type  end,
const container_type data,
container_type p,
bool  closed 
)
inline

Definition at line 130 of file CubicBsplineGrid.h.

131  {
132  setGrid(start, end, data.size());
133  p.resize(Npts + 2);
134  point_type bcLower[] = {-3.0, 0.0, 3.0, 0.0};
135  point_type bcUpper[] = {-3.0, 0.0, 3.0, 0.0};
136  bcLower[3] = data[1] - data[0];
137  bcUpper[3] = data[Npts - 1] - data[Npts - 2];
138  SolveFirstDerivInterp1D<point_type>::apply(data, p, Npts, bcLower, bcUpper);
139  }
void setGrid(point_type start, point_type end, size_t n)
set linear grid

◆ spline() [2/2]

void spline ( point_type  start,
point_type  end,
value_type  startDeriv,
value_type  endDeriv,
const container_type data,
container_type p 
)
inline

Definition at line 141 of file CubicBsplineGrid.h.

147  {
148  setGrid(start, end, data.size());
149  p.resize(Npts + 2);
150  point_type bcLower[] = {-3.0, 0.0, 3.0, 0.0};
151  point_type bcUpper[] = {-3.0, 0.0, 3.0, 0.0};
152  bcLower[3] = startDeriv * GridDelta;
153  bcUpper[3] = endDeriv * GridDelta;
154  SolveFirstDerivInterp1D<point_type>::apply(data, p, Npts, bcLower, bcUpper);
155  }
void setGrid(point_type start, point_type end, size_t n)
set linear grid

Member Data Documentation

◆ GridDelta

point_type GridDelta

Definition at line 93 of file CubicBsplineGrid.h.

◆ GridDeltaInv

point_type GridDeltaInv

Definition at line 93 of file CubicBsplineGrid.h.

◆ GridDeltaInv2

point_type GridDeltaInv2

Definition at line 93 of file CubicBsplineGrid.h.

◆ GridEnd

point_type GridEnd

Definition at line 93 of file CubicBsplineGrid.h.

◆ GridStart

point_type GridStart

Definition at line 93 of file CubicBsplineGrid.h.

◆ L

Definition at line 93 of file CubicBsplineGrid.h.

◆ Linv

point_type Linv

Definition at line 93 of file CubicBsplineGrid.h.

◆ Npts

int Npts

number of points

Definition at line 92 of file CubicBsplineGrid.h.

◆ tp

point_type tp[4]

Definition at line 94 of file CubicBsplineGrid.h.


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