PSCF v1.3
|
MDE solver for one-direction of one block. More...
#include <Propagator.h>
Public Types | |
typedef DArray< double > | FieldT |
Generic field (function of position). | |
typedef DArray< double > | QFieldT |
Propagator q-field type. |
Public Member Functions | |
Propagator () | |
Constructor. | |
~Propagator () | |
Destructor. | |
void | setBlock (Block &block) |
Associate this propagator with a block. | |
void | allocate (int ns, int nx) |
Set discretization and allocate memory. | |
void | reallocate (int ns) |
Reallocate memory used by this propagator. | |
void | solve () |
Solve the modified diffusion equation (MDE) for this block. | |
void | solve (const QFieldT &head) |
Solve the MDE for a specified initial condition. | |
double | computeQ () |
Compute and return partition function for the molecule. | |
QFieldT const & | q (int i) const |
Return q-field at specified step. | |
QFieldT const & | head () const |
Return q-field at beginning of block (initial condition). | |
QFieldT const & | tail () const |
Return q-field at end of block. | |
int | ns () const |
Number of values of s (or slices), including head and tail. | |
bool | isAllocated () const |
Has memory been allocated for this propagator? | |
Public Member Functions inherited from Pscf::PropagatorTmpl< Propagator > | |
PropagatorTmpl () | |
Constructor. | |
void | setDirectionId (int directionId) |
Associate this propagator with a direction index. | |
void | setPartner (const Propagator &partner) |
Set the partner of this propagator. | |
void | addSource (const Propagator &source) |
Add a propagator to the list of sources for this one. | |
void | setIsSolved (bool isSolved) |
Set the isSolved flag to true or false. | |
void | setEndFlags (bool isHeadEnd, bool isTailEnd) |
Set flags indicating whether vertices are chain ends. | |
const Propagator & | source (int id) const |
Get a source propagator. | |
const Propagator & | partner () const |
Get partner propagator. | |
int | directionId () const |
Get direction index for this propagator. | |
int | nSource () const |
Number of source / prerequisite propagators. | |
bool | hasPartner () const |
Does this have a partner propagator? | |
bool | isHeadEnd () const |
Is the head vertex a chain end? | |
bool | isTailEnd () const |
Is the tail vertex a chain end? | |
bool | isSolved () const |
Has the modified diffusion equation been solved? | |
bool | isReady () const |
Are all source propagators solved? |
MDE solver for one-direction of one block.
Definition at line 26 of file r1d/solvers/Propagator.h.
typedef DArray<double> Pscf::R1d::Propagator::FieldT |
Generic field (function of position).
Definition at line 36 of file r1d/solvers/Propagator.h.
typedef DArray<double> Pscf::R1d::Propagator::QFieldT |
Propagator q-field type.
Definition at line 41 of file r1d/solvers/Propagator.h.
Pscf::R1d::Propagator::Propagator | ( | ) |
Constructor.
Definition at line 21 of file r1d/solvers/Propagator.cpp.
Pscf::R1d::Propagator::~Propagator | ( | ) |
Destructor.
Definition at line 31 of file r1d/solvers/Propagator.cpp.
|
inline |
Associate this propagator with a block.
block | associated Block object. |
Definition at line 220 of file r1d/solvers/Propagator.h.
void Pscf::R1d::Propagator::allocate | ( | int | ns, |
int | nx ) |
Set discretization and allocate memory.
ns | number of contour length steps |
nx | number of spatial steps |
Definition at line 37 of file r1d/solvers/Propagator.cpp.
References ns().
void Pscf::R1d::Propagator::reallocate | ( | int | ns | ) |
Reallocate memory used by this propagator.
This function is used when the value of ns is changed, which occurs during some parameter sweeps.
The parameter ns is the number of values of s at which q(r,s) is calculated, including the end values at the terminating vertices. This is one more than the number of contour variable steps.
ns | number of slices (including end points) |
Definition at line 51 of file r1d/solvers/Propagator.cpp.
References ns(), Pscf::PropagatorTmpl< Propagator >::setIsSolved(), and UTIL_CHECK.
void Pscf::R1d::Propagator::solve | ( | ) |
Solve the modified diffusion equation (MDE) for this block.
This function computes an initial q-field at the head of this block, and then solves the modified diffusion equation for the block to propagate from the head to the tail. The initial q-field at the head is computed by pointwise multiplication of of the tail q-field of all source propagators.
Definition at line 107 of file r1d/solvers/Propagator.cpp.
References Pscf::PropagatorTmpl< Propagator >::setIsSolved().
void Pscf::R1d::Propagator::solve | ( | const QFieldT & | 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 q-field at head of block |
Definition at line 119 of file r1d/solvers/Propagator.cpp.
References head(), and Pscf::PropagatorTmpl< Propagator >::setIsSolved().
double Pscf::R1d::Propagator::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 initial/head Qfield for this propagator and the final/tail Qfield of its partner.
Definition at line 137 of file r1d/solvers/Propagator.cpp.
References Pscf::PropagatorTmpl< Propagator >::hasPartner(), head(), Pscf::PropagatorTmpl< Propagator >::isSolved(), Pscf::PropagatorTmpl< Propagator >::partner(), and UTIL_THROW.
|
inline |
Return q-field at specified step.
i | step index |
Definition at line 199 of file r1d/solvers/Propagator.h.
Referenced by Pscf::R1d::Block::computeConcentration(), Pscf::R1d::System::writeQ(), and Pscf::R1d::System::writeQSlice().
|
inline |
Return q-field at beginning of block (initial condition).
Definition at line 187 of file r1d/solvers/Propagator.h.
Referenced by computeQ(), and solve().
|
inline |
Return q-field at end of block.
Definition at line 193 of file r1d/solvers/Propagator.h.
|
inline |
Number of values of s (or slices), including head and tail.
The value of ns is the number of values of s at which q(r,s) is calculated, including the end values at the terminating vertices (the head and tail). This is one more than the number of contour variable steps.
Definition at line 214 of file r1d/solvers/Propagator.h.
Referenced by allocate(), reallocate(), and Pscf::R1d::System::writeQ().
bool Pscf::R1d::Propagator::isAllocated | ( | ) | const |
Has memory been allocated for this propagator?
Definition at line 74 of file r1d/solvers/Propagator.cpp.