PSCF v1.3
MixtureBase.h
1#ifndef PSCF_MIXTURE_BASE_H
2#define PSCF_MIXTURE_BASE_H
3
4/*
5* PSCF - Polymer 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/chem/Monomer.h>
12#include <util/containers/DArray.h>
13
14namespace Pscf
15{
16
17 class PolymerSpecies;
18 class SolventSpecies;
19
20 using namespace Util;
21
57 {
58
59 public:
60
65
70
76 void setVmonomer(double vMonomer);
77
80
84 int nMonomer() const;
85
89 int nPolymer() const;
90
94 int nSolvent() const;
95
99 int nBlock() const;
100
104 double vMonomer() const;
105
113 bool isCanonical() const;
114
118
124 Monomer const & monomer(int id) const;
125
131 virtual
132 PolymerSpecies const & polymerSpecies(int id) const = 0;
133
139 virtual
140 SolventSpecies const & solventSpecies(int id) const = 0;
141
143
144 protected:
145
151 Monomer& monomer(int id);
152
157
162
167
172
177
181 double vMonomer_;
182
183 };
184
185 // Inline public member functions
186
187 inline int MixtureBase::nMonomer() const
188 { return nMonomer_; }
189
190 inline int MixtureBase::nPolymer() const
191 { return nPolymer_; }
192
193 inline int MixtureBase::nSolvent() const
194 { return nSolvent_; }
195
196 inline int MixtureBase::nBlock() const
197 { return nBlock_; }
198
199 inline
201 { return vMonomer_; }
202
203 inline
204 Monomer const & MixtureBase::monomer(int id) const
205 {
206 UTIL_CHECK(id < nMonomer_);
207 return monomers_[id];
208 }
209
210 // Inline protected member function
211
212 inline
214 {
215 UTIL_CHECK(id < nMonomer_);
216 return monomers_[id];
217 }
218
219}
220#endif
virtual SolventSpecies const & solventSpecies(int id) const =0
Set a solvent solver object by const reference.
int nMonomer_
Number of monomer types.
int nPolymer_
Number of polymer species.
int nBlock_
Number of blocks total, across all polymers.
virtual PolymerSpecies const & polymerSpecies(int id) const =0
Get a PolymerSpecies by const reference.
int nPolymer() const
Get number of polymer species.
Monomer const & monomer(int id) const
Get a Monomer type descriptor by const reference.
int nSolvent_
Number of solvent species.
void setVmonomer(double vMonomer)
Set new vMonomer value.
int nMonomer() const
Get number of monomer types.
int nBlock() const
Get total number blocks among all polymer species.
double vMonomer_
Monomer reference volume (set to 1.0 by default).
int nSolvent() const
Get number of solvent (point particle) species.
MixtureBase()
Constructor.
double vMonomer() const
Get monomer reference volume (set to 1.0 by default).
DArray< Monomer > monomers_
Array of monomer type descriptors.
bool isCanonical() const
Is this mixture being treated in canonical ensemble?
~MixtureBase()
Destructor.
Descriptor for a monomer type.
Definition Monomer.h:39
Descriptor for a linear or acyclic branched block polymer.
Descriptor for a solvent species.
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
PSCF package top-level namespace.
Definition param_pc.dox:1