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;
49 template <
int D,
class PT,
class ST>
73 using FieldT =
typename PropagatorT::FieldT;
76 using FFTT =
typename BlockT::FFTT;
192 double phiTot = 1.0);
247 void setKuhn(
int monomerId,
double kuhn);
314 int polymerId,
int blockId,
315 int directionId,
int segmentId)
const;
325 void writeQTail(std::string
const & filename,
int polymerId,
326 int blockId,
int directionId)
const;
336 void writeQ(std::string
const & filename,
int polymerId,
337 int blockId,
int directionId)
const;
357 void writeQAll(std::string
const & basename);
389 {
return *meshPtr_; }
393 {
return *unitCellPtr_; }
397 {
return *fieldIoPtr_; }
444 virtual void eqS(
FieldT& A,
double s)
const = 0;
452 virtual void addEqV(
FieldT& A,
FieldT const & B)
const = 0;
457 virtual void allocateBlocks() = 0;
466 template <
int D,
class PT,
class ST>
471 return stress_[parameterId];
477 template <
int D,
class PT,
class ST>
479 {
return hasStress_; }
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.
typename BlockT::FieldIoT FieldIoT
FieldIo 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 writeStress(std::ostream &out) const
Write stress values to output stream.
void clearUnitCellData()
Clear all data that depends on the unit cell parameters.
void writeQAll(std::string const &basename)
Write all propagators of all blocks, each to a separate file.
void setFieldIo(FieldIoT const &fieldIo)
Create an association with a FieldIoT object.
MixtureTmpl< PT, ST > MixtureTmplT
MixtureTmplT class.
FieldIoT const & fieldIo() const
Return associated FieldIoT by const reference.
virtual void readParameters(std::istream &in)
Read all parameters and initialize.
double ds() const
Return target value for the contour step size ds.
~MixtureReal()
Destructor.
void writeBlockCRGrid(std::string const &filename) const
Write c fields for all blocks and solvents in r-grid format.
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 compute(DArray< FieldT > const &wFields, DArray< FieldT > &cFields, double phiTot=1.0)
Compute partition functions and concentrations.
void setIsSymmetric(bool isSymmetric)
Set the isSymmetric flag true or false.
void createBlockCRGrid(DArray< FieldT > &blockCFields) const
Get c-fields for all blocks and solvents as array of r-grid fields.
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.
void computeStress(double phiTot=1.0)
Compute derivatives of free energy w/ respect to cell parameters.
MixtureReal()
Constructor.
double stress(int parameterId) const
Get derivative of free energy w/ respect to a unit cell parameter.
typename BlockT::FFTT FFTT
WaveList type.
UnitCell< D > const & unitCell() const
Return associated UnitCell<D> by const reference.
typename BlockT::WaveListT WaveListT
WaveList type.
Mesh< D > const & mesh() const
Return associated Mesh<D> by const reference.
void setKuhn(int monomerId, double kuhn)
Reset statistical segment length for one monomer type.
void writeQ(std::string const &filename, int polymerId, int blockId, int directionId) const
Write the complete propagator for one block, in r-grid format.
typename PropagatorT::FieldT FieldT
Field type, for data defined on a real-space grid.
void allocate()
Allocate required internal memory for all solvers.
bool hasStress() const
Has the stress been computed since the last MDE solution?
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.