PSCF v1.1
Public Types | Public Member Functions | List of all members
Pscf::Fd1d::Propagator Class Reference

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

#include <Propagator.h>

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

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...
 
- Public Member Functions inherited from Pscf::PropagatorTmpl< Propagator >
 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...
 

Detailed Description

MDE solver for one-direction of one block.

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

Member Typedef Documentation

◆ Field

Generic field (function of position).

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

◆ WField

Chemical potential field type.

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

◆ CField

Monomer concentration field type.

Definition at line 46 of file fd1d/solvers/Propagator.h.

◆ QField

Propagator q-field type.

Definition at line 51 of file fd1d/solvers/Propagator.h.

Constructor & Destructor Documentation

◆ Propagator()

Pscf::Fd1d::Propagator::Propagator ( )

Constructor.

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

◆ ~Propagator()

Pscf::Fd1d::Propagator::~Propagator ( )

Destructor.

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

Member Function Documentation

◆ setBlock()

void Pscf::Fd1d::Propagator::setBlock ( Block block)
inline

Associate this propagator with a block.

Parameters
blockassociated Block object.

Definition at line 230 of file fd1d/solvers/Propagator.h.

◆ allocate()

void Pscf::Fd1d::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 fd1d/solvers/Propagator.cpp.

References ns().

◆ reallocate()

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.

Parameters
nsnumber of slices (including end points)

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

References ns(), and UTIL_CHECK.

◆ solve() [1/2]

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

◆ solve() [2/2]

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.

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

◆ computeQ()

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.

◆ q()

Propagator::QField const & Pscf::Fd1d::Propagator::q ( int  i) const
inline

Return q-field at specified step.

Parameters
istep index

Definition at line 209 of file fd1d/solvers/Propagator.h.

Referenced by Pscf::Fd1d::System::writeQ(), and Pscf::Fd1d::System::writeQSlice().

◆ head()

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

◆ tail()

Propagator::QField const & Pscf::Fd1d::Propagator::tail ( ) const
inline

Return q-field at end of block.

Definition at line 203 of file fd1d/solvers/Propagator.h.

◆ ns()

int Pscf::Fd1d::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 224 of file fd1d/solvers/Propagator.h.

Referenced by allocate(), reallocate(), and Pscf::Fd1d::System::writeQ().

◆ isAllocated()

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

Has memory been allocated for this propagator?

Definition at line 72 of file fd1d/solvers/Propagator.cpp.


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