1#ifndef RP_CUBIC_LENGTH_DERIVATIVE_TPP
2#define RP_CUBIC_LENGTH_DERIVATIVE_TPP
11#include "CubicLengthDerivative.h"
13#include <rp/system/System.h>
14#include <rp/fts/simulator/Simulator.h>
15#include <rp/solvers/Mixture.h>
16#include <rp/field/Domain.h>
17#include <rp/field/WFields.h>
18#include <rp/field/CFields.h>
19#include <pscf/backend/Reduce.h>
30 template <
int D,
class T>
40 template <
int D,
class T>
49 if (!
system().c().hasData()) {
52 if (!
system().mixture().hasStress()) {
63 double l =
system().domain().unitCell().parameter(0);
66 double const hamiltonian =
simulator().hamiltonian();
67 double dFdL = hamiltonian * (3.0 / l);
70 double const stress =
system().mixture().stress(0);
71 double const vSystem =
system().domain().unitCell().volume();
72 double const vMonomer =
system().mixture().vMonomer();
73 dFdL += stress * vSystem / vMonomer;
76 int const meshSize =
system().domain().mesh().size();
77 int const nMonomer =
system().mixture().nMonomer();
78 dFdL -= 3.0 * double( (nMonomer-1) * meshSize ) / (2.0 * l);
Simulator< D, T > & simulator()
Get the parent Simulator by reference.
System< D, T > & system()
Get the parent System by reference.
AverageAnalyzer(Simulator< D, T > &simulator, System< D, T > &system)
Constructor.
CubicLengthDerivative(Simulator< D, T > &simulator, System< D, T > &system)
Constructor.
double compute() override
Compute and return the derivative of H w/ respect to L.
Base class for field theoretic PS-FTS simulator.
Base class template for classes that represent a complete system.
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.
Code for programs that simulate real-valued periodic fields.
PSCF package top-level namespace.