PSCF v1.3
Pscf::R1d::Propagator Class Reference

MDE solver for one-direction of one block. More...

#include <Propagator.h>

Inheritance diagram for Pscf::R1d::Propagator:
Pscf::PropagatorTmpl< Propagator >

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?

Detailed Description

MDE solver for one-direction of one block.

Definition at line 26 of file r1d/solvers/Propagator.h.

Member Typedef Documentation

◆ FieldT

Generic field (function of position).

Definition at line 36 of file r1d/solvers/Propagator.h.

◆ QFieldT

Propagator q-field type.

Definition at line 41 of file r1d/solvers/Propagator.h.

Constructor & Destructor Documentation

◆ Propagator()

Pscf::R1d::Propagator::Propagator ( )

Constructor.

Definition at line 21 of file r1d/solvers/Propagator.cpp.

◆ ~Propagator()

Pscf::R1d::Propagator::~Propagator ( )

Destructor.

Definition at line 31 of file r1d/solvers/Propagator.cpp.

Member Function Documentation

◆ setBlock()

void Pscf::R1d::Propagator::setBlock ( Block & block)
inline

Associate this propagator with a block.

Parameters
blockassociated Block object.

Definition at line 220 of file r1d/solvers/Propagator.h.

◆ allocate()

void Pscf::R1d::Propagator::allocate ( int ns,
int nx )

Set discretization and allocate memory.

Parameters
nsnumber of contour length steps
nxnumber of spatial steps

Definition at line 37 of file r1d/solvers/Propagator.cpp.

References ns().

◆ reallocate()

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.

Parameters
nsnumber of slices (including end points)

Definition at line 51 of file r1d/solvers/Propagator.cpp.

References ns(), Pscf::PropagatorTmpl< Propagator >::setIsSolved(), and UTIL_CHECK.

◆ solve() [1/2]

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().

◆ solve() [2/2]

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.

Parameters
headinitial 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().

◆ computeQ()

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.

◆ q()

Propagator::QFieldT const & Pscf::R1d::Propagator::q ( int i) const
inline

Return q-field at specified step.

Parameters
istep 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().

◆ head()

Propagator::QFieldT const & Pscf::R1d::Propagator::head ( ) const
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().

◆ tail()

Propagator::QFieldT const & Pscf::R1d::Propagator::tail ( ) const
inline

Return q-field at end of block.

Definition at line 193 of file r1d/solvers/Propagator.h.

◆ ns()

int Pscf::R1d::Propagator::ns ( ) const
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().

◆ isAllocated()

bool Pscf::R1d::Propagator::isAllocated ( ) const

Has memory been allocated for this propagator?

Definition at line 74 of file r1d/solvers/Propagator.cpp.


The documentation for this class was generated from the following files: