1#ifndef RP_PROPAGATOR_TPP
2#define RP_PROPAGATOR_TPP
11#include "Propagator.h"
12#include <pscf/mesh/Mesh.h>
22 template <
int D,
class T>
33 template <
int D,
class T>
40 template <
int D,
class T>
51 template <
int D,
class T>
63 template <
int D,
class T>
70 typename T::RField& qh =
qFields_[0];
79 for (
int is = 0; is <
ns; ++is) {
81 UTIL_THROW(
"Source not solved in computeHead");
95 template <
int D,
class T>
105 template <
int D,
class T>
120 template <
int D,
class T>
129 for (
int iStep = 0; iStep <
ns_ - 1; ++iStep) {
146 for (iStep = 1; iStep <
ns_ - 2; ++iStep) {
170 template <
int D,
class T>
183 UTIL_THROW(
"Partner propagator is not solved");
195 Q /= double(
mesh().size());
Description of a regular grid of points in a periodic domain.
void setIsSolved(bool isSolved)
Mesh< D > const & mesh() const
Return the associated Mesh object by const reference.
void computeQ(double &Q) const
Compute and return partition function for the polymer molecule.
bool isAllocated() const
Has memory been allocated for this propagator?
int ns() const
Get the number of values of s (or slices), including head and tail.
const T::RField & head() const
Return q-field at the initial (head) vertex.
T::Block const & block() const
Get the associated Block object by const reference.
void computeHead()
Compute initial q-field at the head vertex.
virtual void reallocate(int ns)
Reallocate memory used by this propagator.
void solve()
Solve the modified diffusion equation (MDE) for this block.
int ns_
Number of slices, including head and tail slices.
void solveMde()
Compute solution of modified diffusion equation (MDE).
const typename T::Propagator & source(int id) const
Get a source propagator.
bool isAllocated_
Is this propagator allocated?
const typename T::Propagator & partner() const
Get partner propagator.
const T::RField & tail() const
Return q-field at the terminal (tail) vertex.
const T::RField & q(int i) const
Return q-field at a specified step.
DArray< typename T::RField > qFields_
Array of propagator slices at different contour variable values.
virtual void allocate(int ns, const Mesh< D > &mesh)
Allocate memory used by this propagator.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
double innerProduct(Array< double > const &a, Array< double > const &b)
Compute Euclidean inner product of two real arrays .
double sum(Array< double > const &in)
Compute sum of array elements (real).
void mulEqV(Array< double > &a, Array< double > const &b)
Vector-vector in-place multiplication, a[i] *= b[i] (real).
void eqV(Array< double > &a, Array< double > const &b, const int beginIdA, const int beginIdB, const int n)
Vector assignment, a[i] = b[i] (real, slice).
void eqS(Array< double > &a, double b)
Vector assignment, a[i] = b (real).
bool isThread()
Is the thread model in use ?
bool isBead()
Is the bead model in use ?
Class templates for real-valued periodic fields.
PSCF package top-level namespace.