PSCF v1.2
rpc/fts/montecarlo/RealMove.h
1#ifndef RPC_REAL_MOVE_H
2#define RPC_REAL_MOVE_H
3
4/*
5* PSCF - Polymer Self-Consistent Field Theory
6*
7* Copyright 2016 - 2022, The Regents of the University of Minnesota
8* Distributed under the terms of the GNU General Public License.
9*/
10
11#include "McMove.h" // base class
12#include <prdc/cpu/RField.h> // member
13#include <util/containers/DArray.h> // member
14
15namespace Pscf {
16namespace Rpc {
17
18 using namespace Util;
19 using namespace Pscf::Prdc::Cpu;
20
28 template <int D>
29 class RealMove : public McMove<D>
30 {
31
32 public:
33
40
46 ~RealMove();
47
53 void readParameters(std::istream &in);
54
58 void output();
59
63 void setup();
64
68 void outputTimers(std::ostream& out);
69
70 // Inherited public member function
71 using McMove<D>::move;
73 using McMove<D>::clearTimers;
76
77 protected:
78
79 using McMove<D>::system;
80 using McMove<D>::simulator;
81 using McMove<D>::random;
82
92 void attemptMove();
93
94 private:
95
96 // Change in one field component
97 RField<D> dwc_;
98
99 // New field values
101
102 // The standard deviation of the Gaussian distribution
103 double sigma_;
104
105 // Has the variable been allocated?
106 bool isAllocated_;
107
108 };
109
110 #ifndef RPC_REAL_MOVE_TPP
111 // Suppress implicit instantiation
112 extern template class RealMove<1>;
113 extern template class RealMove<2>;
114 extern template class RealMove<3>;
115 #endif
116
117}
118}
119#endif
Field of real double precision values on an FFT mesh.
McMove is an abstract base class for Monte Carlo moves.
virtual void clearTimers()
Clear timers.
Random & random()
Get Random number generator of parent System.
System< D > & system()
Get parent System object.
McSimulator< D > & simulator()
Get parent McSimulator object.
virtual bool move()
Generate, attempt, and accept or reject a Monte Carlo move.
void readProbability(std::istream &in)
Read the probability from file.
Monte-Carlo simulation coordinator.
RealMove generates spatially uncorrelated random field changes.
void outputTimers(std::ostream &out)
Return real move times contributions.
void readParameters(std::istream &in)
Read required parameters from file.
RealMove(McSimulator< D > &simulator)
Constructor.
void output()
Output statistics for this move (at the end of simulation)
void attemptMove()
Attempt unconstrained move.
void setup()
Setup before the beginning of each simulation run.
Dynamically allocatable contiguous array template.
ScalarParam< Type > & read(std::istream &in, const char *label, Type &value)
Add and read a new required ScalarParam < Type > object.
void setClassName(const char *className)
Set class name string.
Fields and FFTs for periodic boundary conditions (CPU)
Definition CField.cpp:12
PSCF package top-level namespace.
Definition param_pc.dox:1
Utility classes for scientific computation.