PSCF v1.1
|
MDE solver for one-direction of one block. More...
#include <Propagator.h>
Public Types | |
typedef DArray< double > | Field |
Generic field (function of position). More... | |
typedef DArray< double > | WField |
Chemical potential field type. More... | |
typedef DArray< double > | CField |
Monomer concentration field type. More... | |
typedef DArray< double > | QField |
Propagator q-field type. More... | |
Public Member Functions | |
Propagator () | |
Constructor. More... | |
~Propagator () | |
Destructor. More... | |
void | setBlock (Block &block) |
Associate this propagator with a block. More... | |
void | allocate (int ns, int nx) |
Set discretization and allocate memory. More... | |
void | reallocate (int ns) |
Reallocate memory used by this propagator. More... | |
void | solve () |
Solve the modified diffusion equation (MDE) for this block. More... | |
void | solve (const QField &head) |
Solve the MDE for a specified initial condition. More... | |
double | computeQ () |
Compute and return partition function for the molecule. More... | |
QField const & | q (int i) const |
Return q-field at specified step. More... | |
QField const & | head () const |
Return q-field at beginning of block (initial condition). More... | |
QField const & | tail () const |
Return q-field at end of block. More... | |
int | ns () const |
Number of values of s (or slices), including head and tail. More... | |
bool | isAllocated () const |
Has memory been allocated for this propagator? More... | |
![]() | |
PropagatorTmpl () | |
Constructor. More... | |
void | setDirectionId (int directionId) |
Associate this propagator with a direction index. More... | |
void | setPartner (const Propagator &partner) |
Set the partner of this propagator. More... | |
void | addSource (const Propagator &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 & | source (int id) const |
Get a source propagator. More... | |
const Propagator & | 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... | |
MDE solver for one-direction of one block.
Definition at line 26 of file fd1d/solvers/Propagator.h.
typedef DArray<double> Pscf::Fd1d::Propagator::Field |
Generic field (function of position).
Definition at line 36 of file fd1d/solvers/Propagator.h.
typedef DArray<double> Pscf::Fd1d::Propagator::WField |
Chemical potential field type.
Definition at line 41 of file fd1d/solvers/Propagator.h.
typedef DArray<double> Pscf::Fd1d::Propagator::CField |
Monomer concentration field type.
Definition at line 46 of file fd1d/solvers/Propagator.h.
typedef DArray<double> Pscf::Fd1d::Propagator::QField |
Propagator q-field type.
Definition at line 51 of file fd1d/solvers/Propagator.h.
Pscf::Fd1d::Propagator::Propagator | ( | ) |
Constructor.
Definition at line 21 of file fd1d/solvers/Propagator.cpp.
Pscf::Fd1d::Propagator::~Propagator | ( | ) |
Destructor.
Definition at line 31 of file fd1d/solvers/Propagator.cpp.
|
inline |
Associate this propagator with a block.
block | associated Block object. |
Definition at line 230 of file fd1d/solvers/Propagator.h.
void Pscf::Fd1d::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 fd1d/solvers/Propagator.cpp.
References ns().
void Pscf::Fd1d::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 fd1d/solvers/Propagator.cpp.
References ns(), and UTIL_CHECK.
void Pscf::Fd1d::Propagator::solve | ( | ) |
Solve the modified diffusion equation (MDE) for this block.
This function computes an initial QField 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 QField at the head is computed by pointwise multiplication of of the tail QFields of all source propagators.
Definition at line 105 of file fd1d/solvers/Propagator.cpp.
References Pscf::PropagatorTmpl< Propagator >::setIsSolved(), and Pscf::Fd1d::Block::step().
void Pscf::Fd1d::Propagator::solve | ( | const QField & | 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 117 of file fd1d/solvers/Propagator.cpp.
References head(), Pscf::PropagatorTmpl< Propagator >::setIsSolved(), and Pscf::Fd1d::Block::step().
double Pscf::Fd1d::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 135 of file fd1d/solvers/Propagator.cpp.
References Pscf::Fd1d::Block::domain(), Pscf::PropagatorTmpl< Propagator >::hasPartner(), head(), Pscf::Fd1d::Domain::innerProduct(), Pscf::PropagatorTmpl< Propagator >::isSolved(), Pscf::PropagatorTmpl< Propagator >::partner(), and UTIL_THROW.
|
inline |
Return q-field at specified step.
i | step index |
Definition at line 209 of file fd1d/solvers/Propagator.h.
Referenced by Pscf::Fd1d::System::writeQ(), and Pscf::Fd1d::System::writeQSlice().
|
inline |
Return q-field at beginning of block (initial condition).
Definition at line 197 of file fd1d/solvers/Propagator.h.
Referenced by computeQ(), and solve().
|
inline |
Return q-field at end of block.
Definition at line 203 of file fd1d/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 224 of file fd1d/solvers/Propagator.h.
Referenced by allocate(), reallocate(), and Pscf::Fd1d::System::writeQ().
bool Pscf::Fd1d::Propagator::isAllocated | ( | ) | const |
Has memory been allocated for this propagator?
Definition at line 72 of file fd1d/solvers/Propagator.cpp.