41 if (!system().c().hasData()) {
44 if (!system().mixture().hasStress()) {
45 system().computeStress();
47 if (!simulator().hasWc()){
48 simulator().computeWc();
50 if (!simulator().hasHamiltonian()) {
51 simulator().computeHamiltonian();
55 double l = system().domain().unitCell().parameter(0);
58 double const hamiltonian = simulator().hamiltonian();
59 double dFdL = hamiltonian * (3.0 / l);
62 double const stress = system().mixture().stress(0);
63 double const vSystem = system().domain().unitCell().volume();
64 double const vMonomer = system().mixture().vMonomer();
65 dFdL += stress * vSystem / vMonomer;
68 int const meshSize = system().domain().mesh().size();
69 dFdL -= 3.0 * double(meshSize) / (2.0 * l);