11#include <pscf/solvers/MixtureTmpl.h>
12#include <util/containers/FSArray.h>
17 template <
typename T>
class DArray;
20 template <
int D>
class Mesh;
58 template <
int D,
class T>
60 MixtureTmpl<typename T::Polymer, typename T::Solvent, double>
83 using FFTT =
typename T::FFT;
195 double phiTot = 1.0);
250 void setKuhn(
int monomerId,
double kuhn);
317 int polymerId,
int blockId,
318 int directionId,
int segmentId)
const;
328 void writeQTail(std::string
const & filename,
int polymerId,
329 int blockId,
int directionId)
const;
339 void writeQ(std::string
const & filename,
int polymerId,
340 int blockId,
int directionId)
const;
360 void writeQAll(std::string
const & basename);
380 using MixtureBaseT::nMonomer;
381 using MixtureBaseT::monomer;
382 using MixtureBaseT::nPolymer;
383 using MixtureBaseT::nSolvent;
384 using MixtureBaseT::nBlock;
385 using MixtureBaseT::vMonomer;
386 using MixtureBaseT::isCanonical;
402 {
return *meshPtr_; }
406 {
return *unitCellPtr_; }
410 {
return *fieldIoPtr_; }
449 virtual void allocateBlocks() = 0;
458 template <
int D,
class T>
460 {
return hasStress_; }
465 template <
int D,
class T>
470 return stress_[parameterId];
Description of a regular grid of points in a periodic domain.
SolventSpecies< double > const & solventSpecies(int id) const final
PolymerT & polymer(int id)
PolymerSpecies< double > const & polymerSpecies(int id) const final
SolventT & solvent(int id)
MixtureBase< double > MixtureBaseT
Base template for UnitCell<D> classes, D=1, 2 or 3.
typename T::RField FieldT
Field type, for data defined on a real-space grid.
virtual void readParameters(std::istream &in)
Read all parameters and initialize.
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 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.
double stress(int parameterId) const
Get derivative of free energy w/ respect to a unit cell parameter.
void writeStress(std::ostream &out) const
Write stress values to output stream.
void computeStress(double phiTot=1.0)
Compute derivatives of free energy w/ respect to cell parameters.
void setFieldIo(FieldIoT const &fieldIo)
Create an association with a FieldIoT object.
void setIsSymmetric(bool isSymmetric)
Set the isSymmetric flag true or false.
MixtureTmpl< PolymerT, SolventT, double > MixtureTmplT
MixtureTmpl direct (parent) base class.
void allocate()
Allocate required internal memory for all solvers.
typename T::Polymer PolymerT
Polymer object type.
typename T::Propagator PropagatorT
Propagator type, for one direction within a block.
void clearUnitCellData()
Clear all data that depends on the unit cell parameters.
typename T::Solvent SolventT
Solvent object type.
void writeQTail(std::string const &filename, int polymerId, int blockId, int directionId) const
Write the final slice of a propagator in r-grid format.
typename T::WaveList WaveListT
WaveList type.
Mesh< D > const & mesh() const
Return associated Mesh<D> by const reference.
void writeBlockCRGrid(std::string const &filename) const
Write c fields for all blocks and solvents 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 T::Block BlockT
Block type, for a block in a block polymer.
void createBlockCRGrid(DArray< FieldT > &blockCFields) const
Get c-fields for all blocks and solvents as array of r-grid fields.
FieldIoT const & fieldIo() const
Return associated FieldIoT by const reference.
typename MixtureTmplT::MixtureBaseT MixtureBaseT
MixtureBase indirect (grandparent) base class.
void compute(DArray< FieldT > const &wFields, DArray< FieldT > &cFields, double phiTot=1.0)
Compute partition functions and concentrations.
double ds() const
Return target value for the contour step size ds.
typename T::FFT FFTT
WaveList type.
bool hasStress() const
Has the stress been computed since the last MDE solution?
UnitCell< D > const & unitCell() const
Return associated UnitCell<D> by const reference.
void setKuhn(int monomerId, double kuhn)
Reset statistical segment length for one monomer type.
void writeQAll(std::string const &basename)
Write all propagators of all blocks, each to a separate file.
typename T::FieldIo FieldIoT
FieldIo type.
Dynamically allocatable contiguous array template.
A fixed capacity (static) contiguous array with a variable logical size.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
Periodic fields and crystallography.
Class templates for real-valued periodic fields.
PSCF package top-level namespace.
Utility classes for scientific computation.