n2p2 - A neural network potential package
nnp-symfunc.cpp File Reference
#include "SetupAnalysis.h"
#include "utility.h"
#include <cstdlib>
#include <iostream>
#include <fstream>
Include dependency graph for nnp-symfunc.cpp:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 26 of file nnp-symfunc.cpp.

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.
ofstream logFile
Definition: nnp-cutoff.cpp:29

References nnp::Mode::initialize(), nnp::Mode::loadSettingsFile(), nnp::Mode::log, logFile, nnp::Log::registerStreamPointer(), nnp::Mode::setupCutoff(), nnp::Mode::setupElementMap(), nnp::Mode::setupElements(), nnp::Mode::setupSymmetryFunctions(), and nnp::SetupAnalysis::writeSymmetryFunctionShape().

Here is the call graph for this function: