Cantera  2.3.0
SolidTransportData.cpp
Go to the documentation of this file.
1 /**
2  * @file SolidTransportData.cpp
3  * Source code for solid transport property evaluations.
4  */
5 
6 // This file is part of Cantera. See License.txt in the top-level directory or
7 // at http://www.cantera.org/license.txt for license and copyright information.
8 
10 
11 using namespace std;
12 
13 namespace Cantera
14 {
15 SolidTransportData::SolidTransportData() :
16  speciesName("-"),
17  ionConductivity(0),
18  thermalConductivity(0),
19  electConductivity(0),
20  defectDiffusivity(0),
21  defectActivity(0)
22 {
23 }
24 
25 SolidTransportData::SolidTransportData(const SolidTransportData& right) :
26  speciesName("-"),
27  ionConductivity(0),
28  thermalConductivity(0),
29  electConductivity(0),
30  defectDiffusivity(0),
31  defectActivity(0)
32 {
33  *this = right; //use assignment operator to do other work
34 }
35 
36 SolidTransportData& SolidTransportData::operator=(const SolidTransportData& right)
37 {
38  if (&right != this) {
39  // These are all shallow pointer copies - yes, yes, yes horrible crime.
40  speciesName = right.speciesName;
41  if (right.ionConductivity) {
42  ionConductivity = (right.ionConductivity)->duplMyselfAsLTPspecies();
43  }
44 
45  if (right.thermalConductivity) {
46  thermalConductivity = (right.thermalConductivity)->duplMyselfAsLTPspecies();
47  }
48  if (right.electConductivity) {
49  electConductivity = (right.electConductivity)->duplMyselfAsLTPspecies();
50  }
51  if (right.defectDiffusivity) {
52  defectDiffusivity = (right.defectDiffusivity)->duplMyselfAsLTPspecies();
53  }
54  if (right.defectActivity) {
55  defectActivity = (right.defectActivity)->duplMyselfAsLTPspecies();
56  }
57  }
58  return *this;
59 }
60 
61 SolidTransportData::~SolidTransportData()
62 {
63  delete ionConductivity;
64  delete thermalConductivity;
65  delete electConductivity;
66  delete defectDiffusivity;
67  delete defectActivity;
68 }
69 
70 }
LTPspecies * defectDiffusivity
Model type for the defectDiffusivity – or more like a defect diffusivity in the context of the solid...
LTPspecies * defectActivity
Model type for the defectActivity.
Header file defining class SolidTransportData.
STL namespace.
LTPspecies * electConductivity
Model type for the electrical conductivity.
std::string speciesName
A SolidTransportData object is instantiated for each species.
LTPspecies * ionConductivity
Model type for the ionic conductivity.
LTPspecies * thermalConductivity
Model type for the thermal conductivity.
Namespace for the Cantera kernel.
Definition: application.cpp:29