Skip to content

Commit 0025d0f

Browse files
committed
Merge remote-tracking branch 'upstream/master' into introduce_heat_sources
2 parents 69394d1 + 052c98e commit 0025d0f

15 files changed

+197
-126
lines changed

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Contributing
2+
3+
Contributing to adamantine is easy. Just send us a [pullrequest](https://help.github.com/articles/using-pull-requests/).
4+
When you send your request, make `master` the destination branch on the [adamantine repository](https://github.com/adamantine-sim/adamantine).
5+
6+
Your pull request must pass adamantine's tests before being merged into the `master` branch. These tests are (usually) performed automatically through the continuous integration (CI) testing integrated into adamantine's GitHub repository.

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ The following options are available:
150150
* beam\_X.scan\_path\_file: scan path filename (required)
151151
* beam\_X.scan\_path\_file\_format: format of the scan path: segment or
152152
event\_series (required)
153+
* beam\_X.max\_power: maximum power of the beam in watts (required)
153154
* beam\_X.depth: maximum depth reached by the electron beam in meters (required)
154155
* beam\_X.absorption\_efficiency: absorption efficiency of the beam equivalent
155156
to energy\_conversion\_efficiency * control\_efficiency for electon beam. Number
@@ -276,3 +277,7 @@ The first entry of the file is the dimension the problem: 2 or 3.
276277
## Questions
277278
If you have any question, find a bug, or have feature request please open an
278279
issue.
280+
281+
## Contributing
282+
We encourage you to contribute to adamantine! Please check out the
283+
[guidelines](CONTRIBUTING.md) about how to proceed.

application/adamantine.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ get_p_order_and_n_material_states(boost::property_tree::ptree &database)
106106

107107
// Sanity check
108108
adamantine::ASSERT_THROW(
109-
p_order >= 0 && p_order < 5,
109+
p_order < 5,
110110
"Error when computing the polynomial order of the material properties");
111111
adamantine::ASSERT_THROW(
112112
n_material_states > 0 && n_material_states < 4,

application/adamantine.hh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include <deal.II/lac/vector_operation.h>
3838
#include <deal.II/numerics/error_estimator.h>
3939

40+
#include <boost/algorithm/string.hpp>
4041
#include <boost/archive/text_iarchive.hpp>
4142
#include <boost/archive/text_oarchive.hpp>
4243
#include <boost/property_tree/ptree.hpp>
@@ -759,6 +760,7 @@ run(MPI_Comm const &communicator, boost::property_tree::ptree const &database,
759760
std::unique_ptr<adamantine::ThermalPhysicsInterface<dim, MemorySpaceType>>
760761
thermal_physics;
761762
adamantine::HeatSources<dim, MemorySpaceType> heat_sources;
763+
std::vector<std::pair<double, bool>> scan_path_end;
762764
if (use_thermal_physics)
763765
{
764766
// PropertyTreeInput discretization.thermal.fe_degree
@@ -771,6 +773,13 @@ run(MPI_Comm const &communicator, boost::property_tree::ptree const &database,
771773
fe_degree, quadrature_type, communicator, database, geometry,
772774
material_properties);
773775
heat_sources = thermal_physics->get_heat_sources();
776+
// Store the current end time of each heat source and set a flag that the
777+
// scan path has changed
778+
for (auto const &source : heat_sources)
779+
{
780+
scan_path_end.emplace_back(
781+
source->get_scan_path().get_segment_list().back().end_time, true);
782+
}
774783
post_processor_database.put("thermal_output", true);
775784
}
776785

@@ -1001,6 +1010,43 @@ run(MPI_Comm const &communicator, boost::property_tree::ptree const &database,
10011010
if (time > activation_time_end)
10021011
{
10031012
double const eps = time_step / 1e10;
1013+
1014+
// We may need to check if the scan path has been updated. We don't want
1015+
// to keep reading the file if it's not going to be updated. Once we
1016+
// reach the end of the scan path, we reread the scan path file. If it was
1017+
// not updated, we won't try to read it again.
1018+
bool scan_path_updated = false;
1019+
for (unsigned int s = 0; s < scan_path_end.size(); ++s)
1020+
{
1021+
if ((time > scan_path_end[s].first - eps) && (scan_path_end[s].second))
1022+
{
1023+
scan_path_updated = true;
1024+
break;
1025+
}
1026+
}
1027+
if (scan_path_updated)
1028+
{
1029+
for (unsigned int s = 0; s < scan_path_end.size(); ++s)
1030+
{
1031+
// Read the scan path file
1032+
heat_sources[s]->get_scan_path().read_file();
1033+
1034+
// Update scan_path_end
1035+
double new_end_time = heat_sources[s]
1036+
->get_scan_path()
1037+
.get_segment_list()
1038+
.back()
1039+
.end_time;
1040+
scan_path_end[s].second = scan_path_end[s].first != new_end_time;
1041+
scan_path_end[s].first = new_end_time;
1042+
}
1043+
1044+
std::tie(material_deposition_boxes, deposition_times, deposition_cos,
1045+
deposition_sin) =
1046+
adamantine::create_material_deposition_boxes<dim>(geometry_database,
1047+
heat_sources);
1048+
}
1049+
10041050
auto activation_start =
10051051
std::lower_bound(deposition_times.begin(), deposition_times.end(),
10061052
time - eps) -

cmake/SetupDealII.cmake

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,19 @@ find_package(deal.II 9.5 REQUIRED PATHS ${DEAL_II_DIR})
33

44
deal_ii_initialize_cached_variables()
55

6-
if(NOT DEAL_II_WITH_CXX17)
7-
message(FATAL_ERROR "deal.II needs to be configured with C++17 support.")
8-
endif()
6+
set(DEAL_II_REQUIRED_FEATURES ARBORX CXX17 MPI P4EST TRILINOS)
97

10-
if(NOT DEAL_II_WITH_MPI)
11-
message(FATAL_ERROR "deal.II needs to be configured with MPI support.")
12-
endif()
8+
foreach(FEATURE ${DEAL_II_REQUIRED_FEATURES})
9+
if(NOT DEAL_II_WITH_${FEATURE})
10+
list(APPEND DEAL_II_MISSING_FEATURES ${FEATURE})
11+
endif()
12+
endforeach()
1313

14-
if(NOT DEAL_II_WITH_ARBORX)
15-
message(FATAL_ERROR "deal.II needs to be configured with ArborX support.")
14+
if(DEAL_II_MISSING_FEATURES)
15+
string(REPLACE ";" ", " DEAL_II_MISSING_FEATURES "${DEAL_II_MISSING_FEATURES}")
16+
message(FATAL_ERROR "deal.II wasn't configured with all required dependencies. The missing dependencies are ${DEAL_II_MISSING_FEATURES}.")
1617
endif()
1718

1819
if(NOT DEAL_II_ARBORX_WITH_MPI)
1920
message(FATAL_ERROR "ArborX needs to be configured with MPI support.")
2021
endif()
21-
22-
if(NOT DEAL_II_WITH_P4EST)
23-
message(FATAL_ERROR "deal.II needs to be configured with P4EST support.")
24-
endif()
25-
26-
if(NOT DEAL_II_WITH_TRILINOS)
27-
message(FATAL_ERROR "deal.II needs to be configured with Trilinos support.")
28-
endif()

source/ElectronBeamHeatSource.hh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2020 - 2022, the adamantine authors.
1+
/* Copyright (c) 2020 - 2024, the adamantine authors.
22
*
33
* This file is subject to the Modified BSD License and may not be distributed
44
* without copyright and license information. Please refer to the file LICENSE
@@ -11,6 +11,8 @@
1111
#include <BeamHeatSourceProperties.hh>
1212
#include <ScanPath.hh>
1313

14+
#include <limits>
15+
1416
namespace adamantine
1517
{
1618
/**
@@ -70,7 +72,7 @@ public:
7072

7173
private:
7274
dealii::Point<3> _beam_center;
73-
double _alpha;
75+
double _alpha = std::numeric_limits<double>::signaling_NaN();
7476
BeamHeatSourceProperties _beam;
7577
ScanPath<MemorySpaceType> _scan_path;
7678
};

source/GoldakHeatSource.hh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2020 - 2022, the adamantine authors.
1+
/* Copyright (c) 2020 - 2024, the adamantine authors.
22
*
33
* This file is subject to the Modified BSD License and may not be distributed
44
* without copyright and license information. Please refer to the file LICENSE
@@ -11,6 +11,8 @@
1111
#include <BeamHeatSourceProperties.hh>
1212
#include <ScanPath.hh>
1313

14+
#include <limits>
15+
1416
namespace adamantine
1517
{
1618
/**
@@ -70,7 +72,7 @@ public:
7072

7173
private:
7274
dealii::Point<3> _beam_center;
73-
double _alpha;
75+
double _alpha = std::numeric_limits<double>::signaling_NaN();
7476
BeamHeatSourceProperties _beam;
7577

7678
ScanPath<MemorySpaceType> _scan_path;

source/MaterialProperty.hh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,6 @@ public:
5656
dealii::parallel::distributed::Triangulation<dim> const &tria,
5757
boost::property_tree::ptree const &database);
5858

59-
/**
60-
* Copy constructor. It should only be called by KOKKOS_CLASS_LAMBDA. The
61-
* copy constructor does not copy all the member variables of the class.
62-
*/
63-
MaterialProperty(MaterialProperty<dim, p_order, MaterialStates,
64-
MemorySpaceType> const &other);
65-
6659
/**
6760
* Return true if the material properties are given in table format.
6861
* Return false if they are given in polynomial format.

0 commit comments

Comments
 (0)