20 double*
const sm,
double*
const ss)
22 size_t j, k, l, i, jl, ml, jr, ielem;
25 double test = -1.0E10;
29 for (i=0; i<77; i++) {
33 plogf(
" --- Subroutine elem_rearrange() called to ");
34 plogf(
"check stoich. coefficient matrix\n");
35 plogf(
" --- and to rearrange the element ordering once");
75 if (aw[ielem] != test) {
81 if (k == m_numElemConstraints) {
82 plogf(
"vcs_elem_rearrange::Shouldn't be here. Algorithm misfired.");
107 for (j = 0; j < ncomponents; ++j) {
117 for (j = 0; j < jl; ++j) {
119 for (i = 0; i < ncomponents; ++i) {
120 ss[j] += sm[i + jr*ncomponents] * sm[i + j*ncomponents];
128 for (j = 0; j < jl; ++j) {
129 for (l = 0; l < ncomponents; ++l) {
130 sm[l + jr*ncomponents] -= ss[j] * sm[l + j*ncomponents];
140 for (ml = 0; ml < ncomponents; ++ml) {
141 sa[jr] += SQUARE(sm[ml + jr*ncomponents]);
146 if (sa[jr] < 1.0e-6) {
167 std::swap(aw[jr], aw[k]);
175 }
while (jr < (ncomponents-1));
189 plogf(
"vcs_switch_elem_pos: ifunc = 0: inappropriate args: %d %d\n",
size_t m_numComponents
Number of components calculated for the problem.
void setElemGlobalIndex(const size_t eLocal, const size_t eGlobal)
sets a local phase element to a global index value
const size_t npos
index returned by functions to indicate "no position"
int m_debug_print_lvl
Debug printing lvl.
size_t elemGlobalIndex(const size_t e) const
Returns the global index of the local element index for the phase.
std::vector< double > m_elemAbundancesGoal
Element abundances vector Goals.
Header file for the internal object that holds the vcs equilibrium problem (see Class VCS_SOLVE and E...
Header for the object representing each phase within vcs.
std::vector< double > m_elemAbundances
Element abundances vector.
Phase information and Phase calculations for vcs.
Internal declarations for the VCSnonideal package.
DoubleStarStar m_formulaMatrix
Formula matrix for the problem.
size_t m_numSpeciesTot
Total number of species in the problems.
std::vector< std::string > m_elementName
Vector of strings containing the element names.
std::vector< int > m_elementActive
Specifies whether an element constraint is active.
size_t m_numElemConstraints
Number of element constraints in the problem.
std::vector< vcs_VolPhase * > m_VolPhaseList
Array of Phase Structures. Length = number of phases.
size_t m_numPhases
Number of Phases in the problem.
#define plogendl()
define this Cantera function to replace cout << endl;
int vcs_elem_rearrange(double *const aw, double *const sa, double *const sm, double *const ss)
Rearrange the constraint equations represented by the Formula Matrix so that the operational ones are...
size_t nElemConstraints() const
Returns the number of element constraints.
std::vector< size_t > m_elementMapIndex
Index vector that keeps track of the rearrangement of the elements.
#define plogf
define this Cantera function to replace printf
std::vector< int > m_elType
Type of the element constraint.
void vcs_switch_elem_pos(size_t ipos, size_t jpos)
Swaps the indices for all of the global data for two elements, ipos and jpos.