PSCF v1.3
rpg/field/Mask.tpp
1#ifndef RPG_MASK_TPP
2#define RPG_MASK_TPP
3
4/*
5* PSCF - Polymer Self-Consistent Field
6*
7* Copyright 2015 - 2025, The Regents of the University of Minnesota
8* Distributed under the terms of the GNU General Public License.
9*/
10
11#include "Mask.h"
12#include <prdc/cuda/Reduce.h>
13
14namespace Pscf {
15namespace Rpg
16{
17
18 using namespace Util;
19 using namespace Pscf::Prdc;
20 using namespace Pscf::Prdc::Cuda;
21
22 /*
23 * Calculate the average value of the rgrid_ member.
24 */
25 template <int D>
26 double Mask<D>::rGridAverage() const
27 {
29 return (Reduce::sum(rg) / ((double)rg.capacity()));
30 }
31
32} // namespace Rpg
33} // namespace Pscf
34#endif
Field of real double precision values on an FFT mesh.
Definition cpu/RField.h:29
File input/output operations and format conversions for fields.
Prdc::Cuda::RField< D > const & rgrid() const
Get the field in r-grid format.
double rGridAverage() const override
Calculate the average value of the rgrid_ member.
int capacity() const
Return allocated size.
Definition Array.h:159
Fields, FFTs, and utilities for periodic boundary conditions (CUDA)
Definition Reduce.cpp:14
Periodic fields and crystallography.
Definition CField.cpp:11
SCFT and PS-FTS with real periodic fields (GPU)
PSCF package top-level namespace.
Definition param_pc.dox:1