@@ -29,7 +29,7 @@ namespace adamantine
2929 * of the part, and the second component is the thickness. That is, the last two
3030 * components are swapped between the two coordinate systems.
3131 */
32- template <int dim>
32+ template <int dim, typename MemorySpaceType >
3333class HeatSource
3434{
3535public:
@@ -49,12 +49,9 @@ public:
4949 * - <B>input_file</B>: name of the file that contains the scan path
5050 * segments
5151 */
52- HeatSource (boost::property_tree::ptree const &database)
53- : _beam(database),
54- // PropertyTreeInput sources.beam_X.scan_path_file
55- // PropertyTreeInput sources.beam_X.scan_path_format
56- _scan_path (database.get<std::string>(" scan_path_file" ),
57- database.get<std::string>(" scan_path_file_format" ))
52+ HeatSource (BeamHeatSourceProperties const &beam,
53+ ScanPath<MemorySpaceType> const &scan_path)
54+ : _beam(beam), _scan_path(scan_path)
5855 {
5956 }
6057
@@ -77,7 +74,7 @@ public:
7774 /* *
7875 * Return the scan path for the heat source.
7976 */
80- virtual ScanPath const &get_scan_path () const ;
77+ virtual ScanPath<MemorySpaceType> const &get_scan_path () const ;
8178
8279 /* *
8380 * Compute the current height of the where the heat source meets the material
@@ -100,23 +97,25 @@ protected:
10097 /* *
10198 * The scan path for the heat source.
10299 */
103- ScanPath _scan_path;
100+ ScanPath<MemorySpaceType> _scan_path;
104101};
105102
106- template <int dim>
107- inline ScanPath const &HeatSource<dim>::get_scan_path() const
103+ template <int dim, typename MemorySpaceType>
104+ inline ScanPath<MemorySpaceType> const &
105+ HeatSource<dim, MemorySpaceType>::get_scan_path() const
108106{
109107 return _scan_path;
110108}
111109
112- template <int dim>
113- inline double HeatSource<dim>::get_current_height(double const time) const
110+ template <int dim, typename MemorySpaceType>
111+ inline double
112+ HeatSource<dim, MemorySpaceType>::get_current_height(double const time) const
114113{
115114 return _scan_path.value (time)[2 ];
116115}
117116
118- template <int dim>
119- inline void HeatSource<dim>::set_beam_properties(
117+ template <int dim, typename MemorySpaceType >
118+ inline void HeatSource<dim, MemorySpaceType >::set_beam_properties(
120119 boost::property_tree::ptree const &database)
121120{
122121 _beam.set_from_database (database);
0 commit comments