PSCF v1.1
|
Template for propagator classes. More...
#include <PropagatorTmpl.h>
Public Member Functions | |
PropagatorTmpl () | |
Constructor. More... | |
Mutators | |
void | setDirectionId (int directionId) |
Associate this propagator with a direction index. More... | |
void | setPartner (const TP &partner) |
Set the partner of this propagator. More... | |
void | addSource (const TP &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... | |
Accessors | |
const TP & | source (int id) const |
Get a source propagator. More... | |
const TP & | 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... | |
Template for propagator classes.
The template argument TP should be a concrete propagator class that is derived from the template PropagatorTmpl<TP>. By convention, each implementation of SCFT is defined in a different sub-namespace of namespace Pscf. For each such implementation, there is a concrete propagator class, named Propagator by convention, that is a subclass of the template instance PropagatorTmpl<Propagator>, using the syntax shown below:
This usage is an example of the so-called "curiously recurring template pattern" (CRTP). It is used here to allow the template PropagatorTmpl<Propagator> to have a member variables that store pointers to other instances of derived class Propagator (or TP).
The Propagator class is used in templates BlockTmpl, PolymerTmpl and SystemTmpl. The usage in those templates require that it define the following public typedefs and member functions:
The typedefs WField and CField define the types of the objects used to represent a chemical potential field for a particular monomer type and a monomer concentration field. In the above example, both of these typenames are defined to be synonyms for DArrray<double>, i.e., for dynamically allocated arrays of double precision floating point numbers. Other implementations may use more specialized types.
Definition at line 75 of file PropagatorTmpl.h.
Pscf::PropagatorTmpl< TP >::PropagatorTmpl |
Constructor.
Definition at line 225 of file PropagatorTmpl.h.
void Pscf::PropagatorTmpl< TP >::setDirectionId | ( | int | directionId | ) |
Associate this propagator with a direction index.
directionId | direction = 0 or 1. |
Definition at line 236 of file PropagatorTmpl.h.
void Pscf::PropagatorTmpl< TP >::setPartner | ( | const TP & | partner | ) |
Set the partner of this propagator.
The partner of a propagator is the propagator for the same block that propagates in the opposite direction.
partner | reference to partner propagator |
Definition at line 243 of file PropagatorTmpl.h.
void Pscf::PropagatorTmpl< TP >::addSource | ( | const TP & | source | ) |
Add a propagator to the list of sources for this one.
A source is a propagator that terminates at the root vertex of this one and is needed to compute the initial condition for this one, and that thus must be computed before this.
source | reference to source propagator |
Definition at line 250 of file PropagatorTmpl.h.
void Pscf::PropagatorTmpl< TP >::setIsSolved | ( | bool | isSolved | ) |
Set the isSolved flag to true or false.
Definition at line 268 of file PropagatorTmpl.h.
|
inline |
Get a source propagator.
id | index of source propagator, < nSource |
Definition at line 201 of file PropagatorTmpl.h.
const TP & Pscf::PropagatorTmpl< TP >::partner |
|
inline |
Get direction index for this propagator.
Definition at line 186 of file PropagatorTmpl.h.
|
inline |
Number of source / prerequisite propagators.
Definition at line 193 of file PropagatorTmpl.h.
|
inline |
Does this have a partner propagator?
Definition at line 209 of file PropagatorTmpl.h.
|
inline |
Has the modified diffusion equation been solved?
Definition at line 216 of file PropagatorTmpl.h.
bool Pscf::PropagatorTmpl< TP >::isReady |
Are all source propagators are solved?
Definition at line 275 of file PropagatorTmpl.h.
Referenced by pscfpp.text.RecordEditor::__init__(), pscfpp.text.FileEditor::__init__(), pscfpp.text.RecordEditor::editFile(), pscfpp.text.FileEditor::editFile(), pscfpp.text.FileEditor::editFileBlocks(), pscfpp.text.FileEditor::editFiles(), pscfpp.text.FileEditor::setFilter(), pscfpp.text.RecordEditor::setFilter(), pscfpp.text.FileEditor::setNew(), pscfpp.text.RecordEditor::setNew(), and pscfpp.text.FileEditor::setOld().