9#include <r1d/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 FieldT& 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 FieldT& monomerField = cFields[monomerId];
146 for (k = 0; k < nx; ++k) {
147 monomerField[k] += solventField[k];
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 nSolvent() const
Get number of solvent (point particle) species.
SolventT & solvent(int id)
virtual void readParameters(std::istream &in)
Read parameters from file and initialize.
PolymerT & polymer(int id)
void setKuhn(double kuhn)
Set statistical segment length.
One-dimensional spatial domain and discretization grid.
void setKuhn(int monomerId, double kuhn)
Reset statistical segment length for one monomer type.
ScalarParam< Type > & read(std::istream &in, const char *label, Type &value)
Add and read a new required ScalarParam < Type > object.
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.
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.
SCFT with real 1D fields.
PSCF package top-level namespace.