8#include "Environment.h"
40 {
UTIL_THROW(
"Unimplemented modifyStress() method called."); }
46 for (
int i = 0; i < stress_.size(); i++) {
47 if (stressIds_[i] == paramId) {
53 UTIL_THROW(
"Attempt to access stress value that was not calculated.");
63 if (stress_.size() == 0)
return;
66 out <<
"environment-modified stress:" << std::endl;
67 for (
int i = 0; i < stress_.size(); i++) {
68 out <<
Int(stressIds_[i], 5)
70 <<
Dbl(stress_[i], 18, 11)
78 {
return hasStress_; }
void setClassName(const char *className)
Set class name string.
virtual void reset()
Sets needsUpdate() to true.
virtual double modifyStress(int paramId, double stress) const
Modify stress to account for Environment, for one lattice parameter.
void clearStress()
Mark the environment-modified stress as outdated.
Environment()
Constructor.
~Environment()
Destructor.
void reset()
Sets needsUpdate() to true and hasStress() to false.
double stress(int paramId) const
Return the environment-modified SCFT stress for one parameter.
bool hasStress() const
Has the stress been calculated?
void writeStress(std::ostream &out) const
Write the environment-modified SCFT stress.
void setNParams(int nParams)
Set the number of lattice parameters.
Dbl()
Default constructor.
Int()
Default constructor.
#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.