1#ifndef RP_INTRACORRELATION_TPP
2#define RP_INTRACORRELATION_TPP
11#include "IntraCorrelation.h"
13#include <prdc/crystal/shiftToMinimum.h>
14#include <prdc/crystal/UnitCell.h>
16#include <pscf/mesh/Mesh.h>
17#include <pscf/mesh/MeshIterator.h>
18#include <pscf/correlation/Mixture.h>
31 template <
int D,
class T>
33 typename T::System
const &
system)
35 correlationMixturePtr_(nullptr),
38 correlationMixturePtr_
45 template <
int D,
class T>
47 {
delete correlationMixturePtr_; }
52 template <
int D,
class T>
59 if (!correlationMixturePtr_->isAllocated()) {
60 correlationMixturePtr_->allocate();
62 correlationMixturePtr_->setup();
63 correlationMixturePtr_->computeOmegaTotal(Gsq_, correlations);
69 template <
int D,
class T>
72 meshDimensions_ =
system().domain().mesh().dimensions();
75 FFTT::computeKMesh(meshDimensions_, kMeshDimensions_, kSize_);
81 template <
int D,
class T>
90 if (!Gsq_.isAllocated()) {
91 Gsq_.allocate(kSize_);
102 Gmin = shiftToMinimum(G, meshDimensions_, unitCell);
103 Gsq_[iter.
rank()] = unitCell.
ksq(Gmin);
Correlations in a homogeneous ideal gas mixture.
An IntVec<D, T> is a D-component vector of elements of integer type T.
Iterator over points in a Mesh<D>.
int rank() const
Get the rank of current element.
void begin()
Set iterator to the first point in the mesh.
bool atEnd() const
Is this the end (i.e., one past the last point)?
void setDimensions(const IntVec< D > &dimensions)
Set the grid dimensions in all directions.
IntVec< D > position() const
Get current position in the grid, as integer vector.
virtual double ksq(IntVec< D > const &k) const
Compute square magnitude of reciprocal lattice vector.
Base template for UnitCell<D> classes, D=1, 2 or 3.
IntraCorrelation(typename T::System const &system)
Constructor.
T::System const & system() const
Get the parent system by const ref.
void computeGsq()
Compute array of squared wavevectors.
void computeOmegaTotal(Array< typename T::Real > &correlations)
Compute total intramolecular correlation function (all blocks).
void getMeshDimensions()
Get and store r-grid and kgrid-mesh dimensions.
~IntraCorrelation()
Destructor.
Array container class template.
int capacity() const
Return allocated size.
File containing preprocessor macros for error handling.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
Periodic fields and crystallography.
Class templates for real-valued periodic fields.
PSCF package top-level namespace.