PSCF v1.3.3
r1d/solvers/Mixture.h
1#ifndef R1D_MIXTURE_H
2#define R1D_MIXTURE_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/solvers/MixtureTmpl.h> // base class
12
13// Forward declarations
14namespace Util {
15 template <typename T> class DArray;
16}
17namespace Pscf {
18 namespace R1d {
19 class Domain;
20 class Polymer;
21 class Solvent;
22 }
23 extern template class MixtureTmpl<R1d::Polymer, R1d::Solvent>;
24}
25
26namespace Pscf {
27namespace R1d {
28
48 {
49
50 public:
51
52 // Public typedefs
53
58
59 // Public member functions
60
64 Mixture();
65
69 ~Mixture();
70
80 void readParameters(std::istream& in);
81
91 void setDomain(Domain const & domain);
92
103 void setKuhn(int monomerId, double kuhn);
104
123 void
124 compute(DArray<FieldT> const & wFields, DArray<FieldT>& cFields);
125
126
127 // Inherited public member functions with non-dependent names
136
137 protected:
138
139 // Inherited protected member functions with non-dependent names
143
144 private:
145
147 double ds_;
148
150 Domain const * domainPtr_;
151
153 Domain const & domain() const;
154
155 };
156
157 // Inline member function
158
159 /*
160 * Get Domain by constant reference (private).
161 */
162 inline Domain const & Mixture::domain() const
163 {
164 UTIL_ASSERT(domainPtr_);
165 return *domainPtr_;
166 }
167
168} // namespace R1d
169} // namespace Pscf
170#endif
int nPolymer() const
Get number of polymer species.
Monomer const & monomer(int id) const
Get a Monomer type descriptor by const reference.
int nMonomer() const
Get number of monomer types.
int nBlock() const
Get total number blocks among all polymer species.
int nSolvent() const
Get number of solvent (point particle) species.
double vMonomer() const
Get monomer reference volume (set to 1.0 by default).
Solvers for a mixture of polymer and solvent species.
Definition MixtureTmpl.h:27
One-dimensional spatial domain and discretization grid.
void setKuhn(int monomerId, double kuhn)
Reset statistical segment length for one monomer type.
void compute(DArray< FieldT > const &wFields, DArray< FieldT > &cFields)
Compute concentrations.
void readParameters(std::istream &in)
Read all parameters and initialize.
DArray< double > FieldT
Field type.
void setDomain(Domain const &domain)
Create an association with the domain and allocate memory.
Descriptor and solver for a block polymer species.
Solver and descriptor for a solvent species in a mixture.
Dynamically allocatable contiguous array template.
Definition DArray.h:32
ScalarParam< Type > & read(std::istream &in, const char *label, Type &value)
Add and read a new required ScalarParam < Type > object.
void setClassName(const char *className)
Set class name string.
ScalarParam< Type > & readOptional(std::istream &in, const char *label, Type &value)
Add and read a new optional ScalarParam < Type > object.
#define UTIL_ASSERT(condition)
Assertion macro suitable for debugging serial or parallel code.
Definition global.h:75
SCFT with real 1D fields.
PSCF package top-level namespace.
Utility classes for scientific computation.