PSCF v1.5.0
RealMove.h
1#ifndef RP_REAL_MOVE_H
2#define RP_REAL_MOVE_H
3
4/*
5* PSCF - Polymer Self-Consistent Field
6*
7* Copyright 2015 - 2026, David Morse (morse012@um.edu) and co-authors
8* Distributed under the terms of the GNU General Public License.
9*/
10
11#include <rp/fts/montecarlo/McMove.h> // base class
12#include <pscf/field/RField.h> // member
13#include <util/containers/DArray.h> // member
14
15#include <pscf/backend/TmplDeclare.h>
16#include <iostream>
17
18// Forward declaration
19namespace Pscf {
20 template <int D, class T> class RField;
21}
22
23namespace Pscf {
24namespace Rp {
25
26 using namespace Util;
27
39 template <int D, class T>
40 class RealMove : public McMove<D,T>
41 {
42 public:
43
50
54 ~RealMove() = default;
55
61 void readParameters(std::istream &in) override;
62
66 void setup() override;
67
68 protected:
69
73 void attemptMove() override;
74
75 // Alias for McMove base class.
76 using McMoveT = McMove<D,T>;
77
78 // Inherited protected member functions (selected).
79 using McMove<D,T>::system;
80 using McMove<D,T>::simulator;
81 using McMove<D,T>::vecRandom;
82
83 private:
84
87
89 RField<D,T> dwc_;
90
92 double sigma_;
93
95 bool isAllocated_;
96
97 };
98
99 // Explicit instantiation declarations
100 PSCF_TMPL_DECLARE(RealMove)
101
102}
103}
104#endif
McSimulator< D, T > & simulator()
Get parent McSimulator object (non-const ref).
Definition McMove.h:342
VecRandom< T > & vecRandom()
Get the vector random number generator.
Definition McMove.h:363
System< D, T > & system()
Get parent System object (non-const ref).
Definition McMove.h:328
McMove(McSimulator< D, T > &simulator)
Constructor.
Definition McMove.tpp:32
Monte-Carlo simulation coordinator.
Definition McSimulator.h:55
RealMove generates spatially uncorrelated random field changes.
Definition RealMove.h:41
~RealMove()=default
Destructor.
RealMove(McSimulator< D, T > &simulator)
Constructor.
Definition RealMove.tpp:32
void readParameters(std::istream &in) override
Read body of parameter file block.
Definition RealMove.tpp:44
void attemptMove() override
Attempt unconstrained move.
Definition RealMove.tpp:76
void setup() override
Setup before the simulation loop.
Definition RealMove.tpp:56
Dynamically allocatable contiguous array template.
Definition DArray.h:32
Code for programs that simulate real-valued periodic fields.
Definition param_pc.dox:2
PSCF package top-level namespace.