44 std::vector<Index> dims = options.
get(
".dims").
as<std::vector<Index>>();
45 if (dims.size() != 3) {
46 throw std::runtime_error(
"latticegen: dims needs three numbers");
48 lattice_.dims = {dims[0], dims[1], dims[2]};
63 options.
get(
".energy.disorder").
as<std::string>());
68 lattice_.include_self = options.
get(
".energy.includeself").
as<
bool>();
69 lattice_.seed = options.
get(
".energy.seed").
as<std::uint64_t>();
71 std::vector<std::string> states =
72 options.
get(
".states").
as<std::vector<std::string>>();
74 for (
const std::string& s : states) {
77 throw std::runtime_error(
"latticegen: " + s +
78 " is not a hopping state (e, h, s, t)");
82 lattice_.segment_name = options.
get(
".segmentname").
as<std::string>();
87 log_.setMultithreading(
true);
88 log_.setCommonPreface(
"\n... ...");
91 throw std::runtime_error(
"latticegen: " +
statefile_ +
92 " exists already, remove it or choose another "
101 double mean = std::accumulate(
e.begin(),
e.end(), 0.0) / double(
e.size());
102 double var = std::accumulate(
e.begin(),
e.end(), 0.0,
103 [mean](
double acc,
double x) {
104 return acc + (x - mean) * (x - mean);
110 << top.
NBList().
size() <<
" pairs" << std::flush;
114 <<
" eV" << std::flush;
122 out <<
"# segment id, x, y, z [nm], site energy [eV]\n";
123 out << std::setprecision(12);
124 const std::vector<Eigen::Vector3d>& pos = model.
Positions();
127 out << i <<
" " << p.x() <<
" " << p.y() <<
" " << p.z() <<
" "
131 <<
"Wrote site energies to " <<
energyfile_ << std::flush;
LatticeModel::Options lattice_
void ParseOptions(const tools::Property &options) override
Surrogate lattice model of a hopping system, written as an ordinary XTP topology (segments with one p...
Index NumberOfSites() const
static Disorder DisorderFromString(const std::string &name)
const std::vector< Eigen::Vector3d > & Positions() const
Positions in segment order.
void BuildTopology(Topology &top) const
Fill an empty topology with segments, box and neighbour list.
const std::vector< double > & SiteEnergies() const
Site energies in segment order.
void WriteFrame(const Topology &top)
Container for segments and box and atoms.
#define XTP_LOG(level, log)
Charge transport classes.
Provides a means for comparing floating point numbers.
static Level current_level