PSCF v1.5.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 - 2026, David Morse (morse012@um.edu) and co-authors
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 Composition;
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
60
70 void allocate();
71
85 void setup();
86
99 void computeOmega(int ma, int mb,
100 Array<double> const & kSq,
101 Array<double> & correlations) const;
102
113 void computeOmegaTotal(Array<double> const & kSq,
114 Array<double> & correlations) const;
115
121 Correlation::Polymer<WT> const & polymer(int i) const;
122
126 Composition<WT> const & mixture() const;
127
131 bool isAllocated() const;
132
133 private:
134
137
139 Composition<WT> const * mixturePtr_;
140
141 };
142
143 // Get a constituent Correlation::Polymer<WT> object by const reference.
144 template <typename WT> inline
146 {
147 UTIL_CHECK(polymers_.isAllocated());
148 return polymers_[i];
149 }
150
151 // Get a descriptor for the parent mixture by const reference.
152 template <typename WT> inline
154 { return *mixturePtr_; }
155
156 // Has this object been allocated?
157 template <typename WT> inline
159 { return polymers_.isAllocated(); }
160
161 // Explicit instantiation declaration
162 extern template class Mixture<double>;
163
164} // namespace Correlation
165} // namespace Pscf
166#endif
Descriptor for a mixture of polymer and solvent species.
Definition Composition.h:68
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(Composition< 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.
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.
Composition< WT > const & mixture() const
Return reference to a descriptor for the associated mixture.
Intramolecular correlation analysis for one polymer Species.
Array container class template.
Definition Array.h:41
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.