PSCF v1.1
fd1d/solvers/Mixture.h
1#ifndef FD1D_MIXTURE_H
2#define FD1D_MIXTURE_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 "Polymer.h"
12#include "Solvent.h"
13#include <pscf/solvers/MixtureTmpl.h>
14#include <pscf/inter/Interaction.h>
15#include <util/containers/DArray.h>
16
17namespace Pscf {
18namespace Fd1d
19{
20
21 class Domain;
22
42 class Mixture : public MixtureTmpl<Polymer, Solvent>
43 {
44
45 public:
46
47 // Public typedefs
48
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
124 void
125 compute(DArray<WField> const & wFields, DArray<CField>& cFields);
126
127
128 // Inherited public member functions with non-dependent names
137
138 protected:
139
140 // Inherited protected member functions with non-dependent names
144
145 private:
146
148 double ds_;
149
151 Domain const * domainPtr_;
152
154 Domain const & domain() const;
155
156 };
157
158 // Inline member function
159
160 /*
161 * Get Domain by constant reference (private).
162 */
163 inline Domain const & Mixture::domain() const
164 {
165 UTIL_ASSERT(domainPtr_);
166 return *domainPtr_;
167 }
168
169} // namespace Fd1d
170} // namespace Pscf
171#endif
One-dimensional spatial domain and discretization grid.
Mixture of polymers and solvents.
void readParameters(std::istream &in)
Read all parameters and initialize.
Propagator::CField CField
Monomer concentration or volume fraction field type.
void setKuhn(int monomerId, double kuhn)
Reset statistical segment length for one monomer type.
void setDomain(Domain const &domain)
Create an association with the domain and allocate memory.
Propagator::WField WField
Monomer chemical potential field type.
void compute(DArray< WField > const &wFields, DArray< CField > &cFields)
Compute concentrations.
A mixture of polymer and solvent species.
Definition: MixtureTmpl.h:27
Polymer & polymer(int id)
Get a polymer object.
Definition: MixtureTmpl.h:220
int nBlock() const
Get number of total blocks in the mixture across all polymers.
Definition: MixtureTmpl.h:202
int nSolvent() const
Get number of solvent (point particle) species.
Definition: MixtureTmpl.h:198
double vMonomer() const
Get monomer reference volume (set to 1.0 by default).
Definition: MixtureTmpl.h:248
Polymer Polymer
Polymer species solver typename.
Definition: MixtureTmpl.h:35
int nMonomer() const
Get number of monomer types.
Definition: MixtureTmpl.h:190
Monomer const & monomer(int id) const
Get a Monomer type descriptor (const reference).
Definition: MixtureTmpl.h:206
Solvent & solvent(int id)
Set a solvent solver object.
Definition: MixtureTmpl.h:234
Solvent Solvent
Solvent species solver typename.
Definition: MixtureTmpl.h:40
int nPolymer() const
Get number of polymer species.
Definition: MixtureTmpl.h:194
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
C++ namespace for polymer self-consistent field theory (PSCF).