PSCF v1.4.0
pscf/correlation/Mixture.h
1#ifndef PSCF_CORRELATION_MIXTURE_H
2#define PSCF_CORRELATION_MIXTURE_H
3
4/*
5* PSCF - Mixture 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 <pscf/correlation/Polymer.h>
12#include <util/containers/DArray.h>
13
14// Forward declarations
15namespace Pscf {
16 template <typename WT> class MixtureBase;
17}
18
19namespace Pscf {
20namespace Correlation {
21
22 using namespace Util;
23
29 template <typename WT>
30 class Mixture
31 {
32
33 public:
34
38 Mixture();
39
46
50 ~Mixture();
51
58
68 void allocate();
69
83 void setup();
84
97 void computeOmega(int ma, int mb,
98 Array<double> const & kSq,
99 Array<double> & correlations) const;
100
111 void computeOmegaTotal(Array<double> const & kSq,
112 Array<double> & correlations) const;
113
119 Correlation::Polymer<WT> const & polymer(int i) const;
120
124 MixtureBase<WT> const & mixture() const;
125
129 bool isAllocated() const;
130
131 private:
132
135
137 MixtureBase<WT> const * mixturePtr_;
138
139 };
140
141 // Get a constituent Correlation::Polymer<WT> object by const reference.
142 template <typename WT> inline
144 {
145 UTIL_CHECK(polymers_.isAllocated());
146 return polymers_[i];
147 }
148
149 // Get a descriptor for the parent mixture by const reference.
150 template <typename WT> inline
152 { return *mixturePtr_; }
153
154 // Has this object been allocated?
155 template <typename WT> inline
157 { return polymers_.isAllocated(); }
158
159 // Explicit instantiation declaration
160 extern template class Mixture<double>;
161
162} // namespace Correlation
163} // namespace Pscf
164#endif
Correlations in a homogeneous ideal gas mixture.
void allocate()
Allocate private data structures, set immutable private data.
void setup()
Set mutable private data.
bool isAllocated() const
Has this Mixture been previously allocated?
void associate(MixtureBase< WT > const &mixture)
Create an association with a Mixture.
void computeOmegaTotal(Array< double > const &kSq, Array< double > &correlations) const
Compute total ideal gas density correlation functions.
MixtureBase< WT > const & mixture() const
Return reference to a descriptor for the associated mixture.
void computeOmega(int ma, int mb, Array< double > const &kSq, Array< double > &correlations) const
Compute ideal gas correlation functions for a monomer type pair.
Correlation::Polymer< WT > const & polymer(int i) const
Return reference to a polymer species descriptor.
Intramolecular correlation analysis for one polymer Species.
Abstract descriptor for a mixture of polymer and solvent species.
Definition MixtureBase.h:58
Array container class template.
Definition Array.h:40
Dynamically allocatable contiguous array template.
Definition DArray.h:32
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
Definition global.h:68
Intramolecular correlations in homogeneous systems.
PSCF package top-level namespace.