/* SPDX-FileCopyrightText: Copyright (c) 2023 - 2025, the adamantine authors. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef BODY_FORCE_HH #define BODY_FORCE_HH #include #include #include #include namespace adamantine { /** * Base class that describes the interface that body forces need to implement. */ template struct BodyForce { /** * Evaluate the body force given a cell. */ virtual dealii::Tensor<1, dim, double> eval(typename dealii::Triangulation::active_cell_iterator const &cell) = 0; }; // Forward declaration template class MaterialProperty; /** * Gravity's body force. */ template class GravityForce final : public BodyForce { public: GravityForce(MaterialProperty &material_properties); dealii::Tensor<1, dim, double> eval(typename dealii::Triangulation::active_cell_iterator const &cell) final; private: /** * Gravity in \f$m/s^2\f$ */ static double constexpr g = 9.80665; MaterialProperty &_material_properties; }; } // namespace adamantine #endif