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

specialization for linear grid with PBC More...

+ Collaboration diagram for CubicBsplineGrid< T, LINEAR_1DGRID, PBC_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 >
 

Public Member Functions

 CubicBsplineGrid ()
 
bool getGridPoint (point_type x, int &i)
 
void spline (point_type start, point_type end, const container_type &data, container_type &p, bool closed)
 

Public Attributes

int i0
 
int i1
 
int i2
 
int i3
 
point_type GridStart
 
point_type GridEnd
 
point_type GridDelta
 
point_type GridDeltaInv
 
point_type GridDeltaInv2
 
point_type L
 
point_type Linv
 
point_type curPoint
 
point_type tp [4]
 

Detailed Description

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

specialization for linear grid with PBC

Definition at line 33 of file CubicBsplineGrid.h.

Member Typedef Documentation

◆ container_type

using container_type = std::vector<T>

Definition at line 37 of file CubicBsplineGrid.h.

◆ point_type

using point_type = typename GridTraits<T>::point_type

Definition at line 35 of file CubicBsplineGrid.h.

◆ value_type

using value_type = typename GridTraits<T>::value_type

Definition at line 36 of file CubicBsplineGrid.h.

Constructor & Destructor Documentation

◆ CubicBsplineGrid()

CubicBsplineGrid ( )
inline

Definition at line 43 of file CubicBsplineGrid.h.

Member Function Documentation

◆ getGridPoint()

bool getGridPoint ( point_type  x,
int &  i 
)
inline

Definition at line 45 of file CubicBsplineGrid.h.

References qmcplusplus::floor().

46  {
47  //point_type delta = x - GridStart;
48  //delta -= std::floor(delta*Linv)*L;
49  //point_type ipart;
50  //point_type t = modf (delta*GridDeltaInv, &ipart);
51  //int i = (int) ipart;
52  point_type delta = x - GridStart;
53  delta -= std::floor(delta * Linv) * L;
54  i = static_cast<int>(delta * GridDeltaInv);
55  point_type t = delta * GridDeltaInv - i;
56  tp[0] = t * t * t;
57  tp[1] = t * t;
58  tp[2] = t;
59  tp[3] = 1.0;
60  return true;
61  }
typename GridTraits< T >::point_type point_type
MakeReturn< UnaryNode< FnFloor, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t floor(const Vector< T1, C1 > &l)

◆ spline()

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

Definition at line 63 of file CubicBsplineGrid.h.

References qmcplusplus::Units::force::N.

64  {
65  GridStart = start;
66  GridEnd = end;
67  int N = data.size();
68  if (closed)
69  N--;
70  p.resize(N + 3);
71  L = end - start;
72  Linv = 1.0 / L;
73  GridDelta = L / static_cast<T>(N);
74  GridDeltaInv = 1.0 / GridDelta;
77  p[0] = p[N];
78  p[N + 1] = p[1];
79  p[N + 2] = p[2];
80  }
dummy declaration to be specialized

Member Data Documentation

◆ curPoint

point_type curPoint

Definition at line 40 of file CubicBsplineGrid.h.

◆ GridDelta

point_type GridDelta

Definition at line 39 of file CubicBsplineGrid.h.

◆ GridDeltaInv

point_type GridDeltaInv

Definition at line 39 of file CubicBsplineGrid.h.

◆ GridDeltaInv2

point_type GridDeltaInv2

Definition at line 39 of file CubicBsplineGrid.h.

◆ GridEnd

point_type GridEnd

Definition at line 39 of file CubicBsplineGrid.h.

◆ GridStart

point_type GridStart

Definition at line 39 of file CubicBsplineGrid.h.

◆ i0

int i0

Definition at line 38 of file CubicBsplineGrid.h.

◆ i1

int i1

Definition at line 38 of file CubicBsplineGrid.h.

◆ i2

int i2

Definition at line 38 of file CubicBsplineGrid.h.

◆ i3

int i3

Definition at line 38 of file CubicBsplineGrid.h.

◆ L

Definition at line 39 of file CubicBsplineGrid.h.

◆ Linv

point_type Linv

Definition at line 39 of file CubicBsplineGrid.h.

◆ tp

point_type tp[4]

Definition at line 41 of file CubicBsplineGrid.h.


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