20 template <
int order,
int dim,
typename InputSpaces = Parameters<>>
32 template <
int order,
int dim,
typename... InputSpaces>
34 :
public FunctionalWeakForm<dim, H1<order>, Parameters<H1<order>, H1<order>, InputSpaces...>> {
45 static constexpr
int NUM_STATE_VARS = 2;
64 const mfem::ParFiniteElementSpace& test_space,
65 std::vector<const mfem::ParFiniteElementSpace*> parameter_fe_spaces = {})
66 : BaseWeakFormT(physics_name, mesh, test_space, constructAllSpaces(test_space, parameter_fe_spaces))
92 template <
int... active_parameters,
typename MaterialType>
95 ThermalMaterialFunctor<MaterialType> material_functor(material);
97 DependsOn<0, 1, active_parameters + NUM_STATE_VARS...>{},
98 std::move(material_functor), BaseWeakFormT::mesh_->domain(body_name));
99 BaseWeakFormT::v_dot_weak_form_residual_->AddDomainIntegral(
101 [material_functor](
double t,
auto X,
auto V,
auto... params) {
102 auto flux = material_functor(t, X, params...);
104 smith::inner(get<DERIVATIVE>(V), get<DERIVATIVE>(flux));
106 BaseWeakFormT::mesh_->domain(body_name));
110 template <
typename MaterialType>
111 void setMaterial(std::string body_name,
const MaterialType& material)
123 const mfem::ParFiniteElementSpace& state_space,
const std::vector<const mfem::ParFiniteElementSpace*>&
spaces)
125 std::vector<const mfem::ParFiniteElementSpace*> all_spaces{&state_space, &state_space};
127 all_spaces.push_back(s);
135 template <
typename MaterialType>
136 struct ThermalMaterialFunctor {
161 template <
typename X,
typename Temperature,
typename dT_dt,
typename... Params>
162 auto operator()(
double , X x, Temperature temperature, dT_dt dtemp_dt, Params... params)
const
165 auto [u, du_dX] = temperature;
166 auto du_dt = get<VALUE>(dtemp_dt);
167 auto [heat_capacity, heat_flux] = material_(x, u, du_dX, params...);
Accelerator functionality.
std::vector< const mfem::ParFiniteElementSpace * > spaces(const std::vector< FieldState > &states, const std::vector< FieldState > ¶ms={})
Get the spaces from the primal fields of a vector of field states.
constexpr SMITH_HOST_DEVICE auto inner(const dual< S > &A, const dual< T > &B)
Compile-time alias for a dimension.
a struct that is used in the physics modules to clarify which template arguments are user-controlled ...
This is a class that mimics most of std::tuple's interface, except that it is usable in CUDA kernels ...