/* SPDX-FileCopyrightText: Copyright (c) 2023 - 2025, the adamantine authors. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include #include #include namespace adamantine { template GravityForce:: GravityForce(MaterialProperty &material_properties) : _material_properties(material_properties) { } template dealii::Tensor<1, dim, double> GravityForce::eval( typename dealii::Triangulation::active_cell_iterator const &cell) { // Note that the density is independent of the temperature double density = _material_properties.get_mechanical_property( cell, StateProperty::density_s); dealii::Tensor<1, dim, double> body_force; body_force[axis::z] = -density * g; return body_force; } } // namespace adamantine INSTANTIATE_DIM_NMAT_PORDER_MATERIALSTATES_HOST(GravityForce) INSTANTIATE_DIM_NMAT_PORDER_MATERIALSTATES_DEVICE(GravityForce)