23 std::unique_ptr<GridType> agrid;
29 std::string gridType(
"log");
30 std::string gridID(
"invalid");
32 radAttrib.
add(gridType,
"type");
33 radAttrib.
add(npts,
"npts");
34 radAttrib.
add(ri,
"ri");
35 radAttrib.
add(rf,
"rf");
36 radAttrib.
add(ascale,
"ascale");
37 radAttrib.
add(astep,
"astep");
38 radAttrib.
add(ascale,
"scale");
39 radAttrib.
add(astep,
"step");
40 radAttrib.
add(gridID,
"id");
41 radAttrib.
add(gridID,
"name");
42 radAttrib.
add(gridID,
"ref");
45 if (gridType ==
"log")
49 LOGMSG(
"Using log grid with default values: scale = " << ascale <<
" step = " << astep <<
" npts = " << npts)
50 agrid = std::make_unique<LogGridZero<RealType>>();
51 agrid->set(astep, ascale, npts);
55 LOGMSG(
"Using log grid with default values: ri = " << ri <<
" rf = " << rf <<
" npts = " << npts)
56 if (ri < std::numeric_limits<RealType>::epsilon())
58 ri = std::numeric_limits<RealType>::epsilon();
59 app_error() <<
" LogGrid cannot accept r=0 for the initial point. Using ri=" << ri << std::endl;
61 agrid = std::make_unique<LogGrid<RealType>>();
62 agrid->set(ri, rf, npts);
65 else if (gridType ==
"linear")
67 LOGMSG(
"Using linear grid with default values: ri = " << ri <<
" rf = " << rf <<
" npts = " << npts)
68 agrid = std::make_unique<LinearGrid<RealType>>();
69 agrid->set(ri, rf, npts);
helper functions for EinsplineSetBuilder
QTBase::RealType RealType
static std::unique_ptr< GridType > createGrid(xmlNodePtr cur)
return a GridType*
bool put(xmlNodePtr cur)
assign attributes to the set
std::ostream & app_error()
class to handle a set of attributes of an xmlNode
This a subclass for runtime errors that will occur on all ranks.
OHMMS_INDEXTYPE IndexType
define other types
void add(PDT &aparam, const std::string &aname, std::vector< PDT > candidate_values={}, TagStatus status=TagStatus::OPTIONAL)
add a new attribute