Skip to content

Commit ac4d8a9

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

11 files changed

+87
-154
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: 19 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,26 @@ 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
*/
4948
double value(dealii::Point<dim> const &point,
50-
double const /*height*/) const final;
49+
double const /*height*/) const;
5150
/**
5251
* Compute the current height of the where the heat source meets the material
5352
* (i.e. the current scan path height).
5453
*/
55-
double get_current_height(double const time) const final;
54+
double get_current_height(double const time) const;
55+
56+
void set_beam_properties(
57+
boost::property_tree::ptree const &database)
58+
{
59+
_beam.set_from_database(database);
60+
}
61+
62+
BeamHeatSourceProperties get_beam_properties() const { return _beam; }
5663

5764
private:
5865
bool _source_on = false;
@@ -61,7 +68,12 @@ private:
6168
double _value;
6269
dealii::Point<dim> _min_point;
6370
dealii::Point<dim> _max_point;
64-
};
71+
double _alpha;
72+
/**
73+
* Structure of the physical properties of the beam heat source.
74+
*/
75+
BeamHeatSourceProperties _beam;
76+
};
6577
} // namespace adamantine
6678

6779
#endif

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: 30 additions & 5 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,42 @@ 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
*/
4647
double value(dealii::Point<dim> const &point,
47-
double const height) const final;
48+
double const height) const;
49+
50+
ScanPath<MemorySpaceType> const &get_scan_path() const {return _scan_path;}
51+
52+
double get_current_height(double const time) const
53+
{
54+
return _scan_path.value(time)[2];
55+
}
56+
57+
void set_beam_properties(
58+
boost::property_tree::ptree const &database)
59+
{
60+
_beam.set_from_database(database);
61+
}
62+
63+
BeamHeatSourceProperties get_beam_properties() const { return _beam; }
4864

4965
private:
5066
dealii::Point<3> _beam_center;
5167
double _alpha;
68+
/**
69+
* Structure of the physical properties of the beam heat source.
70+
*/
71+
BeamHeatSourceProperties _beam;
72+
73+
/**
74+
* The scan path for the heat source.
75+
*/
76+
ScanPath<MemorySpaceType> _scan_path;
5277
};
5378
} // namespace adamantine
5479

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: 30 additions & 5 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,42 @@ 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
*/
4647
double value(dealii::Point<dim> const &point,
47-
double const height) const final;
48+
double const height) const;
49+
50+
ScanPath<MemorySpaceType> const &get_scan_path() const {return _scan_path;}
51+
52+
double get_current_height(double const time) const
53+
{
54+
return _scan_path.value(time)[2];
55+
}
56+
57+
void set_beam_properties(
58+
boost::property_tree::ptree const &database)
59+
{
60+
_beam.set_from_database(database);
61+
}
62+
63+
BeamHeatSourceProperties get_beam_properties() const { return _beam; }
4864

4965
private:
5066
dealii::Point<3> _beam_center;
5167
double _alpha;
68+
/**
69+
* Structure of the physical properties of the beam heat source.
70+
*/
71+
BeamHeatSourceProperties _beam;
72+
73+
/**
74+
* The scan path for the heat source.
75+
*/
76+
ScanPath<MemorySpaceType> _scan_path;
5277
};
5378
} // namespace adamantine
5479

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
@@ -19,6 +19,8 @@
1919
#include <istream>
2020
#include <vector>
2121

22+
#include <Kokkos_Core.hpp>
23+
2224
namespace adamantine
2325
{
2426
/**

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)