39 std::set<std::string> exclude;
43 formatter.
push_back(MonteCarloTFormatter<Canonical>());
44 formatter.
push_back(MonteCarloBetaFormatter<Canonical>());
48 i < mc.
primclex().composition_axes().independent_compositions(); ++i) {
51 formatter.
push_back(MonteCarloCompFormatter<Canonical>(mc, i));
57 for (
int i = 0; i < struc_mol_name.size(); ++i) {
58 name = std::string(
"comp_n(") + struc_mol_name[i] +
")";
59 formatter.
push_back(MonteCarloCompNFormatter<Canonical>(mc, i));
66 name =
"potential_energy";
71 name =
"formation_energy";
79 if (exclude.find(it->first) == exclude.end()) {
86 formatter.
push_back(MonteCarloHeatCapacityFormatter<Canonical>());
108 for (
int i = 0; i < param_composition.size(); i++) {
115 for (
int i = 0; i < components.size(); ++i) {
116 json[
"comp_n"][components[i]] = mol_composition(i);
119 json[
"tolerance"] = conditions.
tolerance();
139 double temp = json[
"temperature"].
get<
double>();
140 double tol = json[
"tolerance"].
get<
double>();
145 if (json[
"comp"].is_array()) {
148 int Nparam =
primclex.composition_axes().independent_compositions();
151 for (
int i = 0; i < Nparam; i++) {
155 }
else if (json.
contains(
"comp_n")) {
158 if (json[
"comp_n"].is_array()) {
161 auto components =
primclex.composition_axes().components();
162 comp_n.resize(components.size());
164 for (
int i = 0; i < components.size(); i++) {
165 comp_n(i) = json[
"comp_n"][components[i]].
get<
double>();
172 throw std::runtime_error(
173 "Error reading conditions: No 'comp' or 'comp_n' specified");
static std::string comp_var(size_type i)
Composition variable names: "a", "b", ...
std::vector< std::string > components() const
The order of components in mol composition vectors.
double temperature() const
Eigen::VectorXd param_composition() const
parametric composition: comp_x
const PrimClex & primclex() const
Eigen::VectorXd mol_composition() const
mol composition: comp_n
const PrimClex & primclex() const
const Access the PrimClex that *this is based on
const SamplerMap & samplers() const
const Access sampler map
PrimClex is the top-level data structure for a CASM project.
static jsonParser object()
Returns an empty json object.
bool contains(const std::string &name) const
Return true if JSON object contains 'name'.
jsonParser & put_obj()
Puts new empty JSON object.
Eigen::VectorXd comp(const Configuration &config)
Returns parametric composition, as calculated using PrimClex::param_comp.
Eigen::VectorXd comp_n(const Configuration &config)
Returns the composition, as number of each species per unit cell.
const CompositionConverter & composition_axes() const
const Access CompositionConverter object
const PrimType & prim() const
const Access to primitive Structure
std::vector< std::string > struc_molecule_name(BasicStructure const &_struc)
Returns an Array of each possible Molecule in this Structure.
T get(Args &&... args) const
Get data from json, using one of several alternatives.
GenericDatumFormatter< double, ConstMonteCarloPtr > MonteCarloPrecFormatter(std::string prop_name)
Print calculated precision of property values: prec(<prop_name>)
void from_json(CanonicalConditions &conditions, const PrimClex &primclex, const jsonParser &json)
Read CanonicalConditions from JSON format.
GenericDatumFormatter< double, ConstMonteCarloPtr > MonteCarloMeanFormatter(std::string prop_name)
Print mean property values: <prop_name>
GenericDatumFormatter< size_type, ConstMonteCarloPtr > MonteCarloNAvgSamplesFormatter()
Print number of samples used in calculating means.
GenericDatumFormatter< bool, ConstMonteCarloPtr > MonteCarloIsConvergedFormatter()
Print if converged.
jsonParser & to_json(const CanonicalConditions &conditions, jsonParser &json)
Store CanonicalConditions in JSON format.
GenericDatumFormatter< bool, ConstMonteCarloPtr > MonteCarloIsEquilibratedFormatter()
Print if equilibrated (not counting explicitly requested equilibration)
GenericDatumFormatter< size_type, ConstMonteCarloPtr > MonteCarloNEquilSamplesFormatter()
Print number of samples used for equilibration (not counting explicitly requested equilibration)
DataFormatter< ConstMonteCarloPtr > make_results_formatter(const Canonical &mc)
Make a LTE results formatter.
GenericDatumFormatter< std::string, DataObject > name()