1#ifndef FD1D_SOLVENT_TPP
2#define FD1D_SOLVENT_TPP
12#include <fd1d/domain/Domain.h>
46 for (
int i = 0; i < nx; ++i) {
47 cField_[i] = exp(-s*wField[i]);
64 for (
int i = 0; i < nx; ++i) {
65 cField_[i] *= prefactor;
One-dimensional spatial domain and discretization grid.
double spatialAverage(Field const &f) const
Compute spatial average of a field.
int nx() const
Get number of spatial grid points, including both endpoints.
void compute(WField const &wField)
Compute monomer concentration field, q and phi and/or mu.
Domain const & domain() const
Return associated domain by reference.
void setDiscretization(Domain const &domain)
Set association with Domain and allocate concentration field array.
Descriptor for a solvent species.
double size() const
Get the size (number of monomers) in this solvent.
Ensemble ensemble_
Statistical ensemble for this species (open or closed).
double phi_
Volume fraction, set by either setPhi or compute function.
double mu_
Chemical potential, set by either setPhi or compute function.
double q_
Partition function, set by compute function.
void allocate(int capacity)
Allocate the underlying C array.
bool isAllocated() const
Return true if this DArray has been allocated, false otherwise.
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).