sfepy.discrete.materials module¶
- class sfepy.discrete.materials.Material(name, kind='time-dependent', function=None, values=None, flags=None, **kwargs)[source]¶
A class holding constitutive and other material parameters.
Example input:
material_2 = { 'name' : 'm', 'values' : {'E' : 1.0}, }
Material parameters are passed to terms using the dot notation, i.e. ‘m.E’ in our example case.
- get_data(key, name)[source]¶
name can be a dict - then a Struct instance with data as attributes named as the dict keys is returned.
- get_keys(region_name=None)[source]¶
Get all data keys.
- Parameters
- region_namestr
If not None, only keys with this region are returned.
- iter_terms(equations, only_new=True)[source]¶
Iterate terms for which the material data should be evaluated.
- set_data(key, qps, data)[source]¶
Set the material data in quadrature points.
- Parameters
- keytuple
The (region_name, integral_name) data key.
- qpsStruct
Information about the quadrature points.
- datadict
The material data.
- time_update(ts, equations, mode='normal', problem=None)[source]¶
Evaluate material parameters in physical quadrature points.
- Parameters
- tsTimeStepper instance
The time stepper.
- equationsEquations instance
The equations using the materials.
- mode‘normal’, ‘update’ or ‘force’
The update mode. In ‘force’ mode,
self.datas
is cleared and all updates are redone. In ‘update’ mode, existing data are preserved and new can be added. The ‘normal’ mode depends on other attributes: for stationary (self.kind == 'stationary'
) materials and materials in ‘user’ mode, nothing is done ifself.datas
is not empty. For time-dependent materials (self.kind == 'time-dependent'
, the default) that are not constant, i.e., are given by a user function, ‘normal’ mode behaves like ‘force’ mode. For constant materials it behaves like ‘update’ mode - existing data are reused.- problemProblem instance, optional
The problem that can be passed to user functions as a context.
- update_data(key, ts, equations, term, problem=None)[source]¶
Update the material parameters in quadrature points.
- Parameters
- keytuple
The (region_name, integral_name) data key.
- tsTimeStepper
The time stepper.
- equationsEquations
The equations for which the update occurs.
- termTerm
The term for which the update occurs.
- problemProblem, optional
The problem definition for which the update occurs.
- class sfepy.discrete.materials.Materials(objs=None, **kwargs)[source]¶
- static from_conf(conf, functions, wanted=None)[source]¶
Construct Materials instance from configuration.
- reset()[source]¶
Clear material data so that next materials.time_update() is performed even for stationary materials.
- time_update(ts, equations, mode='normal', problem=None, verbose=True)[source]¶
Update material parameters for given time, problem, and equations.
- Parameters
- tsTimeStepper instance
The time stepper.
- equationsEquations instance
The equations using the materials.
- mode‘normal’, ‘update’ or ‘force’
The update mode, see
Material.time_update()
.- problemProblem instance, optional
The problem that can be passed to user functions as a context.
- verbosebool
If False, reduce verbosity.