PSCF v1.1
|
MDE solver for one-direction of one block. More...
#include <Propagator.h>
Public Types | |
typedef RDField< D > | Field |
Generic field (function of position). More... | |
typedef RDField< D > | WField |
Chemical potential field type. More... | |
typedef RDField< D > | CField |
Monomer concentration field type. More... | |
typedef RDField< D > | QField |
Propagator q-field type. More... | |
Public Member Functions | |
Propagator () | |
Constructor. More... | |
~Propagator () | |
Destructor. More... | |
void | setBlock (Block< D > &block) |
Associate this propagator with a block. More... | |
void | allocate (int ns, const Mesh< D > &mesh) |
Associate this propagator with a block. More... | |
void | solve () |
Solve the modified diffusion equation (MDE) for this block. More... | |
void | solve (const cudaReal *head) |
Solve the MDE for a specified initial condition. More... | |
double | computeQ () |
Compute and return partition function for the molecule. More... | |
const cudaReal * | q (int i) const |
Return q-field at specified step. More... | |
cudaReal * | head () const |
Return q-field at beginning of block (initial condition). More... | |
const cudaReal * | tail () const |
Return q-field at end of block. More... | |
Block< D > & | block () |
Get the associated Block object by reference. More... | |
Block< D > const & | block () const |
Get the associated Block object by const reference. More... | |
int | ns () const |
Get the number of contour grid points. More... | |
bool | isAllocated () const |
Has memory been allocated for this propagator? More... | |
Public Member Functions inherited from Pscf::PropagatorTmpl< Propagator< D > > | |
PropagatorTmpl () | |
Constructor. More... | |
void | setDirectionId (int directionId) |
Associate this propagator with a direction index. More... | |
void | setPartner (const Propagator< D > &partner) |
Set the partner of this propagator. More... | |
void | addSource (const Propagator< D > &source) |
Add a propagator to the list of sources for this one. More... | |
void | setIsSolved (bool isSolved) |
Set the isSolved flag to true or false. More... | |
const Propagator< D > & | source (int id) const |
Get a source propagator. More... | |
const Propagator< D > & | partner () const |
Get partner propagator. More... | |
int | directionId () const |
Get direction index for this propagator. More... | |
int | nSource () const |
Number of source / prerequisite propagators. More... | |
bool | hasPartner () const |
Does this have a partner propagator? More... | |
bool | isSolved () const |
Has the modified diffusion equation been solved? More... | |
bool | isReady () const |
Are all source propagators are solved? More... | |
Protected Member Functions | |
void | computeHead () |
Compute initial QField at head from tail QFields of sources. More... | |
MDE solver for one-direction of one block.
A fully initialized Propagator<D> has an association with a Block<D> that owns this propagator and its partner, and has an association with a Mesh<D> that describes a spatial grid, in addition to associations with partner and source Propagator<D> objects that are managed by the PropagatorTmpl base class template.
The associated Block<D> stores information required to numerically solve the modified diffusion equation (MDE), including the contour step size ds and all parameters that depend on ds. These quantities are set and stored by the block because their values must be the same for the two propagators owned by each block (i.e., this propagator and its partner). The algorithm used by a propagator to solve the the MDE simply repeatedly calls the step() function of the associated block, because that function has access to all the parameters used in the numerical solution.
Definition at line 46 of file pspg/solvers/Propagator.h.
typedef RDField<D> Pscf::Pspg::Propagator< D >::Field |
Generic field (function of position).
Definition at line 56 of file pspg/solvers/Propagator.h.
typedef RDField<D> Pscf::Pspg::Propagator< D >::WField |
Chemical potential field type.
Definition at line 61 of file pspg/solvers/Propagator.h.
typedef RDField<D> Pscf::Pspg::Propagator< D >::CField |
Monomer concentration field type.
Definition at line 66 of file pspg/solvers/Propagator.h.
typedef RDField<D> Pscf::Pspg::Propagator< D >::QField |
Propagator q-field type.
Definition at line 71 of file pspg/solvers/Propagator.h.
Pscf::Pspg::Propagator< D >::Propagator |
Constructor.
Definition at line 31 of file pspg/solvers/Propagator.tpp.
Pscf::Pspg::Propagator< D >::~Propagator |
Destructor.
Definition at line 44 of file pspg/solvers/Propagator.tpp.
|
inline |
Associate this propagator with a block.
block | associated Block object. |
Definition at line 275 of file pspg/solvers/Propagator.h.
void Pscf::Pspg::Propagator< D >::allocate | ( | int | ns, |
const Mesh< D > & | mesh | ||
) |
Associate this propagator with a block.
ns | number of contour length steps |
mesh | spatial discretization mesh |
Definition at line 53 of file pspg/solvers/Propagator.tpp.
References Pscf::Pspg::ThreadGrid::nBlocks(), Pscf::Pspg::ThreadGrid::setThreadsLogical(), and Pscf::Mesh< D >::size().
void Pscf::Pspg::Propagator< D >::solve |
Solve the modified diffusion equation (MDE) for this block.
This function computes an initial QField at the head of this propagator, and then solves the modified diffusion equation for the block to propagate from the head to the tail. The initial QField at the head is computed by pointwise multiplication of of the tail QFields of all source propagators.
Definition at line 109 of file pspg/solvers/Propagator.tpp.
References UTIL_CHECK.
void Pscf::Pspg::Propagator< D >::solve | ( | const cudaReal * | head | ) |
Solve the MDE for a specified initial condition.
This function solves the modified diffusion equation for this block with a specified initial condition, which is given by head parameter of the function. The function is intended for use in testing.
head | initial condition of QField at head of block |
Definition at line 132 of file pspg/solvers/Propagator.tpp.
References Pscf::Pspg::ThreadGrid::setThreadsLogical().
double Pscf::Pspg::Propagator< D >::computeQ |
Compute and return partition function for the molecule.
This function computes the partition function Q for the molecule as a spatial average of the product of the initial / head Qfield for this propagator and the final / tail Qfield of its partner.
Definition at line 158 of file pspg/solvers/Propagator.tpp.
References UTIL_THROW.
|
inline |
Return q-field at specified step.
i | step index |
Definition at line 232 of file pspg/solvers/Propagator.h.
Referenced by Pscf::Pspg::Block< D >::computeConcentration(), Pscf::Pspg::System< D >::writeQ(), and Pscf::Pspg::System< D >::writeQSlice().
|
inline |
Return q-field at beginning of block (initial condition).
Definition at line 216 of file pspg/solvers/Propagator.h.
Referenced by Pscf::Pspg::Block< D >::computeStress().
|
inline |
Return q-field at end of block.
Definition at line 224 of file pspg/solvers/Propagator.h.
Referenced by Pscf::Pspg::System< D >::writeQTail().
|
inline |
Get the associated Block object by reference.
Definition at line 240 of file pspg/solvers/Propagator.h.
|
inline |
Get the associated Block object by const reference.
Definition at line 251 of file pspg/solvers/Propagator.h.
|
inline |
Get the number of contour grid points.
Definition at line 262 of file pspg/solvers/Propagator.h.
Referenced by Pscf::Pspg::System< D >::writeQ().
|
inline |
Has memory been allocated for this propagator?
Definition at line 267 of file pspg/solvers/Propagator.h.
|
protected |
Compute initial QField at head from tail QFields of sources.
Definition at line 71 of file pspg/solvers/Propagator.tpp.
References Pscf::Pspg::ThreadGrid::setThreadsLogical(), and UTIL_THROW.