PSCF v1.2
pscf_pc.cpp
1/*
2* PSCF - Polymer Self-Consistent Field Theory
3*
4* Copyright 2016 - 2022, The Regents of the University of Minnesota
5* Distributed under the terms of the GNU General Public License.
6*/
7
8#include <prdc/crystal/getDimension.h>
9#include <rpc/System.h>
10
11#include <iostream>
12
13namespace Pscf {
14namespace Rpc {
15
23 template <int D>
24 void run(int argc, char **argv) {
25 System<D> system;
26
27 // Process command line options
28 system.setOptions(argc, argv);
29
30 // Read parameters from default parameter file
31 system.readParam();
32
33 // Read command script to run system
34 system.readCommands();
35 }
36
37}
38}
39
47int main(int argc, char **argv)
48{
49
50 // Extract the dimension of space from argument of -d option
51 int D = Pscf::Prdc::getDimension(argc, argv);
52 std::cout << "dimension " << D << std::endl;
53
54 if (1 == D) {
55 Pscf::Rpc::run<1>(argc, argv);
56 } else
57 if (2 == D) {
58 Pscf::Rpc::run<2>(argc, argv);
59 } else
60 if (3 == D) {
61 Pscf::Rpc::run<3>(argc, argv);
62 } else {
63 std::cout << " Invalid dimension = " << D << std::endl;
64 }
65
66 fftw_cleanup();
67}
Main class for SCFT or PS-FTS simulation of one system.
Definition rpc/System.h:100
void setOptions(int argc, char **argv)
Process command line options.
void readCommands(std::istream &in)
Read and process commands from an input stream.
virtual void readParam(std::istream &in)
Read input parameters (with opening and closing lines).
int main(int argc, char **argv)
Main function for pscf_1d program.
Definition pscf_1d.cpp:19
void run(int argc, char **argv)
Function template for main pscf_pc program.
Definition pscf_pc.cpp:24
PSCF package top-level namespace.
Definition param_pc.dox:1