PSCF v1.4.0
fts/brownian/ExplicitBdStep.h
1#ifndef RP_EXPLICIT_BD_STEP_H
2#define RP_EXPLICIT_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#include "BdStep.h" // base class
12#include <util/containers/DArray.h> // member
13
14namespace Pscf {
15namespace Rp {
16
17 using namespace Util;
18
34 template <int D, class T>
35 class ExplicitBdStep : public T::BdStep
36 {
37
38 public:
39
40 // Protected constructor and destructor (see below).
41
42 // Not copyable or assignable
43 ExplicitBdStep(ExplicitBdStep<D,T> const & ) = delete;
44 ExplicitBdStep<D,T>& operator= (ExplicitBdStep<D,T> const &) = delete;
45
51 void readParameters(std::istream &in) override;
52
56 void setup() override;
57
63 bool step() override;
64
65 protected:
66
72 ExplicitBdStep(typename T::BdSimulator& simulator);
73
74 ~ExplicitBdStep() = default;
75
76 using BdStepT = typename T::BdStep;
77 using BdStepT::system;
78 using BdStepT::simulator;
79 using BdStepT::vecRandom;
80
81 private:
82
83 // Local copy of w fields
85
86 // Change in one component of wc
87 typename T::RField dwc_;
88
89 // Normal distributed random numbers
90 typename T::RField gaussianField_;
91
92 // Prefactor of -dc_ in deterministic drift term
93 double mobility_;
94
95 };
96
97}
98}
99#endif
void setup() override
Setup before simulation.
bool step() override
Take a single Brownian dynamics step.
void readParameters(std::istream &in) override
Read body of parameter file block.
Class templates for real-valued periodic fields.
PSCF package top-level namespace.