-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathImplantedDiamond.cpp
91 lines (77 loc) · 2.33 KB
/
ImplantedDiamond.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#include <tr1/unordered_map>
#include "ImplantedDiamond.h"
ImplantedDiamond::ImplantedDiamond(DamageModelInterface *model, double fluence)
: _model(model),
_fluence(fluence),
_trim_calculator("1-MeV-He-in-Diamond.dat", _fluence),
_transducing_layer(TransducingLayer())
{
_vacancy_map = new std::tr1::unordered_map<double,double>();
}
ImplantedDiamond::~ImplantedDiamond()
{
delete _vacancy_map;
}
double ImplantedDiamond::smallest_feature() const
{
return 20e-9; // m
}
double ImplantedDiamond::max_interesting_depth() const
{
return 2e-6; // m
}
double ImplantedDiamond::speed_of_sound(double z) const
{
return 17520.0; // m/s
}
double ImplantedDiamond::p12(double z, double lambda) const
{
if (z < 0) return 0.0;
return _model->p12(VacancyConcentration(z));
}
double ImplantedDiamond::n(double z, double lambda) const
{
if (z < 0) return 1.0;
return _model->n(VacancyConcentration(z));
}
double ImplantedDiamond::kappa(double z, double lambda) const
{
if (z < 0) return 0.0;
return _model->kappa(VacancyConcentration(z));
}
std::string ImplantedDiamond::description() const
{
return std::string("Implanted diamond sample");
}
void ImplantedDiamond::PrintCustomParameters(std::ostream & out, std::string tag) const
{
out << tag << " Fluence: " << _fluence << " cm-2" << std::endl;
out << tag << " TRIM Calculator: " << _trim_calculator.description() << std::endl;
out << tag << " Damage Model: " << _model->description() << std::endl;
_model->print_parameters(out, tag);
}
TransducingLayer ImplantedDiamond::transducing_layer() const
{
return _transducing_layer;
}
double ImplantedDiamond::VacancyConcentration(double depth) const
{
std::tr1::unordered_map<double,double>::const_iterator got = _vacancy_map->find(depth);
if (got == _vacancy_map->end())
{
double result = _trim_calculator.vacancy_concentration(depth);
_vacancy_map->insert(std::pair<double,double>(depth, result));
return result;
}
return got->second;
}
void ImplantedDiamond::set_transducing_layer(const TransducingLayer & tl)
{
_transducing_layer = tl;
}
CapMaterialInterface * ImplantedDiamond::clone() const
{
ImplantedDiamond * output = new ImplantedDiamond(_model->clone(), _fluence);
output->set_transducing_layer(_transducing_layer);
return output;
}