8#include "ForceBiasMove.h"
10#include <rpg/fts/montecarlo/McSimulator.h>
11#include <rpg/fts/compressor/Compressor.h>
12#include <rpg/system/System.h>
13#include <rpg/solvers/Mixture.h>
14#include <rpg/field/Domain.h>
15#include <rpg/field/CFields.h>
16#include <rpg/field/WFields.h>
18#include <pscf/cuda/VecOp.h>
19#include <pscf/cuda/Reduce.h>
20#include <pscf/cuda/CudaVecRandom.h>
21#include <pscf/cuda/ThreadArray.h>
22#include <pscf/cuda/DeviceArray.h>
23#include <pscf/cuda/HostDArray.h>
25#include <rp/fts/montecarlo/ForceBiasMove.tpp>
32 using namespace Prdc::Cuda;
47 void _computeForceBias(
cudaReal* result,
54 int nThreads = blockDim.x * gridDim.x;
55 int startID = blockIdx.x * blockDim.x + threadIdx.x;
56 for (
int i = startID; i < n; i += nThreads) {
57 result[i] = 0.5 * (di[i] + df[i]) *
58 (dwc[i] + mobility * (0.5 * (di[i] - df[i])));
68 void ForceBiasMove<D>::computeForceBias(
75 const int n = result.capacity();
85 _computeForceBias<<<nBlocks, nThreads>>>(
86 result.cArray(), di.cArray(),
87 df.cArray(), dwc.cArray(),
Field of real values on a regular mesh, allocated on a GPU device.
ForceBiasMove attempts a Brownian dynamics move.
ForceBiasMove attempts a Brownian dynamics move.
ForceBiasMove(McSimulator< D > &simulator)
Constructor.
Monte Carlo simulator for PS-FTS.
List of aliases for types used in the Rpg program-level namespace.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
void setThreadsLogical(int nThreadsLogical)
Given total number of threads, set 1D execution configuration.
int nThreads()
Get the number of threads per block for execution.
int nBlocks()
Get the current number of blocks for execution.
Periodic fields and crystallography.
Class templates for real-valued periodic fields.
SCFT and PS-FTS with real periodic fields (GPU)
PSCF package top-level namespace.
cufftDoubleReal cudaReal
Real number type used in CPU code that uses FFTW.