PSCF v1.4.0
MaxOrderParameter.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 "MaxOrderParameter.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 <rpg/field/CFields.h>
16
17#include <prdc/cuda/FFT.h>
18#include <prdc/cuda/RField.h>
19#include <pscf/cuda/VecOp.h>
20
21#include <rp/fts/analyzer/MaxOrderParameter.tpp>
22
23namespace Pscf {
24namespace Rpg {
25
26 using namespace Util;
27 using namespace Pscf::Prdc;
28
29 /*
30 * Constructor.
31 */
32 template <int D>
34 System<D>& system)
35 : Rp::MaxOrderParameter<D, Types<D> >(simulator, system)
36 {}
37
38 /*
39 * Compute and return maximum of square magnitude Fourier amplitude.
40 */
41 template <int D>
43 {
44 // Setup base class
46
47 // Allocate psiHost_ array
49 UTIL_CHECK(kSize > 0);
50 if (!psiHost_.isAllocated()) {
51 psiHost_.allocate(kSize);
52 }
53 UTIL_CHECK(psiHost_.capacity() == kSize);
54 }
55
56
57 /*
58 * Compute and return maximum of square magnitude Fourier amplitude.
59 */
60 template <int D>
62 {
63 // Compute device array psi_ of squared Fourier magnitudes
65
66 // Copy device array psi_ to corresponing host array psiHost_
68
69 // Compute maximum from host array
71
73 }
74
75}
76}
77
78// Explicit instantiation definitions
79namespace Pscf {
80 namespace Rp {
81 template class MaxOrderParameter<1, Rpg::Types<1> >;
82 template class MaxOrderParameter<2, Rpg::Types<2> >;
83 template class MaxOrderParameter<3, Rpg::Types<3> >;
84 }
85 namespace Rpg {
86 template class MaxOrderParameter<1>;
87 template class MaxOrderParameter<2>;
88 template class MaxOrderParameter<3>;
89 }
90}
void findMaximum(Array< typename Types< D >::Real > const &psi)
Evaluates maximum squared Fourier amplitude for W_{-} field.
MaxOrderParameter(Simulator< D > &simulator, System< D > &system)
Constructor.
double compute() override
Compute and return the max order parameter.
void setup() override
Setup before the start of simulation.
Field theoretic simulator (base class).
Main class, representing a complete physical system.
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.
Definition global.h:68
Periodic fields and crystallography.
Definition complex.cpp:11
Class templates for real-valued periodic fields.
SCFT and PS-FTS with real periodic fields (GPU)
PSCF package top-level namespace.