PSCF v1.1
Species.h
1#ifndef PSCF_SPECIES_H
2#define PSCF_SPECIES_H
3
4/*
5* PSCF - Polymer Self-Consistent Field Theory
6*
7* Copyright 2016 - 2022, The Regents of the University of Minnesota
8* Distributed under the terms of the GNU General Public License.
9*/
10
11#include <util/global.h>
12namespace Pscf
13{
14
29 class Species
30 {
31 public:
32
36 enum Ensemble {Unknown, Closed, Open};
37
41 Species();
42
46 double phi() const;
47
51 double mu() const;
52
56 double q() const;
57
62
63 protected:
64
68 double phi_;
69
73 double mu_;
74
78 double q_;
79
84
85 };
86
87 /*
88 * Get species volume fraction.
89 */
90 inline double Species::phi() const
91 { return phi_; }
92
93 /*
94 * Get species chemical potential.
95 */
96 inline double Species::mu() const
97 { return mu_; }
98
99 /*
100 * Get statistical ensemble for this species (open or closed).
101 */
103 { return ensemble_; }
104
112 std::istream& operator >> (std::istream& in, Species::Ensemble& policy);
113
121 std::ostream& operator << (std::ostream& out, Species::Ensemble policy);
122
130 template <class Archive>
131 void serialize(Archive& ar, Species::Ensemble& policy,
132 const unsigned int version)
133 { serializeEnum(ar, policy, version); }
134
135}
136#endif
Base class for a molecular species (polymer or solvent).
Definition: Species.h:30
double phi() const
Get the overall volume fraction for this species.
Definition: Species.h:90
Ensemble ensemble_
Statistical ensemble for this species (open or closed).
Definition: Species.h:83
Ensemble ensemble()
Get the statistical ensemble for this species (open or closed).
Definition: Species.h:102
double phi_
Volume fraction, set by either setPhi or compute function.
Definition: Species.h:68
double mu_
Chemical potential, set by either setPhi or compute function.
Definition: Species.h:73
double q_
Partition function, set by compute function.
Definition: Species.h:78
double mu() const
Get the chemical potential for this species (units kT=1).
Definition: Species.h:96
Species()
Default constructor.
Definition: Species.cpp:15
double q() const
Get the molecular partition function for this species.
Ensemble
Statistical ensemble for number of molecules.
Definition: Species.h:36
File containing preprocessor macros for error handling.
void serializeEnum(Archive &ar, T &data, const unsigned int version=0)
Serialize an enumeration value.
Definition: serialize.h:42
C++ namespace for polymer self-consistent field theory (PSCF).
std::istream & operator>>(std::istream &in, Pair< Data > &pair)
Input a Pair from an istream.
Definition: Pair.h:44
std::ostream & operator<<(std::ostream &out, const Pair< Data > &pair)
Output a Pair to an ostream, without line breaks.
Definition: Pair.h:57