1#ifndef RPG_W_FIELD_CONTAINER_H
2#define RPG_W_FIELD_CONTAINER_H
13#include <prdc/cuda/RField.h>
14#include <prdc/crystal/UnitCell.h>
15#include <pscf/math/IntVec.h>
16#include <pscf/cuda/DeviceArray.h>
17#include <util/param/ParamComposite.h>
18#include <util/containers/DArray.h>
368 bool isAllocatedRGrid_;
373 bool isAllocatedBasis_;
402 {
return basis_[id]; }
415 {
return rgrid_[id]; }
420 {
return isAllocatedRGrid_; }
425 {
return isAllocatedBasis_; }
435 {
return isSymmetric_; }
437 #ifndef RPG_W_FIELD_CONTAINER_TPP
Dynamic array on the GPU device with aligned data.
An IntVec<D, T> is a D-component vector of elements of integer type T.
Field of real double precision values on an FFT mesh.
Base template for UnitCell<D> classes, D=1, 2 or 3.
File input/output operations and format conversions for fields.
A list of fields stored in both basis and r-grid format.
void setNMonomer(int nMonomer)
Set stored value of nMonomer.
void deallocateBasis()
De-allocate fields in basis format.
void allocateBasis(int nBasis)
Allocate or re-allocate memory for fields in basis format.
void setFieldIo(FieldIo< D > const &fieldIo)
Create association with FieldIo (store pointer).
void allocate(int nMonomer, int nBasis, IntVec< D > const &dimensions)
Allocate memory for all fields.
DArray< DArray< double > > const & basis() const
Get array of all fields in basis format.
bool isSymmetric() const
Are fields symmetric under all elements of the space group?
DArray< RField< D > > const & rgrid() const
Get array of all fields in r-space grid format.
bool isAllocatedBasis() const
Has memory been allocated for fields in basis format?
bool isAllocatedRGrid() const
Has memory been allocated for fields in r-grid format?
void readRGrid(std::istream &in, UnitCell< D > &unitCell, bool isSymmetric=false)
Reads fields from an input stream in real-space (r-grid) format.
void symmetrize()
Symmetrize r-grid fields, compute corresponding basis components.
void readBasis(std::istream &in, UnitCell< D > &unitCell)
Read field component values from input stream, in symmetrized Fourier format.
WFieldContainer()
Constructor.
void setBasis(DArray< DArray< double > > const &fields)
Set field component values, in symmetrized Fourier format.
bool hasData() const
Has field data been set in either format?
void allocateRGrid(IntVec< D > const &dimensions)
Allocate or re-allocate memory for fields in rgrid format.
void setRGrid(DArray< RField< D > > const &fields, bool isSymmetric=false)
Set fields values in real-space (r-grid) format.
void deallocateRGrid()
De-allocate fields in rgrid format.
~WFieldContainer()
Destructor.
Dynamically allocatable contiguous array template.
An object that can read multiple parameters from file.
Fields, FFTs, and utilities for periodic boundary conditions (CUDA)
Periodic fields and crystallography.
PSCF package top-level namespace.
Utility classes for scientific computation.