Smith  0.1
Smith is an implicit thermal structural mechanics simulation code.
Classes | Namespaces | Typedefs | Functions | Variables
coupling_params.hpp File Reference

Coupling pack types and helpers for injecting explicit coupled-physics fields into weak form parameter packs. More...

#include <tuple>
#include <type_traits>
#include <utility>
#include "smith/differentiable_numerics/field_store.hpp"
#include "smith/differentiable_numerics/system_base.hpp"
Include dependency graph for coupling_params.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  smith::PhysicsFields< Dim, Order, TimeRule, Spaces >
 Fields returned by a physics register function, carrying time rule type information. More...
 
struct  smith::ParamFields< Spaces >
 Registered parameter-only field bundle. More...
 
struct  smith::CouplingFields< PFs >
 Bundle of coupled PhysicsFields packs supplied to a builder as a single coupling arg. More...
 
struct  smith::detail::is_physics_fields_impl< T >
 
struct  smith::detail::is_physics_fields_impl< PhysicsFields< D, O, R, S... > >
 
struct  smith::detail::is_parameter_pack_impl< T >
 
struct  smith::detail::is_parameter_pack_impl< ParamFields< S... > >
 
struct  smith::detail::is_coupling_fields_impl< T >
 
struct  smith::detail::is_coupling_fields_impl< CouplingFields< PFs... > >
 
struct  smith::detail::is_coupling_packs_impl< T >
 True for a std::tuple<Packs...> returned by collectCouplingFields. More...
 
struct  smith::detail::is_coupling_packs_impl< std::tuple< Packs... > >
 
struct  smith::detail::TupleToParameters< std::tuple< Spaces... > >
 Specialization of TupleToParameters for a tuple of spaces. More...
 
struct  smith::detail::pack_tuple< PhysicsFields< D, O, R, Spaces... > >
 Specialization of pack_tuple for physics coupling fields. More...
 
struct  smith::detail::pack_tuple< ParamFields< Spaces... > >
 Specialization of pack_tuple for parameter-only fields. More...
 
struct  smith::detail::AppendParameters< Parameters< Coupled... >, Parameters< Fixed... > >
 Specialization of AppendParameters for two Parameters<...> packs. More...
 
struct  smith::detail::FlattenCoupling< std::tuple< Packs... > >
 Specialization of FlattenCoupling for a tuple of coupling packs. More...
 
struct  smith::detail::TimeRuleParamsImpl< Rule, Space, Parameters< CS... > >
 Specialization of TimeRuleParamsImpl. More...
 
struct  smith::detail::AppendCouplingToParams< PacksTuple, Parameters< Fixed... > >
 Specialization of AppendCouplingToParams. More...
 

Namespaces

 smith
 Accelerator functionality.
 
 smith::detail
 Internal solid mechanics builder after coupling fields are assembled.
 

Typedefs

template<typename Tuple >
using smith::detail::tuple_to_parameters_t = typename TupleToParameters< std::decay_t< Tuple > >::type
 Typedef for converting a tuple of spaces into Parameters<...>.
 
template<typename Pack >
using smith::detail::pack_tuple_t = typename pack_tuple< std::decay_t< Pack > >::type
 Typedef for extracting a tuple of spaces from a coupling pack.
 
template<typename... Tuples>
using smith::detail::tuple_cat_t = decltype(std::tuple_cat(std::declval< Tuples >()...))
 Typedef for concatenating space tuples with std::tuple_cat.
 
template<typename PacksTuple >
using smith::detail::flatten_coupling_t = typename FlattenCoupling< std::decay_t< PacksTuple > >::parameters
 Typedef for flattened coupling parameter spaces.
 
template<typename Rule , typename Space , typename PacksTuple >
using smith::detail::TimeRuleParams = typename TimeRuleParamsImpl< Rule, Space, flatten_coupling_t< PacksTuple > >::type
 Typedef for TimeRuleParams.
 

Functions

template<typename... Spaces>
 smith::ParamFields (FieldType< Spaces >...) -> ParamFields< Spaces... >
 Deduction guide for ParamFields.
 
template<typename... PFs>
auto smith::couplingFields (const PFs &... pfs)
 Helper to construct a CouplingFields bundle.
 
template<typename... ParamSpaces>
auto smith::registerParameterFields (const std::shared_ptr< FieldStore > &field_store, FieldType< ParamSpaces >... param_types)
 Register parameter fields as type-level tokens.
 
