PSCF v1.4.0
IntraCorrelation.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 "IntraCorrelation.h"
9
10#include <rpg/system/System.h>
11#include <rpg/solvers/Mixture.h>
12#include <rpg/field/Domain.h>
13
14#include <prdc/cuda/FFT.h>
15#include <prdc/cuda/RField.h>
16
17#include <rp/fts/compressor/IntraCorrelation.tpp>
18
19namespace Pscf {
20namespace Rpg {
21
22 using namespace Util;
23 using namespace Prdc;
24
25 /*
26 * Constructor.
27 */
28 template <int D>
32
33 /*
34 * Compute k-space array of intramolecular correlation functions.
35 */
36 template<int D>
37 void
39 {
41 int nk = RpIntraCorrelation::kSize();
42 UTIL_CHECK(correlations.capacity() == nk);
43
44 // Check allocation of host array correlations_
45 if (!correlations_.isAllocated()) {
46 correlations_.allocate(nk);
47 }
48 UTIL_CHECK(correlations_.capacity() == nk);
49
51
52 // Copy host array to device array
53 correlations = correlations_;
54
55 }
56
57}
58}
59
60// Explicit instantiation definitions
61namespace Pscf {
62 namespace Rp {
63 template class IntraCorrelation<1, Rpg::Types<1> >;
64 template class IntraCorrelation<2, Rpg::Types<2> >;
65 template class IntraCorrelation<3, Rpg::Types<3> >;
66 }
67 namespace Rpg {
68 template class IntraCorrelation<1>;
69 template class IntraCorrelation<2>;
70 template class IntraCorrelation<3>;
71 }
72}
int capacity() const
Return array capacity.
Field of real values on a regular mesh, allocated on a GPU device.
Definition cuda/RField.h:33
Types< D >::System const & system() const
void computeOmegaTotal(Array< typename Types< D >::Real > &correlations)
Intramolecular correlation analyzer.
void computeOmegaTotal(RField< D > &correlations)
Compute total intramolecular correlation function (all blocks).
IntraCorrelation(System< D > const &system)
Constructor.
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.