PSCF v1.4.0
cpc/solvers/Solvent.h
1#ifndef CPC_SOLVENT_H
2#define CPC_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/CField.h> // member
13#include <complex>
14
15// Forward declaration
16namespace Pscf {
17 template <int D> class Mesh;
18}
19
20namespace Pscf {
21namespace Cpc {
22
23 using namespace Util;
24 using namespace Prdc;
25 using namespace Prdc::Cpu;
26
33 template <int D>
34 class Solvent
35 : public SolventSpecies< std::complex<double> >
36 {
37
38 public:
39
40 // Typename aliases
41
44
47
48 // Member functions
49
53 Solvent();
54
58 ~Solvent();
59
65 void associate(Mesh<D> const & mesh);
66
70 void allocate();
71
83 void compute(CField<D> const & wField);
84
88 CField<D> const & cField() const;
89
90 // Inherited accessor functions
91 using SpeciesT::phi;
92 using SpeciesT::mu;
93 using SpeciesT::q;
95 using Base::monomerId;
96 using Base::size;
97
98 protected:
99
100 // Inherited protected functions
101 using SpeciesT::setQ;
102
103 private:
104
106 CField<D> cField_;
107
109 Mesh<D> const * meshPtr_;
110
111 };
112
113 // Inline member function
114
115 /*
116 * Get complex monomer concentration field for this solvent.
117 */
118 template <int D>
119 inline CField<D> const & Solvent<D>::cField() const
120 { return cField_; }
121
122 // Explicit instantiation declarations
123 extern template class Solvent<1>;
124 extern template class Solvent<2>;
125 extern template class Solvent<3>;
126
127} // namespace Cpc
128} // namespace Pscf
129#endif
Solver and descriptor for a solvent species.
void associate(Mesh< D > const &mesh)
Create an association with the mesh.
SolventSpecies< std::complex< double > > SpeciesT
Indirect base, a specialization of Pscf::Species.
SolventSpecies< std::complex< double > > Base
Direct base class, a specialization of Pscf::SolventSpecies.
void compute(CField< D > const &wField)
Compute monomer concentration field, q and phi and/or mu.
void allocate()
Allocate memory for concentrationf field.
CField< D > const & cField() const
Get the monomer concentration field for this solvent.
Description of a regular grid of points in a periodic domain.
Definition Mesh.h:61
Field of complex double precision values on an FFT mesh.
Definition cpu/CField.h:29
std::complex< double > q() const
std::complex< double > mu() const
void setQ(std::complex< double > q)
std::complex< double > phi() const
Complex periodic fields, CL-FTS (CPU).
Definition cpc.mod:6
Periodic fields and crystallography.
Definition complex.cpp:11
PSCF package top-level namespace.