template<typename PacksTuple >
auto smith::detail::flattenCouplingFields (const PacksTuple &packs)
 Concatenate each pack's .fields tuple — used to derive trailing weak-form parameter spaces.
 
auto smith::detail::collectCouplingFields ()
 Collect no coupling or parameter packs.
 
template<typename... PFs>
auto smith::detail::collectCouplingFields (const CouplingFields< PFs... > &coupled)
 Collect only coupled physics packs.
 
template<typename... Spaces>
auto smith::detail::collectCouplingFields (const ParamFields< Spaces... > &params)
 Collect only registered parameter fields.
 
template<typename... PFs, typename... Spaces>
auto smith::detail::collectCouplingFields (const CouplingFields< PFs... > &coupled, const ParamFields< Spaces... > &params)
 Collect coupled physics packs followed by registered parameter fields.
 
template<typename Rule , typename TimeInfoT , typename ArgsTuple , typename Callback , std::size_t... StateIs, std::size_t... TailIs>
decltype(auto) smith::detail::applyTimeRuleToPrefixImpl (const Rule &rule, const TimeInfoT &t_info, const ArgsTuple &raw_args, Callback &&callback, std::index_sequence< StateIs... >, std::index_sequence< TailIs... >)
 Implementation of time rule prefix application.
 
template<typename Rule , typename TimeInfoT , typename Callback , typename... RawArgs>
decltype(auto) smith::detail::applyTimeRuleToPrefix (const Rule &rule, const TimeInfoT &t_info, Callback &&callback, const RawArgs &... raw_args)
 Apply time rule interpolation to the leading prefix of raw arguments.
 
template<std::size_t Offset, typename Pack , typename TimeInfoT , typename RawTuple , std::size_t... Is>
auto smith::detail::evaluateCouplingPack (const Pack &, const TimeInfoT &t_info, const RawTuple &raw_args, std::index_sequence< Is... >)
 Evaluate a single coupling pack's time rule.
 
template<std::size_t I, std::size_t Offset, typename PacksTuple , typename TimeInfoT , typename RawTuple >
auto smith::detail::evaluateCouplingPacks (const PacksTuple &packs, const TimeInfoT &t_info, const RawTuple &raw_args)
 Evaluate all coupling packs over their corresponding raw arguments.
 
template<typename PacksTuple , typename TimeInfoT , typename Callback , typename... RawArgs>
decltype(auto) smith::detail::applyCouplingTimeRules (const PacksTuple &packs, const TimeInfoT &t_info, Callback &&callback, const RawArgs &... raw_args)
 Interpolate coupling packs and invoke the callback.
 
template<typename Rule , typename Coupling , typename TimeInfoT , typename Callback , typename... RawArgs>
decltype(auto) smith::detail::applyTimeRuleAndCoupling (const Rule &rule, const Coupling &coupling, const TimeInfoT &t_info, Callback &&callback, const RawArgs &... raw_args)
 Interpolate self time-rule states then coupling segments, then invoke callback. More...
 

Variables

template<typename T >
constexpr bool smith::detail::is_physics_fields_v = is_physics_fields_impl<std::decay_t<T>>::value
 True when T is a PhysicsFields pack.
 
template<typename T >
constexpr bool smith::detail::is_parameter_pack_v = is_parameter_pack_impl<std::decay_t<T>>::value
 True if T is a ParamFields type.
 
template<typename T >
constexpr bool smith::detail::is_coupling_fields_v = is_coupling_fields_impl<std::decay_t<T>>::value
 True if T is a CouplingFields type.
 
template<typename T >
constexpr bool smith::detail::is_coupling_packs_v = is_coupling_packs_impl<std::decay_t<T>>::value
 True if T is a tuple of coupling packs.
 
template<typename T , typename = void>
constexpr bool smith::detail::has_time_rule_v = false
 Base case: T does not have a time rule.
 

Detailed Description

Coupling pack types and helpers for injecting explicit coupled-physics fields into weak form parameter packs.

Builders accept at most two optional trailing arguments after self_fields:

  1. couplingFields(coupled_physics_fields...) — coupled physics contributions
  2. param_fields (a ParamFields<...>) — registered user parameter fields (must be last)

Tail of each material/source closure: (coupling_fields..., parameter_fields...).

Definition in file coupling_params.hpp.