8#include "Environment.h"
34 {
UTIL_THROW(
"Unimplemented modifyStress() method called."); }
40 for (
int i = 0; i < stress_.size(); i++) {
41 if (stressIds_[i] == paramId) {
47 UTIL_THROW(
"Attempt to access stress value that was not calculated.");
57 if (stress_.size() == 0)
return;
60 out <<
"environment-modified stress:" << std::endl;
61 for (
int i = 0; i < stress_.size(); i++) {
62 out <<
Int(stressIds_[i], 5)
64 <<
Dbl(stress_[i], 18, 11)
72 {
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.
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.
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.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
Periodic fields and crystallography.
PSCF package top-level namespace.