Smith  0.1
Smith is an implicit thermal structural mechanics simulation code.
Public Types | Public Member Functions | Public Attributes | List of all members
smith::SolidMechanicsSystem< dim, order, DisplacementTimeRule, Coupling > Struct Template Reference

System struct for solid dynamics with configurable time integration. More...

#include <solid_mechanics_system.hpp>

Collaboration diagram for smith::SolidMechanicsSystem< dim, order, DisplacementTimeRule, Coupling >:
Collaboration graph
[legend]

Public Types

using SolidWeakFormType = FunctionalWeakForm< dim, H1< order, dim >, detail::TimeRuleParams< DisplacementTimeRule, H1< order, dim >, Coupling > >
 Main weak form: (u, u_old, v_old, a_old, coupling_fields..., params...)
 
using StressOutputWeakFormType = FunctionalWeakForm< dim, L2< 0, dim *dim >, typename detail::AppendCouplingToParams< Coupling, Parameters< L2< 0, dim *dim >, H1< order, dim >, H1< order, dim >, H1< order, dim >, H1< order, dim > >>::type >
 

Public Member Functions

template<typename MaterialType >
void setMaterial (const MaterialType &material, const std::string &domain_name)
 Set material model for domain. More...
 
template<typename BodyForceType >
void addBodyForce (const std::string &domain_name, BodyForceType force_function)
 Add a body force to the system. More...
 
template<typename TractionType >
void addTraction (const std::string &domain_name, TractionType traction_function)
 Add a surface traction (flux) to the system. More...
 
template<typename PressureType >
void addPressure (const std::string &domain_name, PressureType pressure_function)
 Add a pressure boundary condition (follower force). More...
 
void setDisplacementBC (const Domain &domain)
 Set zero-displacement Dirichlet BC on all components.
 
void setDisplacementBC (const Domain &domain, std::vector< int > components)
 Set zero-displacement BC on specific components.
 
template<typename AppliedDisplacementFunction >
void setDisplacementBC (const Domain &domain, AppliedDisplacementFunction f)
 Set displacement BC with a prescribed function.
 
 SystemBase ()=default
 Construct an empty system shell.
 
 SystemBase (std::shared_ptr< FieldStore > fs, std::shared_ptr< SystemSolver > sol=nullptr, std::vector< std::shared_ptr< WeakForm >> wfs={})
 Construct a system from a field store, solver, and weak forms. More...
 
- Public Member Functions inherited from smith::SystemBase
 SystemBase ()=default
 Construct an empty system shell.
 
 SystemBase (std::shared_ptr< FieldStore > fs, std::shared_ptr< SystemSolver > sol=nullptr, std::vector< std::shared_ptr< WeakForm >> wfs={})
 Construct a system from a field store, solver, and weak forms. More...
 
virtual std::vector< FieldStatesolve (const TimeInfo &time_info) const
 Solve the system using the internal weak_forms and solver. More...
 
virtual std::vector< ReactionStatecomputeReactions (const TimeInfo &time_info, const std::vector< FieldState > &states_for_reactions) const
 Compute reactions after solving the main state. More...
 

Public Attributes

std::shared_ptr< SolidWeakFormTypesolid_weak_form
 Solid mechanics weak form.
 
std::shared_ptr< DirichletBoundaryConditionsdisp_bc
 Displacement boundary conditions.
 
std::shared_ptr< DisplacementTimeRule > disp_time_rule
 Time integration rule.
 
std::shared_ptr< const Coupling > coupling
 Coupling metadata for callback interpolation.
 
std::shared_ptr< StressOutputWeakFormTypestress_weak_form
 Stress projection weak form (nullptr if disabled).
 
std::shared_ptr< SystemBasestress_output_system
 Post-solve system for stress projection.
 
bool output_cauchy_stress = false
 Project Cauchy stress instead of PK1 when true.
 
- Public Attributes inherited from smith::SystemBase
std::vector< std::shared_ptr< WeakForm > > weak_forms
 Weak forms solved together by this system.
 
std::shared_ptr< FieldStorefield_store
 Field store managing the system's fields.
 
std::shared_ptr< SystemSolversolver
 The solver for the system.
 
std::vector< std::shared_ptr< SystemBase > > cycle_zero_systems
 
std::vector< std::shared_ptr< SystemBase > > post_solve_systems
 Optional systems solved after main state update.
 
std::vector< std::string > solve_result_field_names
 Optional per-weak-form fields to solve/update instead of reaction fields.
 
std::vector< std::vector< std::string > > solve_input_field_names
 Optional per-weak-form input field ordering used during solve.
 

Detailed Description

template<int dim, int order, typename DisplacementTimeRule = ImplicitNewmarkSecondOrderTimeIntegrationRule, typename Coupling = std::tuple<>>
struct smith::SolidMechanicsSystem< dim, order, DisplacementTimeRule, Coupling >

