PSCF v1.1
pspg/iterator/Iterator.h
1#ifndef PSPG_ITERATOR_H
2#define PSPG_ITERATOR_H
3
4/*
5* PSCF - Polymer Self-Consistent Field Theory
6*
7* Copyright 2016 - 2022, The Regents of the University of Minnesota
8* Distributed under the terms of the GNU General Public License.
9*/
10
11#include <util/param/ParamComposite.h> // base class
12#include <pspg/field/DField.h>
13#include <util/global.h>
14
15namespace Pscf {
16namespace Pspg
17{
18
19 template <int D>
20 class System;
21
22 using namespace Util;
23
24 typedef DField<cudaReal> FieldCUDA;
25
31 template <int D>
32 class Iterator : public ParamComposite
33 {
34
35 public:
36
37 #if 0
41 Iterator();
42 #endif
43
50
54 ~Iterator();
55
62 virtual int solve(bool isContinuation) = 0;
63
67 bool isFlexible() const;
68
69 protected:
70
73
78
79 private:
80
82 System<D>* sysPtr_;
83
84 };
85
86 // Constructor
87 template<int D>
89 : isFlexible_(false),
90 sysPtr_(&system)
91 { setClassName("Iterator"); }
92
93 // Destructor
94 template<int D>
96 {}
97
98 template<int D>
99 inline bool Iterator<D>::isFlexible() const
100 { return isFlexible_; }
101
102 template<int D>
104 { return *sysPtr_; }
105
106} // namespace Pspg
107} // namespace Pscf
108#endif
Base class for iterative solvers for SCF equations.
System< D > & system()
Return reference to parent system.
bool isFlexible_
Is the unit cell flexible during iteration?
Iterator(System< D > &system)
Constructor.
bool isFlexible() const
Is the unit cell flexible (true) or rigid (false).
virtual int solve(bool isContinuation)=0
Iterate to solution.
Main class in SCFT simulation of one system.
Definition: pspg/System.h:71
An object that can read multiple parameters from file.
void setClassName(const char *className)
Set class name string.
File containing preprocessor macros for error handling.
C++ namespace for polymer self-consistent field theory (PSCF).
Utility classes for scientific computation.
Definition: accumulators.mod:1