1#ifndef RPG_EXPLICIT_BD_STEP_TPP
2#define RPG_EXPLICIT_BD_STEP_TPP
11#include "ExplicitBdStep.h"
13#include <rpg/fts/brownian/BdSimulator.h>
14#include <rpg/fts/compressor/Compressor.h>
15#include <rpg/system/System.h>
16#include <prdc/cuda/VecOp.h>
17#include <pscf/math/IntVec.h>
50 read(in,
"mobility", mobility_);
53 int nMonomer =
system().mixture().nMonomer();
55 w_.allocate(nMonomer);
56 for (
int i=0; i < nMonomer; ++i) {
57 w_[i].allocate(meshDimensions);
59 dwc_.allocate(meshDimensions);
67 int meshSize =
system().domain().mesh().size();
69 int nMonomer =
system().mixture().nMonomer();
71 for (
int i=0; i < nMonomer; ++i) {
75 gaussianField_.allocate(dimensions);
82 const int nMonomer =
system().mixture().nMonomer();
83 const int meshSize =
system().domain().mesh().size();
90 for (i = 0; i < nMonomer; ++i) {
95 const double vSystem =
system().domain().unitCell().volume();
96 double a = -1.0*mobility_;
97 double b = sqrt(2.0*mobility_*
double(meshSize)/vSystem);
106 for (j = 0; j < nMonomer - 1; ++j) {
110 cudaRandom().normal(gaussianField_, stddev, mean);
116 for (i = 0; i < nMonomer; ++i) {
125 system().w().setRGrid(w_);
129 bool isConverged =
false;
130 int compress =
simulator().compressor().compress();
An IntVec<D, T> is a D-component vector of elements of integer type T.
Field of real double precision values on an FFT mesh.
Brownian dynamics simulator.
BdStep(BdSimulator< D > &simulator)
Constructor.
System< D > & system()
Get parent System object.
CudaRandom & cudaRandom()
Get Random number generator of parent System.
BdSimulator< D > & simulator()
Get parent BdSimulator object.
virtual ~ExplicitBdStep()
Destructor.
ScalarParam< Type > & read(std::istream &in, const char *label, Type &value)
Add and read a new required ScalarParam < Type > object.
virtual bool step()
Take a single Brownian dynamics step.
virtual void readParameters(std::istream &in)
Read required parameters from file.
ExplicitBdStep(BdSimulator< D > &simulator)
Constructor.
virtual void setup()
Setup before simulation.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
void eqV(DeviceArray< cudaReal > &a, DeviceArray< cudaReal > const &b, const int beginIdA, const int beginIdB, const int n)
Vector assignment, a[i] = b[i], kernel wrapper (cudaReal).
void addVcVc(DeviceArray< cudaReal > &a, DeviceArray< cudaReal > const &b, cudaReal const c, DeviceArray< cudaReal > const &d, cudaReal const e)
Vector addition w/ coefficient, a[i] = (b[i]*c) + (d[i]*e), kernel wrapper.
void addEqVc(DeviceArray< cudaReal > &a, DeviceArray< cudaReal > const &b, cudaReal const c)
Vector addition in-place w/ coefficient, a[i] += b[i] * c, kernel wrapper.
Fields, FFTs, and utilities for periodic boundary conditions (CUDA)
Periodic fields and crystallography.
SCFT and PS-FTS with real periodic fields (GPU)
PSCF package top-level namespace.