PSCF v1.4.0
ShiftMove.cpp
1/*
2* PSCF - Polymer Self-Consistent Field
3*
4* Copyright 2015 - 2025, The Regents of the University of Minnesota
5* Distributed under the terms of the GNU General Public License.
6*/
7
8#include "ShiftMove.h"
9#include <rpc/fts/montecarlo/McSimulator.h>
10#include <rpc/system/System.h>
11#include <rpc/solvers/Mixture.h>
12#include <rpc/field/Domain.h>
13#include <rpc/field/WFields.h>
14
15#include <rp/fts/montecarlo/ShiftMove.tpp>
16
17namespace Pscf {
18namespace Rpc {
19
20 using namespace Util;
21 using namespace Prdc::Cpu;
22
23 /*
24 * Constructor.
25 */
26 template <int D>
28 : RpShiftMove(simulator)
29 {}
30
31 /*
32 * Compute and store array w_ of shifted fields.
33 */
34 template <int D>
36 {
37 IntVec<D> const& dimensions = system().domain().mesh().dimensions();
38 const int nMonomer = system().mixture().nMonomer();
39 for (int j = 0; j< nMonomer; ++j) {
40 RField<D> const & wOld = system().w().rgrid(j);
41 RField<D> & wNew = RpShiftMove::w_[j];
42 RpShiftMove::shiftField(wNew, wOld, shift, dimensions);
43 }
44 }
45
46}
47}
48
49// Explicit instantiation declarations
50namespace Pscf {
51 namespace Rp {
52 template class Rp::ShiftMove<1, Rpc::Types<1> >;
53 template class Rp::ShiftMove<2, Rpc::Types<2> >;
54 template class Rp::ShiftMove<3, Rpc::Types<3> >;
55 }
56 namespace Rpc {
57 template class ShiftMove<1>;
58 template class ShiftMove<2>;
59 template class ShiftMove<3>;
60 }
61}
An IntVec<D, T> is a D-component vector of elements of integer type T.
Definition IntVec.h:27
Field of real double precision values on an FFT mesh.
Definition cpu/RField.h:27
DArray< typename Types< D >::RField > w_
void shiftField(Array< double > &out, Array< double > const &in, IntVec< D > shift, IntVec< D > dimensions) const
Monte Carlo simulator for PS-FTS.
ShiftMove shifts field.
void shiftFields(IntVec< D > const &shift)
Compute and store shifted w fields.
Definition ShiftMove.cpp:35
ShiftMove(McSimulator< D > &simulator)
Constructor.
Definition ShiftMove.cpp:27
Real periodic fields, SCFT and PS-FTS (CPU).
Definition param_pc.dox:2
PSCF package top-level namespace.