1#ifndef RP_RAMP_PARAMETER_H
2#define RP_RAMP_PARAMETER_H
11#include <util/containers/DArray.h>
13#include <pscf/backend/TmplDeclare.h>
22 template <
int D,
class T>
class System;
23 template <
int D,
class T>
class Simulator;
104 template <
int D,
class T>
161 void update(
double newVal);
166 std::string
type()
const;
227 template <
class Archive>
228 void serialize(Archive& ar,
const unsigned int version);
233 enum ParamType {
Block, Chi, Kuhn, Phi_Polymer, Phi_Solvent,
234 Mu_Polymer, Mu_Solvent,
Solvent, Cell_Param,
235 Lambda_Pert, V_monomer, Null};
253 Simulator<D,T>* simulatorPtr_;
256 System<D,T>* systemPtr_;
263 void readParamType(std::istream& in);
272 void checkId(
int i,
int n, std::string
const & name)
const;
284 void set_(
double newVal);
288 template <
int U,
class V>
292 template <
int U,
class V>
304 template <
int D,
class T>
306 RampParameter<D,T>& param);
314 template <
int D,
class T>
316 RampParameter<D,T>
const & param);
320 template <
int D,
class T>
321 template <
class Archive>
323 const unsigned int version)
327 if (Archive::is_loading()) {
328 if (id_.isAllocated()) id_.deallocate();
329 if (nId_ > 0) id_.allocate(nId_);
332 for (
int i = 0; i < nId_; ++i) {
343 template <
int D,
class T>
348 param.readParamType(in);
351 if (param.nId_ > 0) {
352 for (
int i = 0; i < param.nId_; ++i) {
366 template <
int D,
class T>
372 if (param.nId_ > 0) {
373 for (
int i = 0; i < param.nId_; ++i) {
378 out << param.change_;
384 PSCF_TMPL_DECLARE(RampParameter)
Data about an individual linear ramp parameter.
RampParameter()
Default constructor.
int nId() const
Number of indices associated with this type of parameter.
void serialize(Archive &ar, const unsigned int version)
Serialize to or from an archive.
std::string type() const
Return a string representation of the parameter type.
double current()
Get the current system parameter value.
int id(int i) const
Get id for a sub-object or element to which this is applied.
~RampParameter()=default
Destructor.
void writeParamType(std::ostream &out) const
Write the parameter type to an output stream.
void setSimulator(Simulator< D, T > &simulator)
Set the simulator and system associated with this object.
void getInitial()
Get and store initial value this parameters.
double change() const
Get the total change planned for this parameter during ramp.
double initial() const
Get the initial system parameter value.
void update(double newVal)
Update the corresponding parameter value in the System.
void checkIds() const
Check that any indices of this parameter are in range.
Base class for field theoretic PS-FTS simulator.
Solver and descriptor for a solvent species.
Base class template for classes that represent a complete system.
Dynamically allocatable contiguous array template.
File containing preprocessor macros for error handling.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
void serializeEnum(Archive &ar, T &data, const unsigned int version=0)
Serialize an enumeration value.
Code for programs that simulate real-valued periodic fields.
PSCF package top-level namespace.
std::istream & operator>>(std::istream &in, Pair< Data > &pair)
Input a Pair from an istream.
std::ostream & operator<<(std::ostream &out, const Pair< Data > &pair)
Output a Pair to an ostream, without line breaks.