PSCF v1.3
rpc/solvers/Solvent.h
1#ifndef RPC_SOLVENT_H
2#define RPC_SOLVENT_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/SolventSpecies.h> // base class
12#include <prdc/cpu/RField.h> // member
13
14// Forward declarations
15namespace Pscf {
16 template <int D> class Mesh;
17}
18
19namespace Pscf {
20namespace Rpc {
21
22 using namespace Util;
23 using namespace Prdc;
24 using namespace Prdc::Cpu;
25
32 template <int D>
33 class Solvent : public SolventSpecies
34 {
35
36 public:
37
41 Solvent();
42
46 ~Solvent();
47
53 void associate(Mesh<D> const & mesh);
54
58 void allocate();
59
77 void compute(RField<D> const & wField, double phiTot = 1.0);
78
82 RField<D> const & cField() const;
83
84 // Inherited accessor functions
87 using Pscf::Species::q;
91
92 protected:
93
94 // Inherited protected functions
96
97 private:
98
100 RField<D> cField_;
101
103 Mesh<D> const * meshPtr_;
104
105 };
106
107 // Inline member function
108
109 /*
110 * Get monomer concentration field for this solvent.
111 */
112 template <int D>
113 inline RField<D> const & Solvent<D>::cField() const
114 { return cField_; }
115
116 #ifndef RPC_SOLVENT_TPP
117 // Supress implicit instantiation
118 extern template class Solvent<1>;
119 extern template class Solvent<2>;
120 extern template class Solvent<3>;
121 #endif
122
123}
124}
125#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 cpu/RField.h:29
Solver and descriptor for a solvent species.
void associate(Mesh< D > const &mesh)
Create an association with the mesh.
RField< D > const & cField() const
Get the monomer concentration field for this solvent.
void compute(RField< D > const &wField, double phiTot=1.0)
Compute monomer concentration field, q and phi and/or mu.
void allocate()
Allocate memory for concentrationf field.
SolventSpecies()
Constructor.
int monomerId() const
Get the monomer type id.
double size() const
Get the size (number of monomers) in this solvent.
double phi() const
Get the overall volume fraction for this species.
Definition Species.h:149
void setQ(double q)
Set q and compute phi or mu (depending on the ensemble).
Definition Species.cpp:63
double mu() const
Get the chemical potential for this species (units kT=1).
Definition Species.h:155
Ensemble ensemble() const
Get the statistical ensemble for this species (open or closed).
Definition Species.h:167
double q() const
Get the molecular partition function for this species.
Definition Species.h:161
Periodic fields and crystallography.
Definition CField.cpp:11
Real periodic fields, SCFT and PS-FTS (CPU).
Definition param_pc.dox:2
PSCF package top-level namespace.
Definition param_pc.dox:1