PSCF v1.4.0
scft/iterator/AmIteratorBasis.h
1#ifndef RP_AM_ITERATOR_BASIS_H
2#define RP_AM_ITERATOR_BASIS_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
12#include <pscf/iterator/AmbdInteraction.h> // direct base member
13#include <util/containers/DArray.h> // indirect base member
14
15namespace Pscf {
16namespace Rp {
17
18 using namespace Util;
19
41 template <int D, class T>
43 : public AmIteratorTmpl<typename T::Iterator, DArray<double> >
44 {
45
46 public:
47
49 using IteratorT = typename T::Iterator;
50
53
56
62 void readParameters(std::istream& in) override;
63
69 void outputTimers(std::ostream& out) const override;
70
71 protected:
72
78 AmIteratorBasis(typename T::System& system);
79
83 virtual ~AmIteratorBasis();
84
90 void setup(bool isContinuation) override;
91
92 // Inherited protected members
93 using IteratorT::system;
94 using IteratorT::flexibleParams_;
95
96 private:
97
99 AmbdInteraction interaction_;
100
102 double scaleStress_;
103
104 // Private virtual functions that interact with parent system
105
109 bool hasInitialGuess() override;
110
116 int nElements() override;
117
123 void getCurrent(VectorT& curr) override;
124
131 void evaluate() override;
132
138 void getResidual(VectorT& resid) override;
139
145 void update(VectorT& newGuess) override;
146
150 void outputToLog() override;
151
152 };
153
154} // namespace Rp
155} // namespace Pscf
156#endif
Modified interaction to compute residual defn.
virtual ~AmIteratorBasis()
Destructor.
void readParameters(std::istream &in) override
Read all parameters and initialize.
DArray< double > VectorT
Alias for type of residual and state vectors.
void setup(bool isContinuation) override
Setup iterator just before entering iteration loop.
void outputTimers(std::ostream &out) const override
Output timing results to log file.
typename T::Iterator IteratorT
Alias for iterator type.
AmIteratorTmpl< IteratorT, VectorT > AmIterTmplT
Alias for base class.
AmIteratorBasis(typename T::System &system)
Constructor.
Dynamically allocatable contiguous array template.
Definition DArray.h:32
Class templates for real-valued periodic fields.
PSCF package top-level namespace.