1#ifndef MODEL_INTERFACE_GB_READ_H
2#define MODEL_INTERFACE_GB_READ_H
26 static constexpr const char*
name =
"read";
52 std::vector<Set::Scalar> theta, thetasmall, w, dw, ddw;
53 while(std::getline(input,line))
56 theta.push_back(std::stof(dat[0]));
57 w.push_back(std::stof(dat[1]));
59 for (
unsigned int i = 1; i < theta.size()-1; i++)
61 thetasmall.push_back(theta[i]);
62 dw.push_back((w[i+1] - w[i-1]) / (theta[i+1] - theta[i-1]));
63 ddw.push_back((w[i+1] - 2.0*w[i] + w[i-1]) / ((theta[i+1]-theta[i]) * (theta[i]-theta[i-1])));
72 if (std::isnan(w) || std::isnan(dw) || std::isnan(ddw) ||
73 std::isinf(w) || std::isinf(dw) || std::isinf(ddw))
#define pp_query_file(...)
#define pp_queryclass(...)
Reads the data from a file and computes energies and its derivates.
static void Parse(Read &value, IO::ParmParse &pp)
Numeric::Interpolator::Linear< Set::Scalar > m_w
Numeric::Interpolator::Linear< Set::Scalar > m_dw
Read(IO::ParmParse &pp, std::string name)
Set::Scalar DDW(const Set::Scalar theta) const
static constexpr const char * name
Read(std::string filename)
void Define(std::string filename)
Set::Scalar DW(const Set::Scalar theta) const
Numeric::Interpolator::Linear< Set::Scalar > m_ddw
Set::Scalar W(const Set::Scalar theta) const
void define(const std::string a_str)
static Linear< T > Read(std::string filename, int derivative=0)
static const Set::Scalar Pi
std::vector< std::string > Split(std::string &str, const char delim)
void Abort(const char *msg)