1#ifndef PRDC_MIXTURE_REAL_H
2#define PRDC_MIXTURE_REAL_H
11#include <pscf/solvers/MixtureTmpl.h>
12#include <util/containers/FSArray.h>
17 template <
typename T>
class DArray;
20 template <
int D>
class Mesh;
57 template <
int D,
class PT,
class ST>
81 using FieldT =
typename PropagatorT::FieldT;
84 using FFTT =
typename BlockT::FFTT;
200 double phiTot = 1.0);
255 void setKuhn(
int monomerId,
double kuhn);
322 int polymerId,
int blockId,
323 int directionId,
int segmentId)
const;
333 void writeQTail(std::string
const & filename,
int polymerId,
334 int blockId,
int directionId)
const;
344 void writeQ(std::string
const & filename,
int polymerId,
345 int blockId,
int directionId)
const;
365 void writeQAll(std::string
const & basename);
397 {
return *meshPtr_; }
401 {
return *unitCellPtr_; }
405 {
return *fieldIoPtr_; }
452 virtual void eqS(
FieldT& A,
double s)
const = 0;
460 virtual void addEqV(
FieldT& A,
FieldT const & B)
const = 0;
465 virtual void allocateBlocks() = 0;
474 template <
int D,
class PT,
class ST>
476 {
return hasStress_; }
481 template <
int D,
class PT,
class ST>
486 return stress_[parameterId];
Description of a regular grid of points in a periodic domain.
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).
bool isCanonical() const
Is this mixture being treated in canonical ensemble?
SolventT & solvent(int id)
PolymerSpecies const & polymerSpecies(int id) const final
typename PT::BlockT BlockT
Block polymer block type.
PT PolymerT
Polymer species solver type.
PolymerT & polymer(int id)
MixtureTmpl()
Constructor.
SolventSpecies const & solventSpecies(int id) const final
typename BlockT::PropagatorT PropagatorT
Polymer block propagator type.
ST SolventT
Solvent species solver type.
void setIsSymmetric(bool isSymmetric)
Set the isSymmetric flag true or false.
void writeBlockCRGrid(std::string const &filename) const
Write c fields for all blocks and solvents in r-grid format.
void writeQ(std::string const &filename, int polymerId, int blockId, int directionId) const
Write the complete propagator for one block, in r-grid format.
MixtureTmpl< PT, ST > MixtureTmplT
MixtureTmplT class.
void compute(DArray< FieldT > const &wFields, DArray< FieldT > &cFields, double phiTot=1.0)
Compute partition functions and concentrations.
UnitCell< D > const & unitCell() const
Return associated UnitCell<D> by const reference.
void writeQAll(std::string const &basename)
Write all propagators of all blocks, each to a separate file.
typename BlockT::FFTT FFTT
WaveList type.
void associate(Mesh< D > const &mesh, FFTT const &fft, UnitCell< D > const &cell, WaveListT &waveList)
Create associations with Mesh, FFT, UnitCell, and WaveList objects.
void createBlockCRGrid(DArray< FieldT > &blockCFields) const
Get c-fields for all blocks and solvents as array of r-grid fields.
void setKuhn(int monomerId, double kuhn)
Reset statistical segment length for one monomer type.
bool hasStress() const
Has the stress been computed since the last MDE solution?
typename BlockT::WaveListT WaveListT
WaveList type.
double ds() const
Return target value for the contour step size ds.
void clearUnitCellData()
Clear all data that depends on the unit cell parameters.
typename BlockT::FieldIoT FieldIoT
FieldIo type.
void writeQSlice(std::string const &filename, int polymerId, int blockId, int directionId, int segmentId) const
Write one slice of a propagator at fixed s in r-grid format.
MixturePrdc()
Constructor.
typename PropagatorT::FieldT FieldT
Field type, for data defined on a real-space grid.
void setFieldIo(FieldIoT const &fieldIo)
Create an association with a FieldIoT object.
void allocate()
Allocate required internal memory for all solvers.
void writeQTail(std::string const &filename, int polymerId, int blockId, int directionId) const
Write the final slice of a propagator in r-grid format.
void writeStress(std::ostream &out) const
Write stress values to output stream.
~MixturePrdc()
Destructor.
virtual void readParameters(std::istream &in)
Read all parameters and initialize.
Mesh< D > const & mesh() const
Return associated Mesh<D> by const reference.
double stress(int parameterId) const
Get derivative of free energy w/ respect to a unit cell parameter.
FieldIoT const & fieldIo() const
Return associated FieldIoT by const reference.
void computeStress(double phiTot=1.0)
Compute derivatives of free energy w/ respect to cell parameters.
Base template for UnitCell<D> classes, D=1, 2 or 3.
Dynamically allocatable contiguous array template.
A fixed capacity (static) contiguous array with a variable logical size.
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_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
Periodic fields and crystallography.
PSCF package top-level namespace.
Utility classes for scientific computation.