27 for (
const auto& val : vec) {
30 return std::sqrt(sum / vec.size());
33 size_t vcs_optMax(
const double* x,
const double* xSize,
size_t j,
size_t n)
38 assert(xSize[j] > 0.0);
40 for (
size_t i = j + 1; i < n; ++i) {
41 assert(xSize[i] > 0.0);
42 if ((x[i] * xSize[i]) > big) {
44 big = x[i] * xSize[i];
48 for (
size_t i = j + 1; i < n; ++i) {
60 switch (speciesStatus) {
62 return "Component Species";
64 return "Major Species";
66 return "Minor Species";
69 return "Set Zeroed-Phase";
71 return "Purposely Zeroed-Phase Species (not in problem)";
75 return "Zeroed-MS Phase";
77 return "Zeroed-MS Phase Species";
81 return "Zeroed-SS Phase";
83 return "Zeroed-SS Phase Species";
87 return "Deleted Species";
88 }
else if (length < 40) {
89 return "Deleted-Small Species";
91 return "Deleted-Small Species in a MS phase";
95 return "Tmp Zeroed in MS";
97 return "Zeroed Species in an active MS phase (tmp)";
101 return "Stoich Zeroed in MS";
103 return "Zeroed Species in an active MS phase (Stoich Constraint)";
107 return "InterfaceVoltage";
109 return "InterfaceVoltage Species";
112 return "unknown species type";
118 double denom = fabs(d1) + fabs(d2) + 1.0;
119 double fac = fabs(d1 - d2) / denom;
bool vcs_doubleEqual(double d1, double d2)
Simple routine to check whether two doubles are equal up to roundoff error.
#define VCS_SPECIES_ZEROEDMS
Species lies in a multicomponent phase with concentration zero.
#define VCS_SPECIES_MINOR
Species is a major species.
#define VCS_SPECIES_INTERFACIALVOLTAGE
Species refers to an electron in the metal.
#define VCS_SPECIES_ZEROEDSS
Species is a SS phase, that is currently zeroed out.
Defines and definitions within the vcs package.
#define VCS_SPECIES_ZEROEDPHASE
Species lies in a multicomponent phase that is zeroed atm.
Internal declarations for the VCSnonideal package.
#define VCS_SPECIES_ACTIVEBUTZERO
Species lies in a multicomponent phase that is active, but species concentration is zero...
#define VCS_SPECIES_MAJOR
Species is a major species.
#define VCS_SPECIES_STOICHZERO
Species lies in a multicomponent phase that is active, but species concentration is zero due to stoic...
double vcs_l2norm(const vector_fp &vec)
determine the l2 norm of a vector of doubles
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
size_t vcs_optMax(const double *x, const double *xSize, size_t j, size_t n)
Finds the location of the maximum component in a double vector.
Contains declarations for string manipulation functions within Cantera.
const char * vcs_speciesType_string(int speciesStatus, int length)
Returns a const char string representing the type of the species given by the first argument...
#define VCS_SPECIES_COMPONENT
Species is a component which can be nonzero.
Namespace for the Cantera kernel.
#define VCS_SPECIES_DELETED
Species has such a small mole fraction it is deleted even though its phase may possibly exist...
Definitions for the classes that are thrown when Cantera experiences an error condition (also contain...