PSCF v1.5.0
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 - 2026, David Morse (morse012@um.edu) and co-authors
8* Distributed under the terms of the GNU General Public License.
9*/
10
11#include <pscf/iterator/AmIteratorTmpl.h> // base class template
12#include <rp/scft/iterator/Iterator.h> // base template argument
13#include <util/containers/DArray.h> // base template argument
14#include <pscf/iterator/AmbdInteraction.h> // direct base member
15
16#include <pscf/backend/TmplDeclare.h> // declaration macros
17
18namespace Pscf {
19namespace Rp {
20
21 using namespace Util;
22
41 template <int D, class T>
43 : public AmIteratorTmpl<Iterator<D,T>, DArray<double> >
44 {
45
46 public:
47
54
58 virtual ~AmIteratorBasis();
59
65 void readParameters(std::istream& in) override;
66
72 void outputTimers(std::ostream& out) const override;
73
74 protected:
75
81 void setup(bool isContinuation) override;
82
85
88
89 // Inherited protected members
90 using Iterator<D,T>::system;
91 using Iterator<D,T>::flexibleParams_;
92
93 private:
94
96 AmbdInteraction interaction_;
97
99 double scaleStress_;
100
101 // Private virtual functions that interact with parent system
102
106 bool hasInitialGuess() override;
107
113 int nElements() override;
114
120 void getCurrent(VectorT& curr) override;
121
128 void evaluate() override;
129
135 void getResidual(VectorT& resid) override;
136
142 void update(VectorT& newGuess) override;
143
147 void outputToLog() override;
148
149 };
150
151 // Explicit instantiation declarations
152 PSCF_TMPL_DECLARE(AmIteratorBasis)
153
154} // namespace Rp
155} // namespace Pscf
156#endif
Modified interaction to compute residual defn.
Anderson Mixing iterator with imposed space-group symmetry.
AmIteratorBasis(System< D, T > &system)
Constructor.
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.
AmIteratorTmpl< Iterator< D, T >, VectorT > AmIterTmplT
Alias for base class.
void outputTimers(std::ostream &out) const override
Output timing results to log file.
Base class template for iterative solvers for SCF equations.
Base class template for classes that represent a complete system.
Dynamically allocatable contiguous array template.
Definition DArray.h:32
Code for programs that simulate real-valued periodic fields.
Definition param_pc.dox:2
PSCF package top-level namespace.