PSCF v1.3.1
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// Header file includes
12#include "Polymer.h"
13#include "Solvent.h"
14#include <pscf/solvers/MixtureTmpl.h>
15#include <util/containers/DArray.h>
16
17namespace Pscf {
18namespace R1d
19{
20
21 // Forward declaration
22 class Domain;
23
42 class Mixture : public MixtureTmpl<Polymer, Solvent>
43 {
44
45 public:
46
47 // Public typedefs
48
53
54 // Public member functions
55
59 Mixture();
60
64 ~Mixture();
65
75 void readParameters(std::istream& in);
76
86 void setDomain(Domain const & domain);
87
98 void setKuhn(int monomerId, double kuhn);
99
118 void
119 compute(DArray<FieldT> const & wFields, DArray<FieldT>& cFields);
120
121
122 // Inherited public member functions with non-dependent names
131
132 protected:
133
134 // Inherited protected member functions with non-dependent names
138
139 private:
140
142 double ds_;
143
145 Domain const * domainPtr_;
146
148 Domain const & domain() const;
149
150 };
151
152 // Inline member function
153
154 /*
155 * Get Domain by constant reference (private).
156 */
157 inline Domain const & Mixture::domain() const
158 {
159 UTIL_ASSERT(domainPtr_);
160 return *domainPtr_;
161 }
162
163} // namespace R1d
164} // namespace Pscf
165#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).
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.
Propagator::FieldT 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.
DArray< double > FieldT
Generic field (function of position).
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.
Definition param_pc.dox:1