PSCF v1.4.0
Pscf::Rpg::Propagator< D > Class Template Reference

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

#include <Propagator.h>

Inheritance diagram for Pscf::Rpg::Propagator< D >:
Pscf::Rp::Propagator< D, Types< D > > Pscf::PropagatorTmpl< QT >

Public Member Functions

 Propagator ()
 Constructor.
 ~Propagator ()
 Destructor.
void allocate (int ns, const Mesh< D > &mesh) override
 Allocate memory used by this propagator.
void reallocate (int ns) override
 Reallocate memory used by this propagator.
DeviceArray< cudaReal > const & qAll ()
 Return the full array of q-fields as an unrolled 1D array.
Public Member Functions inherited from Pscf::Rp::Propagator< D, Types< D > >
void setBlock (typename Types< D >::Block &block)
 Associate this propagator with a block.
void solve ()
 Solve the modified diffusion equation (MDE) for this block.
void solve (typename Types< D >::RField const &head)
 Solve the MDE for a specified initial condition.
void computeQ (double &Q) const
 Compute and return partition function for the polymer molecule.
const Types< D >::RField & q (int i) const
 Return q-field at a specified step.
const Types< D >::RField & head () const
 Return q-field at the initial (head) vertex.
const Types< D >::RField & tail () const
 Return q-field at the terminal (tail) vertex.
Types< D >::Block const & block () const
 Get the associated Block object by const reference.
Mesh< D > const & mesh () const
 Return the associated Mesh object by const reference.
int ns () const
 Get the 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< QT >
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.
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 Types

using RpPropagatorT = Rp::Propagator<D, Types<D> >
 Direct base class.

Protected Member Functions

void computeHead ()
 Compute initial q-field at the head vertex.
Protected Member Functions inherited from Pscf::Rp::Propagator< D, Types< D > >
 Propagator ()
 Constructor.
 ~Propagator ()
 Destructor.
void computeHead ()
 Compute initial q-field at the head vertex.
void solveMde ()
 Compute solution of modified diffusion equation (MDE).
Types< D >::Block & block ()
 Get the associated Block object by non-const reference.
Protected Member Functions inherited from Pscf::PropagatorTmpl< QT >
 PropagatorTmpl ()
 Constructor.

Protected Attributes

DArray< typename Types< D >::RField > qFields_
 Array of propagator slices at different contour variable values.
int ns_
 Number of slices, including head and tail slices.
bool isAllocated_
 Is this propagator allocated?
Protected Attributes inherited from Pscf::Rp::Propagator< D, Types< D > >
DArray< typename Types< D >::RField > qFields_
 Array of propagator slices at different contour variable values.
int ns_
 Number of slices, including head and tail slices.
bool isAllocated_
 Is this propagator allocated?

Additional Inherited Members

Public Types inherited from Pscf::Rp::Propagator< D, Types< D > >
using PropagatorTmplT
 Direct (parent) base class.

Detailed Description

template<int D>
class Pscf::Rpg::Propagator< D >

MDE solver for one direction of one block.

Specializations of this template with D=1, 2, and 3 are derived from corresponding specializations of base class template Rp::Propagator, and inherit most of their public interface from this base class.
Only a few functions that involve memory allocation on the GPU are defined or re-defined in this template

See also
Rp::Propagator
Pscf::PropagatorTmpl

Definition at line 35 of file rpg/solvers/Propagator.h.

Member Typedef Documentation

◆ RpPropagatorT

template<int D>
using Pscf::Rpg::Propagator< D >::RpPropagatorT = Rp::Propagator<D, Types<D> >
protected

Direct base class.

Definition at line 89 of file rpg/solvers/Propagator.h.

Constructor & Destructor Documentation

◆ Propagator()

template<int D>
Pscf::Rpg::Propagator< D >::Propagator ( )

Constructor.

Definition at line 28 of file Propagator.cu.

◆ ~Propagator()

template<int D>
Pscf::Rpg::Propagator< D >::~Propagator ( )

Destructor.

Definition at line 36 of file Propagator.cu.

Member Function Documentation

◆ allocate()

template<int D>
void Pscf::Rpg::Propagator< D >::allocate ( int ns,
const Mesh< D > & mesh )
overridevirtual

Allocate memory used by this propagator.

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. See docs for the function ns(), which returns this value.

The address of the associated Mesh<D> object is retained.

An Exception is thrown if the propagator is already allocated.

Parameters
nsnumber of slices (including end points at vertices)
meshspatial discretization mesh

Reimplemented from Pscf::Rp::Propagator< D, Types< D > >.

Definition at line 53 of file Propagator.cu.

References Pscf::Rp::Propagator< D, Types< D > >::allocate(), isAllocated_, Pscf::Rp::Propagator< D, Types< D > >::mesh(), Pscf::Rp::Propagator< D, Types< D > >::ns(), qFields_, and Pscf::PropagatorTmpl< QT >::setIsSolved().

◆ reallocate()

template<int D>
void Pscf::Rpg::Propagator< D >::reallocate ( int ns)
overridevirtual

Reallocate memory used by this propagator.

This function is used when the value of ns is changed, which can occur during some parameter sweeps. See docs for allocate and ns.

An Exception is thrown if the propagator has not been previously allocated, or if it is allocated but the value of ns is unchanged.

Parameters
nsnumber of slices (including end points)

Reimplemented from Pscf::Rp::Propagator< D, Types< D > >.

Definition at line 77 of file Propagator.cu.

References Pscf::Rp::Propagator< D, Types< D > >::mesh(), Pscf::Rp::Propagator< D, Types< D > >::ns(), qFields_, Pscf::Rp::Propagator< D, Types< D > >::reallocate(), and Pscf::PropagatorTmpl< QT >::setIsSolved().

◆ qAll()

template<int D>
DeviceArray< cudaReal > const & Pscf::Rpg::Propagator< D >::qAll ( )
inline

Return the full array of q-fields as an unrolled 1D array.

Definition at line 129 of file rpg/solvers/Propagator.h.

References Pscf::PropagatorTmpl< QT >::isSolved(), and UTIL_CHECK.

Referenced by Pscf::Rpg::Block< D >::computeStressBead(), and Pscf::Rpg::Block< D >::computeStressThread().

◆ computeHead()

template<int D>
void Pscf::Rp::Propagator< D, Types< D > >::computeHead ( )
protected

Compute initial q-field at the head vertex.

In either the thread or bead model, the head slice of each propagator is the product of tail slices for incoming propagators from other bonds that terminate at the head vertex, or 1 for a chain end.

Member Data Documentation

◆ qFields_

template<int D>
DArray<typename Types< D >::RField> Pscf::Rp::Propagator< D, Types< D > >::qFields_
protected

Array of propagator slices at different contour variable values.

Definition at line 191 of file rp/solvers/Propagator.h.

Referenced by allocate(), and reallocate().

◆ ns_

template<int D>
int Pscf::Rp::Propagator< D, Types< D > >::ns_
protected

Number of slices, including head and tail slices.

Definition at line 194 of file rp/solvers/Propagator.h.

◆ isAllocated_

template<int D>
bool Pscf::Rp::Propagator< D, Types< D > >::isAllocated_
protected

Is this propagator allocated?

Definition at line 197 of file rp/solvers/Propagator.h.

Referenced by allocate().


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