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

CombinedSystem and combineSystems for composing independent physics into a coupled system. More...

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

Go to the source code of this file.

Classes

struct  smith::CombinedSystem
 A non-templated system wrapper that combines multiple sub-systems sharing one FieldStore. More...
 

Namespaces

 smith
 Accelerator functionality.
 

Functions

template<typename... SubSystems>
auto smith::combineSystems (std::shared_ptr< SubSystems >... subs)
 Combine two or more independently-built sub-systems into a CombinedSystem. More...
 
template<typename... SubSystems>
std::shared_ptr< SystemBase > smith::combineSystems (std::shared_ptr< SystemSolver > solver, std::shared_ptr< SubSystems >... subs)
 Combine two or more independently-built sub-systems into a single monolithic SystemBase. More...
 

Detailed Description

CombinedSystem and combineSystems for composing independent physics into a coupled system.

Individual physics sub-systems (SolidMechanicsSystem, ThermalSystem, ...) remain authoritative for their own configuration APIs. combineSystems wires them together via a shared FieldStore and provides a coupled setMaterial that registers integrands on both sub-system weak forms.

Usage:

auto field_store = std::make_shared<FieldStore>(mesh, 100, "coupled");
auto solid_fields = registerSolidMechanicsFields<dim, disp_order, DispRule>(field_store);
auto thermal_fields = registerThermalFields<dim, temp_order, TempRule>(field_store);
auto solid_system = buildSolidMechanicsSystem<dim, disp_order, DispRule>(
solid_solver, solid_opts, solid_fields, couplingFields(thermal_fields), param_fields);
auto thermal_system = buildThermalSystem<dim, temp_order, TempRule>(
thermal_solver, thermal_opts, thermal_fields, couplingFields(solid_fields));
auto coupled = combineSystems(solid, thermal);
coupled->setMaterial(thermo_mech_material, domain); // tight coupling
solid->addTraction(right, traction_fn); // loose via sub-system
thermal->addHeatFlux(top, flux_fn);
auto advancer = makeAdvancer(coupled);
auto combineSystems(std::shared_ptr< SubSystems >... subs)
Combine two or more independently-built sub-systems into a CombinedSystem.
auto couplingFields(const PFs &... pfs)
Helper to construct a CouplingFields bundle.
std::shared_ptr< MultiphysicsTimeIntegrator > makeAdvancer(std::shared_ptr< SystemBase > system)
Build a MultiphysicsTimeIntegrator using the system's own auxiliary systems.

Definition in file combined_system.hpp.