1#ifndef PSPG_POLYMER_TPP
2#define PSPG_POLYMER_TPP
12#include <pspg/math/GpuResources.h>
19 { setClassName(
"Polymer"); }
22 Polymer<D>::~Polymer()
26 void Polymer<D>::setPhi(
double phi)
35 void Polymer<D>::setMu(
double mu)
48 for (
int j = 0; j < nBlock(); ++j) {
49 block(j).setupUnitCell(unitCell, wavelist);
61 for (
int j = 0; j < nBlock(); ++j) {
62 monomerId = block(j).monomerId();
63 block(j).setupSolver(wFields[monomerId]);
81 for (
int i = 0; i < nParams_; ++i) {
85 for (
int i = 0; i < nBlock(); ++i) {
86 prefactor = exp(mu_)/length();
87 block(i).computeStress(wavelist, prefactor);
89 for (
int j=0; j < nParams_; ++j){
90 stress_ [j] += block(i).stress(j);
void setupUnitCell(UnitCell< D > const &unitCell, WaveList< D > const &wavelist)
Compute solution to MDE and concentrations.
void compute(DArray< RDField< D > > const &wFields)
Compute solution to MDE and concentrations.
void computeStress(WaveList< D > const &wavelist)
Compute stress from a polymer chain, needs a pointer to basis.
Field of real single precision values on an FFT mesh on a device.
Container for wavevector data.
int nParameter() const
Get the number of parameters in the unit cell.
Base template for UnitCell<D> classes, D=1, 2 or 3.
Dynamically allocatable contiguous array template.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
C++ namespace for polymer self-consistent field theory (PSCF).