1#ifndef RP_LINEAR_RAMP_TPP
2#define RP_LINEAR_RAMP_TPP
5#include <rp/fts/simulator/Simulator.h>
6#include <rp/fts/compressor/Compressor.h>
7#include <rp/system/System.h>
8#include <rp/solvers/Mixture.h>
19 template <
int D,
class T>
24 template <
int D,
class T>
30 parameters_.allocate(nParameter_);
34 parameters_, nParameter_);
41 for (
int i = 0; i < nParameter_; ++i) {
42 if (parameters_[i].type() ==
"phi_polymer" ||
43 parameters_[i].type() ==
"phi_solvent")
45 sum += parameters_[i].change();
48 if (sum > 1.0E-10 || sum < -1.0E-10) {
49 UTIL_THROW(
"Changes of the volume fractions of a closed "
50 "mixture must add up to zero");
55 template <
int D,
class T>
61 for (
int i = 0; i < nParameter_; ++i) {
63 parameters_[i].getInitial();
67 template <
int D,
class T>
76 for (
int i = 0; i < nParameter_; ++i) {
79 newVal = parameters_[i].initial() + s*parameters_[i].change();
80 parameters_[i].update(newVal);
83 if (parameters_[i].type() ==
"chi") hasChi =
true;
98 template <
int D,
class T>
101 for (
int i = 0; i < nParameter_; ++i) {
103 << parameters_[i].type() << std::endl;
105 << parameters_[i].initial() <<
" ";
107 << parameters_[i].change() << std::endl;
void output() override
Output information at the end of a simulation.
void setParameters(int iStep) override
Set new parameters values in associated System and Simulator.
LinearRamp(Simulator< D, T > &simulator)
Constructor.
void readParameters(std::istream &in) override
Read parameters from parameter file input stream.
void setup(int nStep) override
Set nStep and complete initialization.
Simulator< D, T > const & simulator() const
Get parent Simulator<D,T> by const reference.
int nStep_
Number of steps planned for this simulation (set in setup).
Base class for field theoretic PS-FTS simulator.
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.
void setClassName(const char *className)
Set class name string.
File containing preprocessor macros for error handling.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
Code for programs that simulate real-valued periodic fields.
PSCF package top-level namespace.