PSCF v1.4.0
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}
24
25namespace Pscf {
26namespace R1d {
27
46 class Mixture : public MixtureTmpl<Polymer, Solvent>
47 {
48
49 public:
50
51 // Public typedefs
52
57
58 // Public member functions
59
63 Mixture();
64
68 ~Mixture();
69
79 void readParameters(std::istream& in);
80
90 void setDomain(Domain const & domain);
91
102 void setKuhn(int monomerId, double kuhn);
103
122 void
123 compute(DArray<FieldT> const & wFields, DArray<FieldT>& cFields);
124
125
126 // Inherited public member functions with non-dependent names
135
136 protected:
137
138 // Inherited protected member functions with non-dependent names
142
143 private:
144
146 double ds_;
147
149 Domain const * domainPtr_;
150
152 Domain const & domain() const;
153
154 };
155
156 // Inline member function
157
158 /*
159 * Get Domain by constant reference (private).
160 */
161 inline Domain const & Mixture::domain() const
162 {
163 UTIL_ASSERT(domainPtr_);
164 return *domainPtr_;
165 }
166
167} // namespace R1d
168} // namespace Pscf
169
170// Explicit instantiation declaration
171namespace Pscf {
173}
174#endif
Monomer const & monomer(int id) const
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.