n2p2 - A neural network potential package
nnp-symfunc.cpp
Go to the documentation of this file.
1// n2p2 - A neural network potential package
2// Copyright (C) 2018 Andreas Singraber (University of Vienna)
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <https://www.gnu.org/licenses/>.
16
17#include "SetupAnalysis.h"
18#include "utility.h"
19#include <cstdlib>
20#include <iostream>
21#include <fstream>
22
23using namespace std;
24using namespace nnp;
25
26int main(int argc, char* argv[])
27{
28 size_t numPoints = 0;
29 ofstream logFile;
30
31 if (argc != 2)
32 {
33 cout << "USAGE: " << argv[0] << " <npoints>\n"
34 " <npoints> ... Number of data points in symmetry"
35 " function files.\n"
36 " Execute in directory with these NNP files present:\n"
37 << " - input.nn (NNP settings)\n";
38 return 1;
39 }
40
41 numPoints = atof(argv[1]);
42
43 logFile.open("nnp-symfunc.log");
44 SetupAnalysis setupAnalysis;
45 setupAnalysis.log.registerStreamPointer(&logFile);
46
47 setupAnalysis.initialize();
48 setupAnalysis.loadSettingsFile();
49 setupAnalysis.setupElementMap();
50 setupAnalysis.setupElements();
51 setupAnalysis.setupCutoff();
52 setupAnalysis.setupSymmetryFunctions();
53
54 setupAnalysis.writeSymmetryFunctionShape(numPoints);
55
56 logFile.close();
57
58 return 0;
59}
void registerStreamPointer(std::ofstream *const &streamPointer)
Register new C++ ofstream pointer.
Definition: Log.cpp:91
void initialize()
Write welcome message with version information.
Definition: Mode.cpp:55
virtual void setupElementMap()
Set up the element map.
Definition: Mode.cpp:301
Log log
Global log file.
Definition: Mode.h:593
virtual void setupSymmetryFunctions()
Set up all symmetry functions.
Definition: Mode.cpp:615
void setupCutoff()
Set up cutoff function for all symmetry functions.
Definition: Mode.cpp:520
void loadSettingsFile(std::string const &fileName="input.nn")
Open settings file and load all keywords into memory.
Definition: Mode.cpp:161
virtual void setupElements()
Set up all Element instances.
Definition: Mode.cpp:322
void writeSymmetryFunctionShape(std::size_t numPoints, std::string const fileNameFormat="sf.%03zu.%04zu.out")
Write radial and angular part of symmetry functions to file.
Definition: Atom.h:29
ofstream logFile
Definition: nnp-cutoff.cpp:29
int main(int argc, char *argv[])
Definition: nnp-symfunc.cpp:26