Skip to content
Snippets Groups Projects
Commit 32d9fc0d authored by mkirsz's avatar mkirsz
Browse files

Integration of --sources into sreader and preditct

parent eb9e4e36
No related branches found
No related tags found
No related merge requests found
Pipeline #52446 passed
...@@ -235,15 +235,23 @@ struct Structure { ...@@ -235,15 +235,23 @@ struct Structure {
{ {
os << "Structure : " << std::left << st.label << std::endl; os << "Structure : " << std::left << st.label << std::endl;
os << "Weights : " << std::left os << "Weights : " << std::left
<< "E: "<< st.eweight << "E: " << st.eweight
<< " | F: " << std::left << st.fweight << " | F: " << std::left << st.fweight
<< " | S: " << std::left << st.sweight << std::endl; << " | 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) 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; os << "Cell :" << std::endl;
for (int i=0; i<3; ++i) { 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); << std::setprecision(p) << st.cell(i,0);
os << std::right << std::fixed << std::setw(w) os << std::right << std::fixed << std::setw(w)
<< std::setprecision(p) << st.cell(i,1); << std::setprecision(p) << st.cell(i,1);
...@@ -253,7 +261,7 @@ struct Structure { ...@@ -253,7 +261,7 @@ struct Structure {
} }
os << "Stress :" << std::endl; os << "Stress :" << std::endl;
for (int i=0; i<3; ++i) { 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); << std::setprecision(p) << st.stress(i,0);
os << std::right << std::fixed << std::setw(w) os << std::right << std::fixed << std::setw(w)
<< std::setprecision(p) << st.stress(i,1); << std::setprecision(p) << st.stress(i,1);
...@@ -309,7 +317,7 @@ struct Structure { ...@@ -309,7 +317,7 @@ struct Structure {
std::set<Element> get_unique_elements() const; std::set<Element> get_unique_elements() const;
private: 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 const static size_t p=6; // controls output precision
......
...@@ -271,15 +271,15 @@ void NNFinder::calc(Structure &st) ...@@ -271,15 +271,15 @@ void NNFinder::calc(Structure &st)
// Parallel loop over structure database // Parallel loop over structure database
void NNFinder::calc(StructureDB &stdb) void NNFinder::calc(StructureDB &stdb)
{ {
auto t0 = std::chrono::steady_clock::now(); // auto t0 = std::chrono::steady_clock::now();
#ifdef _OPENMP #ifdef _OPENMP
#pragma omp parallel for #pragma omp parallel for
#endif #endif
for(size_t i = 0; i < stdb.size(); i++){ for(size_t i = 0; i < stdb.size(); i++){
calc(stdb(i)); calc(stdb(i));
} }
auto t1 = std::chrono::steady_clock::now(); // auto t1 = std::chrono::steady_clock::now();
double seconds = std::chrono::duration<double>(t1 - t0).count(); // double seconds = std::chrono::duration<double>(t1 - t0).count();
// std::cout << "calc(StructureDB &stdb) for-loop took " // std::cout << "calc(StructureDB &stdb) for-loop took "
// << seconds << " seconds\n"; // << seconds << " seconds\n";
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment