QMCPACK
Grid.h File Reference
+ Include dependency graph for Grid.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Grid
 Parent class for all grids. More...
 
class  LinearGrid
 Linear Grid inherets from Grid. More...
 
class  GeneralGrid
 General Grid inherets from Grid. More...
 
class  OptimalGrid
 The OptimalGrid class stores a grid which has linear spacing at the origin and exponential spacing further out. More...
 
class  OptimalGrid2
 The OptimalGrid class stores a grid which has linear spacing at the origin and exponential spacing further out. More...
 
class  CenterGrid
 
class  LogGrid
 LogGrid is a function whose gridpoints increase exponentially with the index. More...
 
class  ClusterGrid
 ClusterGrid is a function whose gridpoints are clustered tightly around the origin. More...
 

Enumerations

enum  GridType {
  NONE, LINEAR, OPTIMAL, OPTIMAL2,
  LOG, CLUSTER, GENERAL, CENTER
}
 The different types of grids that we currently allow. More...
 

Functions

std::shared_ptr< GridReadGrid (IOSectionClass &inSection)
 

Enumeration Type Documentation

◆ GridType

enum GridType

The different types of grids that we currently allow.

Enumerator
NONE 
LINEAR 
OPTIMAL 
OPTIMAL2 
LOG 
CLUSTER 
GENERAL 
CENTER 

Definition at line 29 of file Grid.h.

30 {
31  NONE,
32  LINEAR,
33  OPTIMAL,
34  OPTIMAL2,
35  LOG,
36  CLUSTER,
37  GENERAL,
38  CENTER
39 } GridType;
Definition: Grid.h:35
Definition: Grid.h:37
Definition: Grid.h:32
Definition: Grid.h:33
GridType
The different types of grids that we currently allow.
Definition: Grid.h:29
Definition: Grid.h:31
Definition: Grid.h:38
Definition: Grid.h:34
Definition: Grid.h:36

Function Documentation

◆ ReadGrid()

std::shared_ptr<Grid> ReadGrid ( IOSectionClass inSection)
inline

Definition at line 633 of file Grid.h.

References IOSectionClass::ReadVar().

Referenced by CubicSplineCommon::Read().

634 {
635  std::string Type;
636  assert(inSection.ReadVar("Type", Type));
637 
638  std::shared_ptr<Grid> newGrid;
639  if (Type == "Linear")
640  newGrid = std::make_shared<LinearGrid>();
641  else if (Type == "General")
642  newGrid = std::make_shared<GeneralGrid>();
643  else if (Type == "Optimal")
644  newGrid = std::make_shared<OptimalGrid>();
645  else if (Type == "Optimal2")
646  newGrid = std::make_shared<OptimalGrid2>();
647  else if (Type == "Log")
648  newGrid = std::make_shared<LogGrid>();
649  else if (Type == "Cluster")
650  newGrid = std::make_shared<ClusterGrid>();
651  else
652  {
653  std::cerr << "Unrecognized Grid type " << Type << "\n";
654  exit(1);
655  }
656  newGrid->Read(inSection);
657  return newGrid;
658 }
bool ReadVar(std::string name, T &var)
Template function which reads a variable in the present section into the passed-by-reference T variab...
Definition: IO.h:168