1#ifndef PSPC_PROPAGATOR_TPP
2#define PSPC_PROPAGATOR_TPP
11#include "Propagator.h"
14#include <pscf/mesh/Mesh.h>
49 qFields_.allocate(ns);
50 for (
int i = 0; i < ns; ++i) {
67 qFields_.deallocate();
78 qFields_.allocate(ns);
79 for (
int i = 0; i < ns; ++i) {
80 qFields_[i].allocate(meshPtr_->dimensions());
96 int nx = meshPtr_->size();
97 for (ix = 0; ix < nx; ++ix) {
102 for (
int is = 0; is < nSource(); ++is) {
103 if (!source(is).isSolved()) {
104 UTIL_THROW(
"Source not solved in computeHead");
106 QField const& qt = source(is).tail();
107 for (ix = 0; ix < nx; ++ix) {
121 for (
int iStep = 0; iStep < ns_ - 1; ++iStep) {
122 block().step(qFields_[iStep], qFields_[iStep + 1]);
133 int nx = meshPtr_->size();
138 for (
int i = 0; i < nx; ++i) {
143 for (
int iStep = 0; iStep < ns_ - 1; ++iStep) {
144 block().step(qFields_[iStep], qFields_[iStep + 1]);
162 if (!partner().isSolved()) {
163 UTIL_THROW(
"Partner propagator is not solved");
165 QField const& qh = head();
166 QField const& qt = partner().tail();
167 int nx = meshPtr_->size();
173 for (
int i =0; i < nx; ++i) {
Description of a regular grid of points in a periodic domain.
IntVec< D > dimensions() const
Get an IntVec<D> of the grid dimensions.
void computeHead()
Compute initial QField at head from tail QFields of sources.
void solve()
Solve the modified diffusion equation (MDE) for this block.
void reallocate(int ns)
Reallocate memory used by this propagator.
double computeQ()
Compute and return partition function for the polymer.
void allocate(int ns, const Mesh< D > &mesh)
Allocate memory used by this propagator.
Field of real double precision values on an FFT mesh.
int capacity() const
Return allocated size.
#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.
C++ namespace for polymer self-consistent field theory (PSCF).
Utility classes for scientific computation.