Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90433663
ElectronHeatCapacity.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Nov 1, 15:08
Size
2 KB
Mime Type
text/x-c
Expires
Sun, Nov 3, 15:08 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
21805724
Attached To
rLAMMPS lammps
ElectronHeatCapacity.cpp
View Options
#include "ElectronHeatCapacity.h"
#include "ATC_Error.h"
#include <iostream>
#include <fstream>
#include <vector>
using
ATC_Utility
::
command_line
;
using
ATC_Utility
::
str2dbl
;
using
std
::
fstream
;
using
std
::
map
;
using
std
::
string
;
using
std
::
vector
;
namespace
ATC
{
ElectronHeatCapacityConstant
::
ElectronHeatCapacityConstant
(
fstream
&
fileId
,
map
<
string
,
double
>
&
parameters
)
:
ElectronHeatCapacity
(),
electronHeatCapacity_
(
0
)
{
if
(
!
fileId
.
is_open
())
throw
ATC_Error
(
"cannot open material file"
);
vector
<
string
>
line
;
while
(
fileId
.
good
())
{
command_line
(
fileId
,
line
);
if
(
line
.
size
()
==
0
)
continue
;
if
(
line
[
0
]
==
"end"
)
return
;
else
if
(
line
[
0
]
==
"capacity"
)
{
electronHeatCapacity_
=
str2dbl
(
line
[
1
]);
parameters
[
"electron_heat_capacity"
]
=
electronHeatCapacity_
;
}
else
{
throw
ATC_Error
(
"unrecognized material function:"
+
line
[
0
]);
}
}
}
ElectronHeatCapacityLinear
::
ElectronHeatCapacityLinear
(
fstream
&
fileId
,
map
<
string
,
double
>
&
parameters
)
:
ElectronHeatCapacity
(),
electronHeatCapacity_
(
0
)
{
if
(
!
fileId
.
is_open
())
throw
ATC_Error
(
"cannot open material file"
);
vector
<
string
>
line
;
while
(
fileId
.
good
())
{
command_line
(
fileId
,
line
);
if
(
line
.
size
()
==
0
)
continue
;
if
(
line
[
0
]
==
"end"
)
return
;
else
if
(
line
[
0
]
==
"capacity"
)
{
electronHeatCapacity_
=
str2dbl
(
line
[
1
]);
parameters
[
"electron_heat_capacity"
]
=
electronHeatCapacity_
;
}
else
{
throw
ATC_Error
(
"unrecognized material function: "
+
line
[
0
]);
}
}
}
ElectronHeatCapacityConstantAddDensity
::
ElectronHeatCapacityConstantAddDensity
(
fstream
&
fileId
,
map
<
string
,
double
>
&
parameters
,
Material
*
material
)
:
ElectronHeatCapacityConstant
(
fileId
,
parameters
),
material_
(
material
)
{
// do nothing
}
ElectronHeatCapacityLinearAddDensity
::
ElectronHeatCapacityLinearAddDensity
(
fstream
&
fileId
,
map
<
string
,
double
>
&
parameters
,
Material
*
material
)
:
ElectronHeatCapacityLinear
(
fileId
,
parameters
),
material_
(
material
)
{
// do nothing
}
}
Event Timeline
Log In to Comment