PSCF v1.1
pspg/sweep/SweepParameter.h
1#ifndef PSPG_SWEEP_PARAMETER_H
2#define PSPG_SWEEP_PARAMETER_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 <iostream>
12
13namespace Pscf {
14namespace Pspg {
15
16 template <int D> class System;
17
80 template <int D>
82 {
83
84 public:
85
90
97
106 void setSystem(System<D>& system)
107 { systemPtr_ = &system;}
108
112 void getInitial();
113
119 void update(double newVal);
120
124 std::string type() const;
125
131 void writeParamType(std::ostream& out) const;
132
146 int id(int i) const
147 { return id_[i];}
148
152 double current()
153 { return get_(); }
154
158 double initial() const
159 { return initial_; }
160
164 double change() const
165 { return change_; }
166
173 template <class Archive>
174 void serialize(Archive ar, const unsigned int version);
175
176 private:
177
179 enum ParamType { Block, Chi, Kuhn, Phi_Polymer, Phi_Solvent,
180 Mu_Polymer, Mu_Solvent, Solvent, Cell_Param, Null};
181
183 ParamType type_;
184
186 int nID_;
187
189 DArray<int> id_;
190
192 double initial_;
193
195 double change_;
196
198 System<D>* systemPtr_;
199
205 void readParamType(std::istream& in);
206
210 double get_();
211
217 void set_(double newVal);
218
219 // friends:
220
221 template <int U>
222 friend
223 std::istream& operator >> (std::istream&, SweepParameter<U>&);
224
225 template <int U>
226 friend
227 std::ostream&
228 operator << (std::ostream&, SweepParameter<U> const&);
229
230 };
231
232}
233}
234#include "SweepParameter.tpp"
235#endif
Block within a branched polymer.
Solver and descriptor for a solvent species.
Class for storing data about an individual sweep parameter.
std::string type() const
Return a string representation of the parameter type.
void serialize(Archive ar, const unsigned int version)
Serialize to or from an archive.
double change() const
Return the total change planned for this parameter during sweep.
void setSystem(System< D > &system)
Set the system associated with this object.
int id(int i) const
Get a id for a sub-object or element to which this is applied.
void getInitial()
Store the pre-sweep value of the corresponding parameter.
void update(double newVal)
Update the corresponding parameter value in the system.
double initial() const
Return the initial system parameter value.
void writeParamType(std::ostream &out) const
Write the parameter type to an output stream.
double current()
Return the current system parameter value.
Main class in SCFT simulation of one system.
Definition: pspg/System.h:71
Dynamically allocatable contiguous array template.
Definition: DArray.h:32
C++ namespace for polymer self-consistent field theory (PSCF).