PSCF v1.3
pscf_pc.cpp
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 <rpc/system/System.h>
9#include <prdc/crystal/getDimension.h>
10#include <pscf/chem/PolymerModel.h>
11
12#include <iostream>
13
14namespace Pscf {
15namespace Rpc {
16
25 template <int D>
26 void run(int argc, char **argv) {
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 // Prohibit later changes to global polymer model
37
38 // Read command script and execute commands
39 system.readCommands();
40 }
41
42}
43}
44
52int main(int argc, char **argv)
53{
54
55 // Extract the dimension of space from argument of -d option
56 int D = Pscf::Prdc::getDimension(argc, argv);
57 std::cout << "dimension " << D << std::endl;
58
59 if (1 == D) {
60 Pscf::Rpc::run<1>(argc, argv);
61 } else
62 if (2 == D) {
63 Pscf::Rpc::run<2>(argc, argv);
64 } else
65 if (3 == D) {
66 Pscf::Rpc::run<3>(argc, argv);
67 } else {
68 std::cout << " Invalid dimension = " << D << std::endl;
69 }
70
71 fftw_cleanup();
72}
Main class, representing one complete system.
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).
void run(int argc, char **argv)
Function template for main pscf_pc program.
Definition pscf_pc.cpp:26
int main(int argc, char **argv)
Main pscf_pc program.
Definition pscf_pc.cpp:52
void lock()
Make the polymer model immutable.
Real periodic fields, SCFT and PS-FTS (CPU).
Definition param_pc.dox:2
PSCF package top-level namespace.
Definition param_pc.dox:1