1#ifndef RPG_LINEAR_RAMP_TPP
2#define RPG_LINEAR_RAMP_TPP
5#include <rpg/fts/simulator/Simulator.h>
7#include <util/containers/DArray.h>
36 parameters_.allocate(nParameter_);
43 for (
int i = 0; i < nParameter_; ++i) {
44 if (parameters_[i].type() ==
"phi_polymer" ||
45 parameters_[i].type() ==
"phi_solvent")
47 sum += parameters_[i].change();
60 for (
int i = 0; i < nParameter_; ++i) {
62 parameters_[i].getInitial();
70 double s = double(iStep)/double(nStep_);
74 for (
int i = 0; i < nParameter_; ++i) {
75 newVal = parameters_[i].initial() + s*parameters_[i].change();
76 parameters_[i].update(newVal);
79 if (parameters_[i].type() ==
"chi") {
80 simulator().analyzeChi();
89 for (
int i = 0; i < nParameter_; ++i) {
93 << parameters_[i].type() << std::endl;
97 << parameters_[i].initial() <<
" ";
101 << parameters_[i].initial() + parameters_[i].change()
106 << parameters_[i].change() <<std::endl;
LinearRamp(Simulator< D > &simulator)
Constructor.
virtual void setParameters(int iStep)
Set new parameters values in associated System and Simulator.
virtual ~LinearRamp()
Destructor.
virtual void output()
Output initial and final parameter values of linear ramp at the end of the simulation.
virtual void setup(int nStep)
Set nStep and complete initialization.
virtual void readParameters(std::istream &in)
Read parameters from parameter file input stream.
Class that varies parameters during a simulation (abstract).
Field theoretic simulator (base class).
static std::ostream & file()
Get log ostream by reference.
DArrayParam< Type > & readDArray(std::istream &in, const char *label, DArray< Type > &array, int n)
Add and read a required DArray < Type > parameter.
ScalarParam< Type > & read(std::istream &in, const char *label, Type &value)
Add and read a new required ScalarParam < Type > object.
File containing preprocessor macros for error handling.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
PSCF package top-level namespace.
Utility classes for scientific computation.