1#ifndef RPG_CHI_DERIVATIVE_TPP
2#define RPG_CHI_DERIVATIVE_TPP
11#include "ChiDerivative.h"
13#include <rpg/system/System.h>
14#include <rpg/fts/simulator/Simulator.h>
15#include <pscf/inter/Interaction.h>
45 const int nMonomer =
system().mixture().nMonomer();
48 const double vSystem =
system().domain().unitCell().volume();
49 const double vMonomer =
system().mixture().vMonomer();
50 const double nMonomerSystem = vSystem / vMonomer;
51 const int meshSize =
system().domain().mesh().size();
52 double chi =
system().interaction().chi(0,1);
55 if (!
system().c().hasData()) {
66 double hField =
simulator().fieldHamiltonian()/nMonomerSystem;
69 double dfdchi = -(hField - 0.5*
simulator().sc(nMonomer - 1))/chi
73 dfdchi *= nMonomerSystem;
76 dfdchi += double(meshSize)/(2.0 * chi);
85 double chi=
system().interaction().chi(0,1);
88 outputFile_ <<
Int(step);
89 outputFile_ <<
Dbl(chi);
90 outputFile_ <<
Dbl(value);
AverageAnalyzer(Simulator< D > &simulator, System< D > &system)
Constructor.
virtual void outputValue(int step, double value)
Output a sampled or block average value.
int nSamplePerOutput() const
Get value of nSamplePerOutput.
Simulator< D > & simulator()
Return reference to parent simulator.
System< D > & system()
Return reference to parent system.
virtual ~ChiDerivative()
Destructor.
void setClassName(const char *className)
Set class name string.
virtual double compute()
Compute and return the derivative of H w/ respect to chi.
ChiDerivative(Simulator< D > &simulator, System< D > &system)
Constructor.
virtual void outputValue(int step, double value)
Output a sampled or block average value.
Field theoretic simulator (base class).
Main class, representing one complete system.
Wrapper for a double precision number, for formatted ostream output.
Wrapper for an int, for formatted ostream output.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
SCFT and PS-FTS with real periodic fields (GPU)
PSCF package top-level namespace.