PSCF v1.1
pspc/solvers/Solvent.h
1#ifndef PSPC_SOLVENT_H
2#define PSPC_SOLVENT_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 <pscf/chem/SolventDescriptor.h> // base class
12#include <pspc/solvers/Propagator.h> // typedefs
13
14namespace Pscf {
15 template <int D> class Mesh;
16}
17
18namespace Pscf {
19namespace Pspc {
20
21 using namespace Util;
22
29 template <int D>
31 {
32
33 public:
34
38 Solvent();
39
43 ~Solvent();
44
50 void setDiscretization(Mesh<D> const & mesh);
51
69 void compute(RField<D> const & wField, double phiTot = 1.0);
70
74 RField<D> const & cField() const;
75
76 // Inherited accessor functions
79 using Pscf::Species::q;
83
84 protected:
85
86 // Inherited protected data members
93
94 private:
95
97 RField<D> cField_;
98
100 Mesh<D> const * meshPtr_;
101
102 };
103
104 // Inline member function
105
106 /*
107 * Get monomer concentration field for this solvent.
108 */
109 template <int D>
110 inline RField<D> const & Solvent<D>::cField() const
111 { return cField_; }
112
113 #ifndef PSPC_SOLVENT_TPP
114 // Supress implicit instantiation
115 extern template class Solvent<1>;
116 extern template class Solvent<2>;
117 extern template class Solvent<3>;
118 #endif
119
120}
121}
122#endif
Description of a regular grid of points in a periodic domain.
Definition: Mesh.h:61
Field of real double precision values on an FFT mesh.
Definition: RField.h:29
Solver and descriptor for a solvent species.
void compute(RField< D > const &wField, double phiTot=1.0)
Compute monomer concentration field, q and phi and/or mu.
RField< D > const & cField() const
Get the monomer concentration field for this solvent.
void setDiscretization(Mesh< D > const &mesh)
Set association with Mesh and allocate concentration field array.
Descriptor for a solvent species.
double size_
Size of this block = volume / monomer reference volume.
double size() const
Get the size (number of monomers) in this solvent.
int monomerId() const
Get the monomer type id.
int monomerId_
Identifier for the associated monomer type.
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
double q() const
Get the molecular partition function for this species.
C++ namespace for polymer self-consistent field theory (PSCF).
Utility classes for scientific computation.
Definition: accumulators.mod:1