PSCF v1.2
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 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/cuda/RField.h>
13
14#include <util/param/ParamComposite.h>
15#include <util/containers/DArray.h>
16#include <util/global.h>
17
18namespace Pscf {
19namespace Rpg {
20
21 using namespace Util;
22 using namespace Pscf::Prdc;
23 using namespace Pscf::Prdc::Cuda;
24
30 template <int D>
31 class RealMove : public McMove<D>
32 {
33
34 public:
35
42
48 ~RealMove();
49
55 void readParameters(std::istream &in);
56
60 void output();
61
65 void setup();
66
70 void outputTimers(std::ostream& out);
71
72 // Inherited public member function
73 using McMove<D>::move;
75 using McMove<D>::clearTimers;
78
79 protected:
80
81 using McMove<D>::system;
82 using McMove<D>::simulator;
83 using McMove<D>::random;
84 using McMove<D>::cudaRandom;
85
95 void attemptMove();
96
97 private:
98
99 // Change in one component of wc
100 RField<D> dwc_;
101
102 // New field values
104
105 // Normal-distributed random fields
106 RField<D> gaussianField_;
107
108 // The standard deviation of the Gaussian distribution
109 double sigma_;
110
111 // Has the variable been allocated?
112 bool isAllocated_;
113
114 };
115
116 #ifndef RPG_REAL_MOVE_TPP
117 // Suppress implicit instantiation
118 extern template class RealMove<1>;
119 extern template class RealMove<2>;
120 extern template class RealMove<3>;
121 #endif
122
123}
124}
125#endif
Field of real double precision values on an FFT mesh.
McMove is an abstract base class for Monte Carlo moves.
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.
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.
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.
File containing preprocessor macros for error handling.
Fields, FFTs, and utilities for periodic boundary conditions (CUDA)
Definition CField.cu:12
Periodic fields and crystallography.
Definition CField.cpp:11
PSCF package top-level namespace.
Definition param_pc.dox:1
Utility classes for scientific computation.