PSCF v1.3
pscf_pg.cu
1/*
2* PSCF - Polymer Self-Consistent Field
3*
4* Copyright 2015 - 2025, 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 <rpg/system/System.h>
10#include <iostream>
11
12namespace Pscf {
13namespace Rpg {
14
23 template <int D>
24 void run(int argc, char **argv) {
25
26 // Construct System object for specific dimension D.
27 System<D> system;
28
29 // Process command line options
30 system.setOptions(argc, argv);
31
32 // Read parameters from default parameter file
33 system.readParam();
34
35 // Read command script to run system
36 system.readCommands();
37
38 }
39
40}
41}
42
50int main(int argc, char **argv)
51{
52
53 // Extract the dimension of space from argument of -d option
54 int D = Pscf::Prdc::getDimension(argc, argv);
55 std::cout << "dimension " << D << std::endl;
56
57 if (1 == D) {
58 Pscf::Rpg::run<1>(argc, argv);
59 } else
60 if (2 == D) {
61 Pscf::Rpg::run<2>(argc, argv);
62 } else
63 if (3 == D) {
64 Pscf::Rpg::run<3>(argc, argv);
65 } else {
66 std::cout << " Invalid dimension = " << D << std::endl;
67 }
68
69}
Main class, representing one complete system.
void readCommands(std::istream &in)
Read and process commands from an input stream.
void setOptions(int argc, char **argv)
Process command line options.
virtual void readParam(std::istream &in)
Read input parameters (with opening and closing lines).
int main(int argc, char **argv)
Main pscf_pg program.
Definition pscf_pg.cu:50
void run(int argc, char **argv)
Function template for main pscf_pg program.
Definition pscf_pg.cu:24
SCFT and PS-FTS with real periodic fields (GPU)
PSCF package top-level namespace.
Definition param_pc.dox:1