PSCF v1.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 "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 R1d
19{
20
21 class Domain;
22
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
119 void
120 compute(DArray<FieldT> const & wFields, DArray<FieldT>& cFields);
121
122
123 // Inherited public member functions with non-dependent names
132
133 protected:
134
135 // Inherited protected member functions with non-dependent names
139
140 private:
141
143 double ds_;
144
146 Domain const * domainPtr_;
147
149 Domain const & domain() const;
150
151 };
152
153 // Inline member function
154
155 /*
156 * Get Domain by constant reference (private).
157 */
158 inline Domain const & Mixture::domain() const
159 {
160 UTIL_ASSERT(domainPtr_);
161 return *domainPtr_;
162 }
163
164} // namespace R1d
165} // namespace Pscf
166#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.
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