System struct for solid dynamics with configurable time integration.

Always uses a 4-state field layout (displacement_solve_state, displacement, velocity, acceleration). Use ImplicitNewmarkSecondOrderTimeIntegrationRule for transient dynamics, or QuasiStaticSecondOrderTimeIntegrationRule for quasi-static problems.

Template Parameters
dimSpatial dimension.
orderPolynomial order for displacement field.
DisplacementTimeRuleTime integration rule type (must have num_states == 4).
CouplingTuple of coupling and parameter packs (default: none). Coupling fields occupy leading positions in the tail after the 4 time-rule state fields, before user parameter_space fields.
parameter_spaceParameter spaces for material properties.

Definition at line 47 of file solid_mechanics_system.hpp.

Member Typedef Documentation

◆ StressOutputWeakFormType

template<int dim, int order, typename DisplacementTimeRule = ImplicitNewmarkSecondOrderTimeIntegrationRule, typename Coupling = std::tuple<>>
using smith::SolidMechanicsSystem< dim, order, DisplacementTimeRule, Coupling >::StressOutputWeakFormType = FunctionalWeakForm< dim, L2<0, dim * dim>, typename detail::AppendCouplingToParams<Coupling, Parameters<L2<0, dim * dim>, H1<order, dim>, H1<order, dim>, H1<order, dim>, H1<order, dim> >>::type>

L2 projection weak form for PK1 stress output (dim*dim components). Args: (stress_unknown, u, u_old, v_old, a_old, coupling_fields..., params...).

Definition at line 58 of file solid_mechanics_system.hpp.

Member Function Documentation

◆ addBodyForce()

template<int dim, int order, typename DisplacementTimeRule = ImplicitNewmarkSecondOrderTimeIntegrationRule, typename Coupling = std::tuple<>>
template<typename BodyForceType >
void smith::SolidMechanicsSystem< dim, order, DisplacementTimeRule, Coupling >::addBodyForce ( const std::string &  domain_name,
BodyForceType  force_function 
)
inline

Add a body force to the system.

Template Parameters
BodyForceTypeThe body force function type.
Parameters
domain_nameThe name of the domain to apply the force to.
force_functionThe force function (t, X, u, v, a, params...).

Definition at line 134 of file solid_mechanics_system.hpp.

◆ addPressure()

template<int dim, int order, typename DisplacementTimeRule = ImplicitNewmarkSecondOrderTimeIntegrationRule, typename Coupling = std::tuple<>>
template<typename PressureType >
void smith::SolidMechanicsSystem< dim, order, DisplacementTimeRule, Coupling >::addPressure ( const std::string &  domain_name,
PressureType  pressure_function 
)
inline

Add a pressure boundary condition (follower force).

Template Parameters
PressureTypeThe pressure function type.
Parameters
domain_nameThe name of the boundary domain.
pressure_functionThe pressure function (t, X, params...).

Definition at line 176 of file solid_mechanics_system.hpp.

◆ addTraction()

template<int dim, int order, typename DisplacementTimeRule = ImplicitNewmarkSecondOrderTimeIntegrationRule, typename Coupling = std::tuple<>>
template<typename TractionType >
void smith::SolidMechanicsSystem< dim, order, DisplacementTimeRule, Coupling >::addTraction ( const std::string &  domain_name,
TractionType  traction_function 
)
inline

Add a surface traction (flux) to the system.

Template Parameters
TractionTypeThe traction function type.
Parameters
domain_nameThe name of the boundary domain to apply the traction to.
traction_functionThe traction function (t, X, n, u, v, a, params...).

Definition at line 155 of file solid_mechanics_system.hpp.

◆ setMaterial()

template<int dim, int order, typename DisplacementTimeRule = ImplicitNewmarkSecondOrderTimeIntegrationRule, typename Coupling = std::tuple<>>
template<typename MaterialType >
void smith::SolidMechanicsSystem< dim, order, DisplacementTimeRule, Coupling >::setMaterial ( const MaterialType &  material,
const std::string &  domain_name 
)
inline

Set material model for domain.

Template Parameters
MaterialTypeThe material model type.
Parameters
materialThe material model instance.
domain_nameThe name of the domain to apply the material to.

Definition at line 79 of file solid_mechanics_system.hpp.

◆ SystemBase()

template<int dim, int order, typename DisplacementTimeRule = ImplicitNewmarkSecondOrderTimeIntegrationRule, typename Coupling = std::tuple<>>
smith::SystemBase::SystemBase
inlineexplicit

Construct a system from a field store, solver, and weak forms.

Parameters
fsField store shared by all weak forms.
solSolver used for solve.
wfsWeak forms owned by this system.

Definition at line 76 of file system_base.hpp.


The documentation for this struct was generated from the following file: