1#ifndef RP_INTRACORRELATION_TPP
2#define RP_INTRACORRELATION_TPP
11#include "IntraCorrelation.h"
13#include <rp/system/System.h>
14#include <rp/solvers/Mixture.h>
15#include <rp/field/Domain.h>
17#include <pscf/field/FFT.h>
18#include <pscf/field/RField.h>
19#include <pscf/crystal/shiftToMinimum.h>
20#include <pscf/crystal/UnitCell.h>
22#include <pscf/mesh/Mesh.h>
23#include <pscf/mesh/MeshIterator.h>
24#include <pscf/correlation/Mixture.h>
36 template <
int D,
class T>
39 : systemPtr_(&system),
40 correlationMixturePtr_(nullptr),
43 correlationMixturePtr_
50 template <
int D,
class T>
52 {
delete correlationMixturePtr_; }
57 template<
int D,
class T>
66 correlations_h_.associate(correlations);
67 computeOmegaTotalArray(correlations_h_);
68 correlations = correlations_h_;
69 correlations_h_.dissociate();
75 template <
int D,
class T>
77 IntraCorrelation<D,T>::computeOmegaTotalArray(
Array<RealT>& correlations)
82 if (!correlationMixturePtr_->isAllocated()) {
83 correlationMixturePtr_->allocate();
85 correlationMixturePtr_->setup();
86 correlationMixturePtr_->computeOmegaTotal(Gsq_, correlations);
92 template <
int D,
class T>
93 void IntraCorrelation<D,T>::getMeshDimensions()
95 meshDimensions_ = system().domain().mesh().dimensions();
104 template <
int D,
class T>
105 void IntraCorrelation<D,T>::computeGsq()
113 if (Gsq_.isAllocated()) {
114 if (Gsq_.capacity() != kSize_) {
118 if (!Gsq_.isAllocated()) {
119 Gsq_.allocate(kSize_);
124 UnitCell<D>
const & unitCell = system().domain().unitCell();
126 MeshIterator<D> iter;
127 iter.setDimensions(kMeshDimensions_);
128 for (iter.begin(); !iter.atEnd(); ++iter) {
130 Gmin = shiftToMinimum(G, meshDimensions_, unitCell);
131 Gsq_[iter.rank()] = unitCell.ksq(Gmin);
Correlations in a homogeneous ideal gas mixture.
virtual void computeOmegaTotal(RField< D, T > &correlations)
Compute total intramolecular correlation function (all blocks).
~IntraCorrelation()
Destructor.
IntraCorrelation(System< D, T > const &system)
Constructor.
Base class template for classes that represent a complete system.
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.
Code for programs that simulate real-valued periodic fields.
PSCF package top-level namespace.