/* SPDX-FileCopyrightText: Copyright (c) 2020 - 2026, the adamantine authors. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef GOLDAK_HEAT_SOURCE_HH #define GOLDAK_HEAT_SOURCE_HH #include #include #include namespace adamantine { /** * A derived class from HeatSource for the Goldak model of a laser heat source. * The form of the heat source model is taken from the following reference: * Coleman et al, Journal of Heat Transfer, (in press, 2020). */ template class GoldakHeatSource final : public HeatSource { public: /** * Constructor. * \param[in] beam_database requires the following entries: * - absorption_efficiency: double in \f$[0,1]\f$ * - depth: double in \f$[0,\infty)\f$ * - diameter: double in \f$[0,\infty)\f$ * - max_power: double in \f$[0, \infty)\f$ * - input_file: name of the file that contains the scan path * segments * \param[in] units_optional_database may contain the following entries: * - heat_source.dimension * - heat_source.power */ GoldakHeatSource(boost::property_tree::ptree const &beam_database, boost::optional const &units_optional_database); /** * Set the time variable. */ void update_time(double time) final; /** * Returns the value of a Goldak heat source at a specified point and * time. */ double value(dealii::Point const &point) const final; /** * Same function as above but it uses vectorized data. */ dealii::VectorizedArray value(dealii::Point> const &points) const final; dealii::BoundingBox get_bounding_box(double time, double const scaling_factor) const final; private: bool const _five_axis; Quaternion _quaternion; dealii::Point<3, dealii::VectorizedArray> _beam_center; dealii::VectorizedArray _alpha = std::numeric_limits::signaling_NaN(); dealii::VectorizedArray _depth = std::numeric_limits::signaling_NaN(); dealii::VectorizedArray _inv_depth_squared = std::numeric_limits::signaling_NaN(); dealii::VectorizedArray _radius_squared = std::numeric_limits::signaling_NaN(); dealii::VectorizedArray _inv_radius_squared = std::numeric_limits::signaling_NaN(); double const _pi_over_3_to_1p5 = std::pow(dealii::numbers::PI / 3.0, 1.5); }; } // namespace adamantine #endif