From 32d9fc0d544cc28d9fbe604d2ed01365196f8aa0 Mon Sep 17 00:00:00 2001 From: mkirsz <s1351949@sms.ed.ac.uk> Date: Thu, 6 Mar 2025 11:32:05 +0000 Subject: [PATCH] Integration of --sources into sreader and preditct --- include/tadah/mlip/structure.h | 20 ++++++++++++++------ src/nn_finder.cpp | 6 +++--- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/include/tadah/mlip/structure.h b/include/tadah/mlip/structure.h index 9ab8d6a..9481314 100644 --- a/include/tadah/mlip/structure.h +++ b/include/tadah/mlip/structure.h @@ -235,15 +235,23 @@ struct Structure { { os << "Structure : " << std::left << st.label << std::endl; os << "Weights : " << std::left - << "E: "<< st.eweight + << "E: " << st.eweight << " | F: " << std::left << st.fweight << " | S: " << std::left << st.sweight << std::endl; - os << "# atoms : " << std::left << st.atoms.size() << std::endl; + os << "Atoms : " << std::left << st.atoms.size() << " | "; + for (const auto &el: st.get_unique_elements()) { os << " " << el.symbol << std::left; } + os << std::endl; os << "Energy :" << std::right << std::setw(w) - << std::setprecision(p) << std::fixed << st.energy << std::endl; + << std::setprecision(p) << std::fixed << st.energy << " " + << "Temp :" << std::right << std::setw(w) + << std::setprecision(p) << std::fixed << st.get_temperature() << std::endl; + os << "Volume :" << std::right << std::setw(w) + << std::setprecision(p) << std::fixed << st.get_volume() << " " + << "Density:" << std::right << std::setw(w) + << std::setprecision(p) << std::fixed << st.get_density() << std::endl; os << "Cell :" << std::endl; for (int i=0; i<3; ++i) { - os << std::right << std::fixed << std::setw(w+10) + os << std::right << std::fixed << std::setw(w+12) << std::setprecision(p) << st.cell(i,0); os << std::right << std::fixed << std::setw(w) << std::setprecision(p) << st.cell(i,1); @@ -253,7 +261,7 @@ struct Structure { } os << "Stress :" << std::endl; for (int i=0; i<3; ++i) { - os << std::right << std::fixed << std::setw(w+10) + os << std::right << std::fixed << std::setw(w+12) << std::setprecision(p) << st.stress(i,0); os << std::right << std::fixed << std::setw(w) << std::setprecision(p) << st.stress(i,1); @@ -309,7 +317,7 @@ struct Structure { std::set<Element> get_unique_elements() const; private: - const static size_t w=15; // controls output width + const static size_t w=13; // controls output width const static size_t p=6; // controls output precision diff --git a/src/nn_finder.cpp b/src/nn_finder.cpp index 651077f..0c85f81 100644 --- a/src/nn_finder.cpp +++ b/src/nn_finder.cpp @@ -271,15 +271,15 @@ void NNFinder::calc(Structure &st) // Parallel loop over structure database void NNFinder::calc(StructureDB &stdb) { - auto t0 = std::chrono::steady_clock::now(); + // auto t0 = std::chrono::steady_clock::now(); #ifdef _OPENMP #pragma omp parallel for #endif for(size_t i = 0; i < stdb.size(); i++){ calc(stdb(i)); } - auto t1 = std::chrono::steady_clock::now(); - double seconds = std::chrono::duration<double>(t1 - t0).count(); + // auto t1 = std::chrono::steady_clock::now(); + // double seconds = std::chrono::duration<double>(t1 - t0).count(); // std::cout << "calc(StructureDB &stdb) for-loop took " // << seconds << " seconds\n"; } -- GitLab