PSCF v1.3.1
rpg/fts/montecarlo/RealMove.h
1#ifndef RPG_REAL_MOVE_H
2#define RPG_REAL_MOVE_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#include "McMove.h" // base class
12#include <prdc/cuda/RField.h> // member
13#include <util/containers/DArray.h> // member
14
15namespace Pscf {
16namespace Rpg {
17
18 using namespace Util;
19 using namespace Pscf::Prdc;
20 using namespace Pscf::Prdc::Cuda;
21
27 template <int D>
28 class RealMove : public McMove<D>
29 {
30
31 public:
32
39
45 ~RealMove();
46
52 void readParameters(std::istream &in);
53
57 void output();
58
62 void setup();
63
67 void outputTimers(std::ostream& out);
68
69 // Inherited public member function
70 using McMove<D>::move;
72 using McMove<D>::clearTimers;
75
76 protected:
77
78 using McMove<D>::system;
79 using McMove<D>::simulator;
80 using McMove<D>::random;
81 using McMove<D>::cudaRandom;
82
92 void attemptMove();
93
94 private:
95
96 // Change in one component of wc
97 RField<D> dwc_;
98
99 // New field values
101
102 // Normal-distributed random fields
103 RField<D> gaussianField_;
104
105 // The standard deviation of the Gaussian distribution
106 double sigma_;
107
108 // Has the variable been allocated?
109 bool isAllocated_;
110
111 };
112
113 // Explicit instantiation declarations
114 extern template class RealMove<1>;
115 extern template class RealMove<2>;
116 extern template class RealMove<3>;
117
118}
119}
120#endif
Field of real double precision values on an FFT mesh.
Definition cpu/RField.h:29
CudaRandom & cudaRandom()
Get cuda random number generator by reference.
Random & random()
Get Random number generator of parent System.
virtual bool move()
Generate, attempt, and accept or reject a Monte Carlo move.
void readProbability(std::istream &in)
Read the probability from file.
McSimulator< D > & simulator()
Get parent McSimulator object.
System< D > & system()
Get parent System object.
McMove(McSimulator< D > &simulator)
Constructor.
virtual void clearTimers()
Clear timers.
Monte-Carlo simulation coordinator.
RealMove is a Monte Carlo move in real space.
void readParameters(std::istream &in)
Read required parameters from file.
void attemptMove()
Attempt unconstrained move.
RealMove(McSimulator< D > &simulator)
Constructor.
void setup()
Setup before the beginning of each simulation run.
void outputTimers(std::ostream &out)
Return real move times contributions.
void output()
Output statistics for this move (at the end of simulation)
Dynamically allocatable contiguous array template.
Definition DArray.h:32
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, FFTs, and utilities for periodic boundary conditions (CUDA)
Definition Reduce.cpp:14
Periodic fields and crystallography.
Definition CField.cpp:11
SCFT and PS-FTS with real periodic fields (GPU)
PSCF package top-level namespace.
Definition param_pc.dox:1