10#include <r1d/domain/Domain.h>
41 qFields_.allocate(
ns);
42 for (
int i = 0; i <
ns; ++i) {
43 qFields_[i].allocate(nx);
62 qFields_.deallocate();
65 qFields_.allocate(
ns);
66 for (
int i = 0; i <
ns; ++i) {
67 qFields_[i].allocate(nx_);
75 {
return isAllocated_; }
80 void Propagator::computeHead()
88 for (ix = 0; ix < nx_; ++ix) {
93 for (
int is = 0; is <
nSource(); ++is) {
95 UTIL_THROW(
"Source not solved in computeHead");
98 for (ix = 0; ix < nx_; ++ix) {
110 for (
int iStep = 0; iStep < ns_ - 1; ++iStep) {
111 block().step(qFields_[iStep], qFields_[iStep + 1]);
123 for (
int i = 0; i < nx_; ++i) {
128 for (
int iStep = 0; iStep < ns_ - 1; ++iStep) {
129 block().step(qFields_[iStep], qFields_[iStep + 1]);
146 UTIL_THROW(
"Partner propagator is not solved");
150 return block().domain().innerProduct(qh, qt);
void setIsSolved(bool isSolved)
const Propagator & partner() const
const Propagator & source(int id) const
DArray< double > QFieldT
Propagator q-field type.
bool isAllocated() const
Has memory been allocated for this propagator?
int ns() const
Number of values of s (or slices), including head and tail.
void solve()
Solve the modified diffusion equation (MDE) for this block.
QFieldT const & head() const
Return q-field at beginning of block (initial condition).
double computeQ()
Compute and return partition function for the molecule.
void reallocate(int ns)
Reallocate memory used by this propagator.
void allocate(int ns, int nx)
Set discretization and allocate memory.
#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.
SCFT with real 1D fields.
PSCF package top-level namespace.