-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOliveroDamageModel.cpp
70 lines (60 loc) · 1.68 KB
/
OliveroDamageModel.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include "OliveroDamageModel.h"
#include "UndamagedDiamondModel.h"
OliveroDamageModel::OliveroDamageModel()
: _n_0(2.47), _c(4.3e-23)
{ }
double OliveroDamageModel::n(double vacancy_concentration) const
{
return _n_0 + _c * vacancy_concentration;
}
double OliveroDamageModel::kappa(double vacancy_concentration) const
{
UndamagedDiamondModel model;
return model.kappa(vacancy_concentration);
}
double OliveroDamageModel::p12(double vacancy_concentration) const
{
UndamagedDiamondModel model;
return model.p12(vacancy_concentration);
}
std::string OliveroDamageModel::description() const
{
return "Damage model for real index from Olivero et al Diamond and Related Materials 19, 428 (2010). n(C_V) = n_0 + c * C_V. Imaginary index and p12 are same as undamaged diamond.";
}
std::string OliveroDamageModel::name() const
{
return "olivero";
}
unsigned int OliveroDamageModel::ParameterCount() const
{
return 2;
}
std::vector <Parameter> OliveroDamageModel::parameters() const
{
std::vector <Parameter> out;
out.resize(2);
out[0].name = "n_0";
out[0].value = _n_0;
out[0].units = "";
out[1].name = "c";
out[1].value = _c;
out[1].units = "cm^3";
return out;
}
void OliveroDamageModel::_set_parameters(const std::vector <double> & new_parameters)
{
_n_0 = new_parameters[0];
_c = new_parameters[1];
}
OliveroDamageModel * OliveroDamageModel::clone() const
{
OliveroDamageModel * out = new OliveroDamageModel();
std::vector <Parameter> params_all = parameters();
std::vector <double> params_values;
for (unsigned int i = 0; i < ParameterCount(); i++)
{
params_values.push_back(params_all[i].value);
}
out->set_parameters(params_values);
return out;
}