9#include <fd1d/domain/Domain.h>
49 for (j = 0; j <
polymer(i).nBlock(); ++j) {
50 polymer(i).block(j).setDiscretization(domain, ds_);
57 for (
int i = 0; i <
nSolvent(); ++i) {
58 solvent(i).setDiscretization(domain);
73 for (
int i = 0; i <
nPolymer(); ++i) {
74 for (
int j = 0; j <
polymer(i).nBlock(); ++j) {
75 if (monomerId ==
polymer(i).block(j).monomerId()) {
76 polymer(i).block(j).setKuhn(kuhn);
95 int nx = domain().
nx();
100 for (i = 0; i < nm; ++i) {
103 for (j = 0; j < nx; ++j) {
117 for (j = 0; j <
polymer(i).nBlock(); ++j) {
118 int monomerId =
polymer(i).block(j).monomerId();
121 CField& monomerField = cFields[monomerId];
123 for (k = 0; k < nx; ++k) {
124 monomerField[k] += blockField[k];
136 int monomerId =
solvent(i).monomerId();
141 solvent(i).compute(wFields[monomerId]);
144 CField& monomerField = cFields[monomerId];
146 for (k = 0; k < nx; ++k) {
147 monomerField[k] += solventField[k];
One-dimensional spatial domain and discretization grid.
int nx() const
Get number of spatial grid points, including both endpoints.
void readParameters(std::istream &in)
Read all parameters and initialize.
ScalarParam< Type > & read(std::istream &in, const char *label, Type &value)
Add and read a new required ScalarParam < Type > object.
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.
void compute(DArray< WField > const &wFields, DArray< CField > &cFields)
Compute concentrations.
Polymer & polymer(int id)
Get a polymer object.
int nSolvent() const
Get number of solvent (point particle) species.
int nMonomer() const
Get number of monomer types.
Monomer const & monomer(int id) const
Get a Monomer type descriptor (const reference).
Solvent & solvent(int id)
Set a solvent solver object.
virtual void readParameters(std::istream &in)
Read parameters from file and initialize.
int nPolymer() const
Get number of polymer species.
void setKuhn(double kuhn)
Set statistical segment length.
int capacity() const
Return allocated size.
Dynamically allocatable contiguous array template.
void setClassName(const char *className)
Set class name string.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
C++ namespace for polymer self-consistent field theory (PSCF).