PSCF v1.4.0
rp/solvers/Solvent.h
1#ifndef RP_SOLVENT_H
2#define RP_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
13// Forward declaration
14namespace Pscf {
15 template <int D> class Mesh;
16}
17
18namespace Pscf {
19namespace Rp {
20
37 template <int D, class T>
38 class Solvent : public SolventSpecies<double>
39 {
40
41 public:
42
45
48
49 // Public member functions
50
58 void associate(Mesh<D> const & mesh);
59
67 void allocate();
68
90 void compute(typename T::RField const & wField, double phiTot = 1.0);
91
98 typename T::RField const & cField() const;
99
100 protected:
101
105 Solvent();
106
110 ~Solvent();
111
112 private:
113
115 typename T::RField cField_;
116
118 Mesh<D> const * meshPtr_;
119
120 };
121
122 /*
123 * Get monomer concentration field for this solvent.
124 */
125 template <int D, class T> inline
126 typename T::RField const & Solvent<D,T>::cField() const
127 { return cField_; }
128
129}
130}
131#endif
Description of a regular grid of points in a periodic domain.
Definition Mesh.h:61
SolventSpecies< double > SolventSpeciesT
Alias for direct (parent) base class.
void compute(typename T::RField const &wField, double phiTot=1.0)
Compute concentration field, q, and phi or mu.
T::RField const & cField() const
Get the monomer concentration field for this solvent.
Species< double > SpeciesT
Alias for indirect (grandparent) base class.
void associate(Mesh< D > const &mesh)
Create an association with a Mesh.
void allocate()
Allocate memory for a concentration field.
Base class for a molecular species (polymer or solvent).
Definition Species.h:35
Class templates for real-valued periodic fields.
PSCF package top-level namespace.