PSCF v1.4.0
FourthOrderParameter.cu
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 "FourthOrderParameter.h"
9
10#include <rpg/system/System.h>
11#include <rpg/fts/simulator/Simulator.h>
12#include <rpg/solvers/Mixture.h>
13#include <rpg/field/Domain.h>
14#include <rpg/field/WFields.h>
15#include <prdc/cuda/FFT.h>
16#include <pscf/cuda/VecOp.h>
17#include <pscf/cuda/Reduce.h>
18#include <pscf/cuda/HostDArray.h>
19#include <pscf/cuda/cudaTypes.h>
20#include <pscf/cpu/VecOp.h>
21
22#include <rp/fts/analyzer/FourthOrderParameter.tpp>
23
24namespace Pscf {
25namespace Rpg {
26
27 /*
28 * Constructor.
29 */
30 template <int D>
32 Simulator<D>& simulator,
33 System<D>& system)
34 : Base(simulator, system)
35 {}
36
37 /*
38 * Initialize Base::prefactor_ protected member variable.
39 */
40 template <int D>
41 void FourthOrderParameter<D>::computePrefactor()
42 {
43 // Allocate CPU host array
44 HostDArray<cudaReal> prefactor_h(Base::kSize_);
45 VecOp::eqS(prefactor_h, 0.0);
46
47 // Perform computation on host
48 Base::computePrefactor(prefactor_h);
49
50 // Copy from from cpu(host) to gpu(device)
51 Base::prefactor_ = prefactor_h;
52 }
53
54}
55}
56
57// Explicit instantiation definitions
58namespace Pscf {
59 namespace Rp {
63 }
64 namespace Rpg {
65 template class FourthOrderParameter<1>;
66 template class FourthOrderParameter<2>;
67 template class FourthOrderParameter<3>;
68 }
69}
Template for dynamic array stored in host CPU memory.
Definition HostDArray.h:41
FourthOrderParameter is used to detect an order-disorder transition.
FourthOrderParameter is used to detect an order-disorder transition.
FourthOrderParameter(Simulator< D > &simulator, System< D > &system)
Constructor.
Field theoretic simulator (base class).
Main class, representing a complete physical system.
void eqS(Array< double > &a, double b)
Vector assignment, a[i] = b (real).
Definition VecOp.cpp:50
Class templates for real-valued periodic fields.
SCFT and PS-FTS with real periodic fields (GPU)
PSCF package top-level namespace.