PSCF v1.4.0
AmIterator.h
1#ifndef R1D_AM_ITERATOR_H
2#define R1D_AM_ITERATOR_H
3
4/*
5* PSCF - Polymer Self-Consistent Field
6*
7* Copyright 2015 - 2025, The Regents of the University of Minnesota
8* Distributed under the terms of the GNU General Public License.
9*/
10
11#include <pscf/iterator/AmIteratorTmpl.h> // base class template
12#include <r1d/iterator/Iterator.h> // base class template argument
13#include <util/containers/DArray.h> // base class template argument
14#include <pscf/iterator/AmbdInteraction.h> // member
15
16namespace Pscf {
17namespace R1d {
18
19 // Forward declaration
20 class System;
21
22 using namespace Util;
23
31 class AmIterator : public AmIteratorTmpl<Iterator, DArray<double> >
32 {
33
34 public:
35
41 AmIterator(System& system);
42
47
53 void readParameters(std::istream& in) override;
54
55 protected:
56
62 void setup(bool isContinuation) override;
63
64 private:
65
67 AmbdInteraction interaction_;
68
69 // Non-virtual private function
70
74 bool isCanonical();
75
76 // Private virtual functions that interact with parent System
77
83 int nElements() override;
84
88 bool hasInitialGuess() override;
89
95 void getCurrent(DArray<double>& curr) override;
96
103 void evaluate() override;
104
110 void getResidual(DArray<double>& resid) override;
111
117 void update(DArray<double>& newGuess) override;
118
122 void outputToLog() override;
123
124 };
125
126} // namespace R1d
127} // namespace Pscf
128
129// Explicit instantiation declaration
130namespace Pscf {
131 extern template class AmIteratorTmpl< R1d::Iterator, DArray<double> >;
132}
133#endif
Modified interaction to compute residual defn.
void readParameters(std::istream &in) override
Read all parameters and initialize.
AmIterator(System &system)
Constructor.
~AmIterator()
Destructor.
void setup(bool isContinuation) override
Setup iterator just before entering iteration loop.
Main class in SCFT simulation of one system.
Dynamically allocatable contiguous array template.
Definition DArray.h:32
SCFT with real 1D fields.
PSCF package top-level namespace.