Cantera  2.1.2
vcs_rearrange.cpp
Go to the documentation of this file.
1 /**
2  * @file vcs_rearrange.cpp
3  * implementation file for rearranging species.
4  */
5 /*
6  * Copyright (2007) Sandia Corporation. Under the terms of
7  * Contract DE-AC04-94AL85000 with Sandia Corporation, the
8  * U.S. Government retains certain rights in this software.
9  */
10 
13 
14 namespace VCSnonideal
15 {
17 {
18  size_t i, l, j;
19  size_t k1 = 0;
20 
21  /* - Loop over all of the species */
22  for (i = 0; i < m_numSpeciesTot; ++i) {
23  /*
24  * Find the index of I in the index vector m_speciesIndexVector[].
25  * Call it k1 and continue.
26  */
27  for (j = 0; j < m_numSpeciesTot; ++j) {
28  l = m_speciesMapIndex[j];
29  k1 = j;
30  if (l == i) {
31  break;
32  }
33  }
34  /*
35  * - Switch the species data back from k1 into i
36  * -> because we loop over all species, reaction data
37  * are now permanently hosed.
38  */
39  vcs_switch_pos(false, i, k1);
40  }
41  return 0;
42 }
43 
44 }
void vcs_switch_pos(const bool ifunc, const size_t k1, const size_t k2)
Swaps the indices for all of the global data for two species, k1 and k2.
Header file for the internal object that holds the vcs equilibrium problem (see Class VCS_SOLVE and E...
std::vector< size_t > m_speciesMapIndex
Index vector that keeps track of the species vector rearrangement.
Definition: vcs_solve.h:1785
Internal declarations for the VCSnonideal package.
size_t m_numSpeciesTot
Total number of species in the problems.
Definition: vcs_solve.h:1497
int vcs_rearrange()
Switch all species data back to the original order.