Skip to content

Commit cf6263f

Browse files
committed
Remove HeatSource.hh
1 parent 5fdff90 commit cf6263f

11 files changed

+87
-158
lines changed

source/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set(Adamantine_HEADERS
77
${CMAKE_CURRENT_SOURCE_DIR}/ExperimentalData.hh
88
${CMAKE_CURRENT_SOURCE_DIR}/Geometry.hh
99
${CMAKE_CURRENT_SOURCE_DIR}/GoldakHeatSource.hh
10-
${CMAKE_CURRENT_SOURCE_DIR}/HeatSource.hh
10+
${CMAKE_CURRENT_SOURCE_DIR}/HeatSources.hh
1111
${CMAKE_CURRENT_SOURCE_DIR}/ImplicitOperator.hh
1212
${CMAKE_CURRENT_SOURCE_DIR}/MaterialProperty.hh
1313
${CMAKE_CURRENT_SOURCE_DIR}/MaterialProperty.templates.hh

source/CubeHeatSource.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ namespace adamantine
1515
{
1616
template <int dim>
1717
CubeHeatSource<dim>::CubeHeatSource(boost::property_tree::ptree const &database)
18-
: HeatSource<dim, dealii::MemorySpace::Default>()
1918
{
2019
_start_time = database.get<double>("start_time");
2120
_end_time = database.get<double>("end_time");

source/CubeHeatSource.hh

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#ifndef CUBE_HEAT_SOURCE_HH
99
#define CUBE_HEAT_SOURCE_HH
1010

11-
#include <HeatSource.hh>
11+
#include <BeamHeatSourceProperties.hh>
1212

13-
#include <deal.II/base/memory_space.h>
13+
#include <deal.II/base/point.h>
1414

1515
namespace adamantine
1616
{
@@ -20,7 +20,6 @@ namespace adamantine
2020
*/
2121
template <int dim>
2222
class CubeHeatSource final
23-
: public HeatSource<dim, dealii::MemorySpace::Default>
2423
{
2524
public:
2625
/**
@@ -41,18 +40,24 @@ public:
4140
/**
4241
* Set the time variable.
4342
*/
44-
void update_time(double time) final;
43+
void update_time(double time);
4544

4645
/**
4746
* Return the value of the source for a given point and time.
4847
*/
49-
double value(dealii::Point<dim> const &point,
50-
double const /*height*/) const final;
48+
double value(dealii::Point<dim> const &point, double const /*height*/) const;
5149
/**
5250
* Compute the current height of the where the heat source meets the material
5351
* (i.e. the current scan path height).
5452
*/
55-
double get_current_height(double const time) const final;
53+
double get_current_height(double const time) const;
54+
55+
void set_beam_properties(boost::property_tree::ptree const &database)
56+
{
57+
_beam.set_from_database(database);
58+
}
59+
60+
BeamHeatSourceProperties get_beam_properties() const { return _beam; }
5661

5762
private:
5863
bool _source_on = false;
@@ -61,6 +66,11 @@ private:
6166
double _value;
6267
dealii::Point<dim> _min_point;
6368
dealii::Point<dim> _max_point;
69+
double _alpha;
70+
/**
71+
* Structure of the physical properties of the beam heat source.
72+
*/
73+
BeamHeatSourceProperties _beam;
6474
};
6575
} // namespace adamantine
6676

source/ElectronBeamHeatSource.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ template <int dim, typename MemorySpaceType>
1818
ElectronBeamHeatSource<dim, MemorySpaceType>::ElectronBeamHeatSource(
1919
BeamHeatSourceProperties const &beam,
2020
ScanPath<MemorySpaceType> const &scan_path)
21-
: HeatSource<dim, MemorySpaceType>(beam, scan_path)
21+
: _beam(beam), _scan_path(scan_path)
2222
{
2323
}
2424

source/ElectronBeamHeatSource.hh

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,18 @@
88
#ifndef ELECTRON_BEAM_HEAT_SOURCE_HH
99
#define ELECTRON_BEAM_HEAT_SOURCE_HH
1010

11-
#include <HeatSource.hh>
11+
#include <BeamHeatSourceProperties.hh>
12+
#include <ScanPath.hh>
1213

1314
namespace adamantine
1415
{
1516
/**
16-
* A derived class from HeatSource for a model of an electron beam heat source.
17+
* A model of an electron beam heat source.
1718
* The form of the heat source model is taken from the following reference:
1819
* Raghavan et al, Acta Materilia, 112, 2016, pp 303-314.
1920
*/
2021
template <int dim, typename MemorySpaceType>
21-
class ElectronBeamHeatSource final : public HeatSource<dim, MemorySpaceType>
22+
class ElectronBeamHeatSource
2223
{
2324
public:
2425
/**
@@ -37,18 +38,40 @@ public:
3738
/**
3839
* Set the time variable.
3940
*/
40-
void update_time(double time) final;
41+
void update_time(double time);
4142

4243
/**
4344
* Returns the value of an electron beam heat source at a specified point and
4445
* time.
4546
*/
46-
double value(dealii::Point<dim> const &point,
47-
double const height) const final;
47+
double value(dealii::Point<dim> const &point, double const height) const;
48+
49+
ScanPath<MemorySpaceType> const &get_scan_path() const { return _scan_path; }
50+
51+
double get_current_height(double const time) const
52+
{
53+
return _scan_path.value(time)[2];
54+
}
55+
56+
void set_beam_properties(boost::property_tree::ptree const &database)
57+
{
58+
_beam.set_from_database(database);
59+
}
60+
61+
BeamHeatSourceProperties get_beam_properties() const { return _beam; }
4862

4963
private:
5064
dealii::Point<3> _beam_center;
5165
double _alpha;
66+
/**
67+
* Structure of the physical properties of the beam heat source.
68+
*/
69+
BeamHeatSourceProperties _beam;
70+
71+
/**
72+
* The scan path for the heat source.
73+
*/
74+
ScanPath<MemorySpaceType> _scan_path;
5275
};
5376
} // namespace adamantine
5477

source/GoldakHeatSource.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ template <int dim, typename MemorySpaceType>
1818
GoldakHeatSource<dim, MemorySpaceType>::GoldakHeatSource(
1919
BeamHeatSourceProperties const &beam,
2020
ScanPath<MemorySpaceType> const &scan_path)
21-
: HeatSource<dim, MemorySpaceType>(beam, scan_path)
21+
: _beam(beam), _scan_path(scan_path)
2222
{
2323
}
2424

source/GoldakHeatSource.hh

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,18 @@
88
#ifndef GOLDAK_HEAT_SOURCE_HH
99
#define GOLDAK_HEAT_SOURCE_HH
1010

11-
#include <HeatSource.hh>
11+
#include <BeamHeatSourceProperties.hh>
12+
#include <ScanPath.hh>
1213

1314
namespace adamantine
1415
{
1516
/**
16-
* A derived class from HeatSource for the Goldak model of a laser heat source.
17+
* Goldak model of a laser heat source.
1718
* The form of the heat source model is taken from the following reference:
1819
* Coleman et al, Journal of Heat Transfer, (in press, 2020).
1920
*/
2021
template <int dim, typename MemorySpaceType>
21-
class GoldakHeatSource final : public HeatSource<dim, MemorySpaceType>
22+
class GoldakHeatSource
2223
{
2324
public:
2425
/**
@@ -37,18 +38,40 @@ public:
3738
/**
3839
* Set the time variable.
3940
*/
40-
void update_time(double time) final;
41+
void update_time(double time);
4142

4243
/**
4344
* Returns the value of a Goldak heat source at a specified point and
4445
* time.
4546
*/
46-
double value(dealii::Point<dim> const &point,
47-
double const height) const final;
47+
double value(dealii::Point<dim> const &point, double const height) const;
48+
49+
ScanPath<MemorySpaceType> const &get_scan_path() const { return _scan_path; }
50+
51+
double get_current_height(double const time) const
52+
{
53+
return _scan_path.value(time)[2];
54+
}
55+
56+
void set_beam_properties(boost::property_tree::ptree const &database)
57+
{
58+
_beam.set_from_database(database);
59+
}
60+
61+
BeamHeatSourceProperties get_beam_properties() const { return _beam; }
4862

4963
private:
5064
dealii::Point<3> _beam_center;
5165
double _alpha;
66+
/**
67+
* Structure of the physical properties of the beam heat source.
68+
*/
69+
BeamHeatSourceProperties _beam;
70+
71+
/**
72+
* The scan path for the heat source.
73+
*/
74+
ScanPath<MemorySpaceType> _scan_path;
5275
};
5376
} // namespace adamantine
5477

source/HeatSource.hh

Lines changed: 0 additions & 128 deletions
This file was deleted.

source/ScanPath.hh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#include <boost/filesystem.hpp>
1616
#include <boost/property_tree/ptree.hpp>
1717

18+
#include <Kokkos_Core.hpp>
19+
1820
#include <iostream>
1921
#include <istream>
2022
#include <vector>

source/ThermalPhysicsInterface.hh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ namespace adamantine
1919
// Forward declarations
2020
class Timer;
2121

22-
template <int dim, typename MemorySpaceType>
23-
class HeatSource;
24-
2522
/**
2623
* This class defines the interface for ThermalPhysics used in run(). The
2724
* objective of this class is to simplify code in run() by reducing the number

0 commit comments

Comments
 (0)