Files
MeanField_SERiF/src/compile_time_checks/serif/model/scalar_row.cpp

26 lines
1.5 KiB
C++

#include "serif/equations/mass_normalization.hpp"
#include "serif/backend/mfem/model/computations/scalar_row.hpp"
namespace {
namespace blocks = serif::discretization::blocks;
namespace computations = serif::model::computations;
namespace dependencies = serif::utils::dependencies;
using Density = blocks::density::mass;
using MassRow = blocks::barotropic_constant::mass_normalization;
using Shape = blocks::surface_deformation::coefficients;
using Volume = serif::operators::backend::mfem::volume_keys::Scoped<MassRow>::Linearization;
/** @brief Spatial equations must retain their ordinary volume representation. */
template <typename Row>
concept CacheableRow = requires { typename computations::ScalarResidualRow<Row>; };
static_assert(CacheableRow<MassRow>);
static_assert(!CacheableRow<Density>);
using FixedLayout = blocks::SystemLayout<dependencies::KeyList<Density, MassRow>, dependencies::KeyList<MassRow>>;
using MovingLayout = blocks::SystemLayout<dependencies::KeyList<Density, Shape, MassRow>, dependencies::KeyList<MassRow>>;
using Fixed = decltype(computations::scalar_residual_row<serif::equations::MassNormalization>(std::declval<FixedLayout>()));
using Moving = decltype(computations::scalar_residual_row<serif::equations::MassNormalization>(std::declval<MovingLayout>()));
static_assert(std::same_as<Fixed::Inputs, dependencies::KeyList<Volume>>);
static_assert(std::same_as<Moving::Inputs, dependencies::KeyList<Volume, computations::ShapeDerivatives>>);
}