Cantera  2.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  * $Author: hkmoffa $
7  * $Date: 2010-07-13 13:22:30 -0600 (Tue, 13 Jul 2010) $
8  * $Revision: 507 $
9  */
10 
12 
13 using namespace std;
14 
15 #ifndef SAFE_DELETE
16 #define SAFE_DELETE(x) if (x) { delete (x); x = 0; }
17 #endif
18 namespace Cantera
19 {
20 
21 //====================================================================================================================
22 SolidTransportData::SolidTransportData() :
23  speciesName("-"),
24  ionConductivity(0),
25  thermalConductivity(0),
26  electConductivity(0),
27  defectDiffusivity(0),
28  defectActivity(0)
29 {
30 
31 }
32 //====================================================================================================================
33 // Copy constructor
35  speciesName("-"),
36  ionConductivity(0),
37  thermalConductivity(0),
38  electConductivity(0),
39  defectDiffusivity(0),
40  defectActivity(0)
41 {
42  *this = right; //use assignment operator to do other work
43 }
44 //====================================================================================================================
45 // Assignment operator
47 {
48  if (&right != this) {
49  // These are all shallow pointer copies - yes, yes, yes horrible crime.
50  speciesName = right.speciesName;
51  if (right.ionConductivity) {
52  ionConductivity = (right.ionConductivity)->duplMyselfAsLTPspecies();
53  }
54 
55  if (right.thermalConductivity) {
56  thermalConductivity = (right.thermalConductivity)->duplMyselfAsLTPspecies();
57  }
58  if (right.electConductivity) {
59  electConductivity = (right.electConductivity)->duplMyselfAsLTPspecies();
60  }
61  if (right.defectDiffusivity) {
62  defectDiffusivity = (right.defectDiffusivity)->duplMyselfAsLTPspecies();
63  }
64  if (right.defectActivity) {
65  defectActivity = (right.defectActivity)->duplMyselfAsLTPspecies();
66  }
67  }
68  return *this;
69 }
70 //====================================================================================================================
72 {
73 
74  SAFE_DELETE(ionConductivity);
75  SAFE_DELETE(thermalConductivity);
76  SAFE_DELETE(electConductivity);
77  SAFE_DELETE(defectDiffusivity);
78  SAFE_DELETE(defectActivity);
79 
80 }
81 //====================================================================================================================
82 }