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,
class TT>
84 using FFTT =
typename TT::FFT;
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,
class TT>
476 {
return hasStress_; }
481 template <
int D,
class PT,
class ST,
class TT>
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
PT PolymerT
Polymer species solver type.
PolymerT & polymer(int id)
MixtureTmpl()
Constructor.
SolventSpecies const & solventSpecies(int id) const final
ST SolventT
Solvent species solver type.
void createBlockCRGrid(DArray< FieldT > &blockCFields) const
Get c-fields for all blocks and solvents as array of r-grid fields.
MixturePrdc()
Constructor.
~MixturePrdc()
Destructor.
void setFieldIo(FieldIoT const &fieldIo)
Create an association with a FieldIoT object.
void allocate()
Allocate required internal memory for all solvers.
virtual void readParameters(std::istream &in)
Read all parameters and initialize.
void computeStress(double phiTot=1.0)
Compute derivatives of free energy w/ respect to cell parameters.
void writeQAll(std::string const &basename)
Write all propagators of all blocks, each to a separate file.
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 associate(Mesh< D > const &mesh, FFTT const &fft, UnitCell< D > const &cell, WaveListT &waveList)
Create associations with Mesh, FFT, UnitCell, and WaveList objects.
typename TT::FieldIo FieldIoT
FieldIo type.
void clearUnitCellData()
Clear all data that depends on the unit cell parameters.
double ds() const
Return target value for the contour step size ds.
UnitCell< D > const & unitCell() const
Return associated UnitCell<D> by const reference.
typename TT::Propagator PropagatorT
Propagator type, for one direction within a block.
bool hasStress() const
Has the stress been computed since the last MDE solution?
typename TT::FFT FFTT
WaveList type.
FieldIoT const & fieldIo() const
Return associated FieldIoT by const reference.
typename TT::RField FieldT
Field type, for data defined on a real-space grid.
void setIsSymmetric(bool isSymmetric)
Set the isSymmetric flag true or false.
Mesh< D > const & mesh() const
Return associated Mesh<D> by const reference.
void compute(DArray< FieldT > const &wFields, DArray< FieldT > &cFields, double phiTot=1.0)
Compute partition functions and concentrations.
void writeStress(std::ostream &out) const
Write stress values to output stream.
typename TT::WaveList WaveListT
WaveList type.
typename TT::Block BlockT
Block type, for a block in a block polymer.
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 writeQ(std::string const &filename, int polymerId, int blockId, int directionId) const
Write the complete propagator for one block, in r-grid format.
void setKuhn(int monomerId, double kuhn)
Reset statistical segment length for one monomer type.
double stress(int parameterId) const
Get derivative of free energy w/ respect to a unit cell parameter.
void writeBlockCRGrid(std::string const &filename) const
Write c fields for all blocks and solvents in r-grid format.
MixtureTmpl< PT, ST > MixtureTmplT
MixtureTmplT class.
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.