PSCF v1.4.0
cpc/field/WFields.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 "WFields.h" // class header
9#include <cp/field/WFields.tpp> // base class implementation
10
11namespace Pscf {
12namespace Cpc {
13
14 using namespace Util;
15 using namespace Pscf::Prdc;
16 using namespace Pscf::Prdc::Cpu;
17
18 template <int D>
19 void WFields<D>::assignField(CField<D>& lhs,
20 CField<D> const & rhs) const
21 {
22 int n = rhs.capacity();
23 UTIL_CHECK(lhs.capacity() == n);
24 UTIL_CHECK(meshSize() == n);
25 for (int i = 0; i < n; ++i) {
26 lhs[i][0] = rhs[i][0];
27 lhs[i][1] = rhs[i][1];
28 }
29 }
30
31} // namespace Cpc
32} // namespace Pscf
33
34// Explicit instantiation definitions
35namespace Pscf {
36 namespace Cp {
37 template class WFields<1, Prdc::Cpu::CField<1>, Cpc::FieldIo<1> >;
38 template class WFields<2, Prdc::Cpu::CField<2>, Cpc::FieldIo<2> >;
39 template class WFields<3, Prdc::Cpu::CField<3>, Cpc::FieldIo<3> >;
40 }
41 namespace Cpc {
42 template class WFields<1>;
43 template class WFields<2>;
44 template class WFields<3>;
45 }
46}
A container of complex-valued w fields.
A container of w fields.
Field of complex double precision values on an FFT mesh.
Definition cpu/CField.h:29
int capacity() const
Return allocated size.
Definition Array.h:144
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
Definition global.h:68
Complex-valued periodic fields (class templates).
Definition cp.mod:6
Complex periodic fields, CL-FTS (CPU).
Definition cpc.mod:6
Fields and FFTs for periodic boundary conditions (CPU)
Definition complex.cpp:12
Periodic fields and crystallography.
Definition complex.cpp:11
PSCF package top-level namespace.