feat(discretiztion/backend/mfem): added boundary_trace and mass_diagonal backend
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <expected>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "serif/discretization/backend/mfem/term_binding.hpp"
|
||||
|
||||
namespace serif::discretization::backend::mfem
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
/** @brief Assemble a supported reference mass diagonal for scalar copies or intrinsic H(div) vectors. */
|
||||
[[nodiscard]] std::expected<std::vector<double>, std::string> reference_mass_diagonal(const DofMap& binding, bool intrinsic_vector);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Measure the supported coefficients in their reference finite-element geometry.
|
||||
* @return The exact mass-matrix diagonal in the binding's reduced ordering, or an invalid-metric diagnostic.
|
||||
* @note The binding must remain current. Coordinates belong to the reference mesh, not a trial deformation.
|
||||
*/
|
||||
template <blocks::SpatialTerm Term, domain::schema::IsSchema Schema>
|
||||
[[nodiscard]] std::expected<std::vector<double>, std::string> reference_mass_diagonal(const TermBinding<Term, Schema>& binding)
|
||||
{
|
||||
constexpr bool intrinsic_vector = blocks::SpatialTermTraits<Term>::family == functional_space::Family::hdiv;
|
||||
return detail::reference_mass_diagonal(binding, intrinsic_vector);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user