PSCF v1.4.0
Step.h
1#ifndef CPC_BD_STEP_H
2#define CPC_BD_STEP_H
3
4/*
5* PSCF - Polymer Self-Consistent Field
6*
7* Copyright 2015 - 2025, The Regents of the University of Minnesota
8* Distributed under the terms of the GNU General Public License.
9*/
10
11
12#include <util/param/ParamComposite.h>
13#include <util/random/Random.h>
14#include <util/global.h>
15
16namespace Pscf {
17namespace Cpc {
18
19 using namespace Util;
20
21 template <int D> class System;
22 template <int D> class Simulator;
23
31 template <int D>
32 class Step : public ParamComposite
33 {
34
35 public:
36
43
49 virtual ~Step();
50
58 virtual void readParameters(std::istream &in);
59
63 virtual void setup();
64
70 virtual bool step() = 0;
71
79 virtual bool needsCc()
80 { return false; }
81
89 virtual bool needsDc()
90 { return true; }
91
97 virtual void outputTimers(std::ostream& out);
98
102 virtual void clearTimers();
103
107 virtual void output();
108
109 protected:
110
114 System<D>& system();
115
120
124 Random& random();
125
126 private:
127
129 Simulator<D>* simulatorPtr_;
130
132 System<D>* systemPtr_;
133
135 Random *randomPtr_;
136
137 };
138
139 // Protected inline methods
140
141 /*
142 * Get parent System object.
143 */
144 template <int D>
146 { return *systemPtr_; }
147
148 /*
149 * Get parent Simulator object.
150 */
151 template <int D>
153 { return *simulatorPtr_; }
154
155 /*
156 * Get Random number generator.
157 */
158 template <int D>
160 { return *randomPtr_; }
161
162 // Explicit instantiation declarations
163 extern template class Step<1>;
164 extern template class Step<2>;
165 extern template class Step<3>;
166
167}
168}
169#endif
Simulator for complex Langevin field theoretic simulation.
Step is an abstract base class for Brownian dynamics steps.
Definition Step.h:33
virtual void setup()
Setup before the beginning of each simulation run.
Definition Step.tpp:49
virtual ~Step()
Destructor.
Definition Step.tpp:35
System< D > & system()
Get parent System object.
Definition Step.h:145
virtual void outputTimers(std::ostream &out)
Output timing results to ostream.
Definition Step.tpp:57
virtual void output()
Output statistics for this move (at the end of simulation)
Definition Step.tpp:53
virtual bool needsDc()
Do dc derivative components need to be saved before a step?
Definition Step.h:89
Simulator< D > & simulator()
Get parent Simulator object.
Definition Step.h:152
virtual void readParameters(std::istream &in)
Read required parameters from file.
Definition Step.tpp:42
virtual bool needsCc()
Do cc concentration components need to be saved before a step?
Definition Step.h:79
Step(Simulator< D > &simulator)
Constructor.
Definition Step.tpp:25
Random & random()
Get Random number generator of parent Simulator.
Definition Step.h:159
virtual bool step()=0
Take a single Brownian dynamics step.
virtual void clearTimers()
Clear timers.
Definition Step.tpp:61
Main class for CL-FTS, representing a complete physical system.
ParamComposite()
Constructor.
Random number generator.
Definition Random.h:47
File containing preprocessor macros for error handling.
Complex periodic fields, CL-FTS (CPU).
Definition cpc.mod:6
PSCF package top-level namespace.