PSCF v1.1
fd1d/solvers/Solvent.h
1#ifndef FD1D_SOLVENT_H
2#define FD1D_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 <pscf/chem/Species.h> // base class
13//#include <util/param/ParamComposite.h> // base class
14#include <fd1d/solvers/Propagator.h>
15#include <fd1d/domain/Domain.h>
16
17namespace Pscf {
18namespace Fd1d {
19
20 using namespace Util;
21
28 //class Solvent : public Species, public ParamComposite
30 {
31
32 public:
33
37 typedef typename Propagator::CField CField;
38
42 typedef typename Propagator::WField WField;
43
47 Solvent();
48
52 ~Solvent();
53
59 void setDiscretization(Domain const & domain);
60
68 void compute(WField const & wField );
69
72
76 Domain const & domain() const;
77
81 const CField& cField() const;
82
84
85 // Inherited accessor functions
88 using Pscf::Species::q;
90
91 protected:
92
93 // Inherited data members
100
101 private:
102
103 // Concentration field for this solvent
104 CField cField_;
105
106 // Pointer to associated domain
107 Domain const * domainPtr_;
108
109 };
110
111 // Inline member functions
112
114 inline const typename Solvent::CField& Solvent::cField() const
115 { return cField_; }
116
118 inline Domain const & Solvent::domain() const
119 {
120 UTIL_ASSERT(domainPtr_);
121 return *domainPtr_;
122 }
123
124}
125}
126#endif
One-dimensional spatial domain and discretization grid.
Solver and descriptor for a solvent species.
Propagator::CField CField
Monomer concentration field type.
void compute(WField const &wField)
Compute monomer concentration field, q and phi and/or mu.
const CField & cField() const
Get monomer concentration field for this solvent.
Domain const & domain() const
Return associated domain by reference.
void setDiscretization(Domain const &domain)
Set association with Domain and allocate concentration field array.
Propagator::WField WField
Monomer chemical potential field type.
Descriptor for a solvent species.
double size_
Size of this block = volume / monomer reference volume.
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.
#define UTIL_ASSERT(condition)
Assertion macro suitable for debugging serial or parallel code.
Definition: global.h:75
C++ namespace for polymer self-consistent field theory (PSCF).
Utility classes for scientific computation.
Definition: accumulators.mod:1