|
PSCF v1.4.0
|
Template for propagator classes. More...
#include <PropagatorTmpl.h>
Public Member Functions | |
Mutators | |
| void | setDirectionId (int directionId) |
| Associate this propagator with a direction index. | |
| void | setPartner (const QT &partner) |
| Set the partner of this propagator. | |
| void | addSource (const QT &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. | |
Accessors | |
| const QT & | source (int id) const |
| Get a source propagator. | |
| const QT & | 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? | |
Protected Member Functions | |
| PropagatorTmpl () | |
| Constructor. | |
Template for propagator classes.
The template argument QT should be a concrete propagator class that is derived from the template PropagatorTmpl<QT>. By convention, each implementation of field theory 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" (CRQT). It is used here to allow the template PropagatorTmpl<Propagator> to have member variables that store pointers to other instances of the derived class Propagator (or QT).
The concrete Propagator class is used in templates BlockTmpl, PolymerTmpl and MixtureTmpl. The usage in those templates require that the Propagator class define an alias named FieldT for the field type. Propagator must also provide member functions "void solve()" and "void computeQ(WT &)", where WT is the name of the real or complex number data type of the value of the partition function. This data type is generally the same as the type of the value of a single w-field at a grid point.
The type FieldT must be an alias for the type of container used to store a single chemical potential or concentration field, or a single slice of a propagator.
The function void solve() must solve the modified diffusion equation for this propapagator, using information that is accessible to the concrete propagator class. Upon return, the solution must be stored in an internal data structures that is read-accessible through the public class interface, and the function isSolved() must return true.
The function void computeQ(WT & ) must compute the partition function Q, which is a value of type WT, and set its single parameter equal to Q.
A simple example of such an interface for an implementation with real fields is shown below:
In this above example, the field container typename FieldT is an alias for DArrray<double>, which is a dynamically allocated array of double double precision floating point numbers. Other implementations may use a more specialized container type for field values.
Definition at line 93 of file PropagatorTmpl.h.
|
protected |
Constructor.
Definition at line 290 of file PropagatorTmpl.h.
| void Pscf::PropagatorTmpl< QT >::setDirectionId | ( | int | directionId | ) |
Associate this propagator with a direction index.
| directionId | direction = 0 or 1. |
Definition at line 301 of file PropagatorTmpl.h.
References directionId().
| void Pscf::PropagatorTmpl< QT >::setPartner | ( | const QT & | 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 308 of file PropagatorTmpl.h.
References partner().
| void Pscf::PropagatorTmpl< QT >::addSource | ( | const QT & | 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 315 of file PropagatorTmpl.h.
References source().
| void Pscf::PropagatorTmpl< QT >::setIsSolved | ( | bool | isSolved | ) |
Set the isSolved flag to true or false.
Definition at line 346 of file PropagatorTmpl.h.
References isSolved().
Referenced by Pscf::Rpc::Propagator< D >::allocate(), Pscf::Rpg::Propagator< D >::allocate(), Pscf::Rpc::Propagator< D >::reallocate(), and Pscf::Rpg::Propagator< D >::reallocate().
| void Pscf::PropagatorTmpl< QT >::setEndFlags | ( | bool | isHeadEnd, |
| bool | isTailEnd ) |
Set flags indicating whether vertices are chain ends.
| isHeadEnd | Is the head vertex a chain end? |
| isTailEnd | Is the tail vertex a chain end? |
Definition at line 322 of file PropagatorTmpl.h.
References isHeadEnd(), and isTailEnd().
|
inline |
Get a source propagator.
| id | index of source propagator, < nSource |
Definition at line 253 of file PropagatorTmpl.h.
Referenced by addSource().
| const QT & Pscf::PropagatorTmpl< QT >::partner | ( | ) | const |
Get partner propagator.
Definition at line 353 of file PropagatorTmpl.h.
References UTIL_CHECK.
Referenced by setPartner().
|
inline |
Get direction index for this propagator.
Definition at line 238 of file PropagatorTmpl.h.
Referenced by setDirectionId().
|
inline |
Number of source / prerequisite propagators.
Definition at line 245 of file PropagatorTmpl.h.
References Util::GArray< Data >::size().
|
inline |
Does this have a partner propagator?
Definition at line 260 of file PropagatorTmpl.h.
|
inline |
Is the head vertex a chain end?
Precondition: PolymerModel::isBead()
Definition at line 267 of file PropagatorTmpl.h.
Referenced by Pscf::Rpc::Block< D >::computeStressBead(), Pscf::Rpg::Block< D >::computeStressBead(), and setEndFlags().
|
inline |
Is the tail vertex a chain end?
Precondition: PolymerModel::isBead()
Definition at line 274 of file PropagatorTmpl.h.
Referenced by Pscf::Rpc::Block< D >::computeStressBead(), Pscf::Rpg::Block< D >::computeStressBead(), and setEndFlags().
|
inline |
Has the modified diffusion equation been solved?
Definition at line 281 of file PropagatorTmpl.h.
Referenced by Pscf::Rpc::Block< D >::computeStressBead(), Pscf::Rpg::Block< D >::computeStressBead(), Pscf::Rpg::Block< D >::computeStressThread(), isReady(), Pscf::Rpg::Propagator< D >::qAll(), and setIsSolved().
| bool Pscf::PropagatorTmpl< QT >::isReady | ( | ) | const |
Are all source propagators solved?
Definition at line 332 of file PropagatorTmpl.h.
References isSolved().