[Kinetics] Move 'rmcVector' down to ElectrodeKinetics
This commit is contained in:
parent
813cc36f8e
commit
b5b1e89814
4 changed files with 33 additions and 36 deletions
|
|
@ -105,6 +105,14 @@ public:
|
|||
*/
|
||||
virtual void init();
|
||||
|
||||
virtual void finalize();
|
||||
|
||||
//! Vector of additional information about each reaction
|
||||
/*!
|
||||
* This vector contains information about the phase mole change for each reaction,
|
||||
* for example.
|
||||
*/
|
||||
std::vector<RxnMolChange*> rmcVector;
|
||||
|
||||
protected:
|
||||
//! Index of the metal phase in the list of phases for this kinetics object. This is the electron phase.
|
||||
|
|
|
|||
|
|
@ -432,15 +432,6 @@ protected:
|
|||
//! Number of reversible reactions in the mechanism
|
||||
size_t m_nrev;
|
||||
|
||||
public:
|
||||
//! Vector of additional information about each reaction
|
||||
/*!
|
||||
* This vector contains information about the phase mole change for each reaction,
|
||||
* for example.
|
||||
*/
|
||||
std::vector<RxnMolChange*> rmcVector;
|
||||
|
||||
protected:
|
||||
//! Array of concentrations for each species in the kinetics mechanism
|
||||
/*!
|
||||
* An array of generalized concentrations \f$ C_k \f$ that are defined
|
||||
|
|
|
|||
|
|
@ -24,7 +24,9 @@ ElectrodeKinetics::ElectrodeKinetics(thermo_t* thermo) :
|
|||
//============================================================================================================================
|
||||
ElectrodeKinetics::~ElectrodeKinetics()
|
||||
{
|
||||
|
||||
for (size_t i = 0; i < rmcVector.size(); i++) {
|
||||
delete rmcVector[i];
|
||||
}
|
||||
}
|
||||
//============================================================================================================================
|
||||
ElectrodeKinetics::ElectrodeKinetics(const ElectrodeKinetics& right) :
|
||||
|
|
@ -51,7 +53,17 @@ ElectrodeKinetics& ElectrodeKinetics::operator=(const ElectrodeKinetics& right)
|
|||
metalPhaseIndex_ = right.metalPhaseIndex_;
|
||||
solnPhaseIndex_ = right.solnPhaseIndex_;
|
||||
kElectronIndex_ = right.kElectronIndex_;
|
||||
|
||||
|
||||
for (size_t i = 0; i < rmcVector.size(); i++) {
|
||||
delete rmcVector[i];
|
||||
}
|
||||
rmcVector.resize(m_ii, 0);
|
||||
for (size_t i = 0; i < m_ii; i++) {
|
||||
if (right.rmcVector[i]) {
|
||||
rmcVector[i] = new RxnMolChange(*(right.rmcVector[i]));
|
||||
}
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
//============================================================================================================================
|
||||
|
|
@ -876,6 +888,17 @@ void ElectrodeKinetics::init()
|
|||
InterfaceKinetics::init();
|
||||
identifyMetalPhase();
|
||||
}
|
||||
|
||||
void ElectrodeKinetics::finalize()
|
||||
{
|
||||
InterfaceKinetics::finalize();
|
||||
// Malloc and calculate all of the quantities that go into the extra description of reactions
|
||||
rmcVector.resize(m_ii, 0);
|
||||
for (size_t i = 0; i < m_ii; i++) {
|
||||
rmcVector[i] = new RxnMolChange(this, i);
|
||||
}
|
||||
}
|
||||
|
||||
//==================================================================================================================
|
||||
|
||||
double ElectrodeKinetics::solveCurrentRes(double nu, double nStoich, doublereal ioc, doublereal beta, doublereal temp,
|
||||
|
|
|
|||
|
|
@ -45,9 +45,6 @@ InterfaceKinetics::~InterfaceKinetics()
|
|||
{
|
||||
delete m_integrator;
|
||||
|
||||
for (size_t i = 0; i < rmcVector.size(); i++) {
|
||||
delete rmcVector[i];
|
||||
}
|
||||
for (size_t i = 0; i < m_ctrxn_ROPOrdersList_.size(); i++) {
|
||||
delete m_ctrxn_ROPOrdersList_[i];
|
||||
}
|
||||
|
|
@ -117,16 +114,6 @@ InterfaceKinetics& InterfaceKinetics::operator=(const InterfaceKinetics& right)
|
|||
m_rxnPhaseIsProduct = right.m_rxnPhaseIsProduct;
|
||||
m_ioFlag = right.m_ioFlag;
|
||||
|
||||
for (size_t i = 0; i < rmcVector.size(); i++) {
|
||||
delete rmcVector[i];
|
||||
}
|
||||
rmcVector.resize(m_ii, 0);
|
||||
for (size_t i = 0; i < m_ii; i++) {
|
||||
if (right.rmcVector[i]) {
|
||||
rmcVector[i] = new RxnMolChange(*(right.rmcVector[i]));
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < m_ctrxn_ROPOrdersList_.size(); i++) {
|
||||
delete m_ctrxn_ROPOrdersList_[i];
|
||||
}
|
||||
|
|
@ -1175,12 +1162,6 @@ void InterfaceKinetics::finalize()
|
|||
m_rkcn.resize(1, 0.0);
|
||||
}
|
||||
|
||||
// Malloc and calculate all of the quantities that go into the extra description of reactions
|
||||
rmcVector.resize(m_ii, 0);
|
||||
for (size_t i = 0; i < m_ii; i++) {
|
||||
rmcVector[i] = new RxnMolChange(this, i);
|
||||
}
|
||||
|
||||
m_finalized = true;
|
||||
}
|
||||
|
||||
|
|
@ -1417,12 +1398,6 @@ void EdgeKinetics::finalize()
|
|||
m_rkcn.resize(1, 0.0);
|
||||
}
|
||||
|
||||
// Malloc and calculate all of the quantities that go into the extra description of reactions
|
||||
rmcVector.resize(m_ii, 0);
|
||||
for (size_t i = 0; i < m_ii; i++) {
|
||||
rmcVector[i] = new RxnMolChange(this, i);
|
||||
}
|
||||
|
||||
m_finalized = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue