PSCF v1.5.0
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 - 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/brownian/BdStep.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
17namespace Pscf {
18namespace Rp {
19
20 using namespace Util;
21
32 template <int D, class T>
33 class ExplicitBdStep : public BdStep<D,T>
34 {
35
36 public:
37
44
45 ~ExplicitBdStep() = default;
46
47 // Not copyable or assignable
48 ExplicitBdStep(ExplicitBdStep<D,T> const & ) = delete;
49 ExplicitBdStep<D,T>& operator= (ExplicitBdStep<D,T> const &) = delete;
50
56 void readParameters(std::istream &in) override;
57
61 void setup() override;
62
68 bool step() override;
69
70 protected:
71
72 using BdStep<D,T>::system;
73 using BdStep<D,T>::simulator;
74 using BdStep<D,T>::vecRandom;
75
76 private:
77
78 // Local copy of w fields
80
81 // Change in one component of wc
82 RField<D,T> dwc_;
83
84 // Normal distributed random numbers
85 RField<D,T> gaussianField_;
86
87 // Prefactor of -dc_ in deterministic drift term
88 double mobility_;
89
90 };
91
92 // Explicit instantiation declarations
93 PSCF_TMPL_DECLARE(ExplicitBdStep)
94
95}
96}
97#endif
Brownian dynamics simulator for PS-FTS.
Definition BdSimulator.h:52
BdStep(BdSimulator< D, T > &simulator)
Constructor.
Definition BdStep.tpp:32
BdSimulator< D, T > & simulator()
Get parent BdSimulator object.
Definition BdStep.h:183
System< D, T > & system()
Get parent System object.
Definition BdStep.h:176
VecRandom< T > & vecRandom()
Get vector random number generator of parent simulator.
Definition BdStep.h:197
Explicit Euler-Maruyama Brownian dynamics step.
void setup() override
Setup before simulation.
ExplicitBdStep(BdSimulator< D, T > &simulator)
Constructor.
bool step() override
Take a single Brownian dynamics step.
void readParameters(std::istream &in) override
Read body of parameter file block.
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.