11#include <util/param/ParamComposite.h>
12#include <r1d/misc/FieldIo.h>
13#include <r1d/solvers/Mixture.h>
14#include <r1d/domain/Domain.h>
15#include <pscf/homogeneous/Mixture.h>
16#include <util/misc/FileMaster.h>
17#include <util/containers/DArray.h>
18#include <util/containers/Array.h>
28 class IteratorFactory;
105 virtual void readParam(std::istream& in);
163 int iterate(
bool isContinuation =
false);
238 void writeW(std::string
const & filename)
const;
245 void writeC(std::string
const & filename)
const;
257 void writeBlockC(std::string
const & filename)
const;
269 int polymerId,
int blockId,
270 int directionId,
int segmentId)
const;
280 void writeQTail(std::string
const & filename,
int polymerId,
281 int blockId,
int directionId)
const;
291 void writeQ(std::string
const & filename,
int polymerId,
292 int blockId,
int directionId)
const;
312 void writeQAll(std::string
const & basename)
const;
545 void allocateFields();
550 void initHomogeneous();
558 void readEcho(std::istream& in, std::string&
string)
const;
582 return *interactionPtr_;
591 return *interactionPtr_;
605 {
return homogeneous_; }
613 return *iteratorPtr_;
620 {
return fileMaster_; }
641 {
return wFields_[id]; }
648 {
return wFields_[id]; }
668 {
return cFields_[id]; }
674 {
return cFields_[id]; }
680 {
return fHelmholtz_; }
686 {
return pressure_; }
A spatially homogeneous mixture.
Flory-Huggins excess free energy model.
One-dimensional spatial domain and discretization grid.
Read and write fields to file.
Factory for subclasses of Iterator.
Base class for iterative solvers for SCF equations.
Mixture of polymers and solvents.
Default Factory for subclasses of Sweep.
Solve a sequence of problems along a line in parameter space.
Main class in SCFT simulation of one system.
void compute()
Solve the modified diffusion equation once, without iteration.
void readParam()
Read input parameters from default param file.
double fHelmholtz() const
Get precomputed Helmholtz free energy per monomer / kT.
double pressure() const
Get precomputed pressure x monomer volume kT.
void writeC(std::string const &filename) const
Write concentration fields in symmetrized basis format.
int iterate(bool isContinuation=false)
Iteratively solve a SCFT problem.
void writeQSlice(std::string const &filename, int polymerId, int blockId, int directionId, int segmentId) const
Write slice of a propagator at fixed s in r-grid format.
Interaction & interaction()
Get interaction (i.e., excess free energy) by reference.
CField & cField(int monomerId)
Get chemical potential field for a specific monomer type.
DArray< CField > & cFields()
Get array of all chemical potential fields.
Homogeneous::Mixture & homogeneous()
Get homogeneous mixture (for reference calculations).
void computeFreeEnergy()
Compute free energy density and pressure for current fields.
void writeW(std::string const &filename) const
Write chemical potential fields in symmetrized basis format.
void readCommands()
Read commands from default command file.
Iterator & iterator()
Get the Iterator by reference.
Domain & domain()
Get spatial domain (including grid info) by reference.
DArray< double > CField
Monomer concentration / volume fraction field type.
void writeQAll(std::string const &basename) const
Write all propagators of all blocks, each to a separate file.
FileMaster & fileMaster()
Get FileMaster by reference.
void setOptions(int argc, char **argv)
Process command line options.
WField & wField(int monomerId)
Get chemical potential field for a specific monomer type.
DArray< WField > & wFields()
Get array of all chemical potential fields.
void writeQ(std::string const &filename, int polymerId, int blockId, int directionId) const
Write one propagator for one block, 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.
DArray< double > WField
Monomer chemical potential field type.
virtual void readParameters(std::istream &in)
Read input parameters (without opening and closing lines).
void writeBlockC(std::string const &filename) const
Write c-fields for all blocks and solvents in r-grid format.
void sweep()
Sweep in parameter space, solving an SCF problem at each point.
DArray< double > Field
Generic Field type.
void writeThermo(std::ostream &out) const
Write thermodynamic properties to a file.
void writeParamNoSweep(std::ostream &out) const
Write parameter file to an ostream, omitting any Sweep block.
Mixture & mixture()
Get Mixture by reference.
Dynamically allocatable contiguous array template.
A FileMaster manages input and output files for a simulation.
An object that can read multiple parameters from file.
#define UTIL_ASSERT(condition)
Assertion macro suitable for debugging serial or parallel code.
PSCF package top-level namespace.
Utility classes for scientific computation.