sfepy.terms.terms_diffusion module

class sfepy.terms.terms_diffusion.AdvectDivFreeTerm(name, arg_str, integral, region, **kwargs)[source]

Advection of a scalar quantity p with the advection velocity \ul{y} given as a material parameter (a known function of space and time).

The advection velocity has to be divergence-free!

Definition:

\int_{\Omega} \nabla \cdot (\ul{y} p) q
= \int_{\Omega} (\underbrace{(\nabla \cdot \ul{y})}_{\equiv 0}
+ \ul{y} \cdot \nabla) p) q

Call signature:
dw_advect_div_free (material, virtual, state)
Arguments:
  • material : \ul{y}
  • virtual : q
  • state : p
arg_shapes = {'material': 'D, 1', 'state': '1', 'virtual': ('1', 'state')}
arg_types = ('material', 'virtual', 'state')
mode = 'grad_state'
name = 'dw_advect_div_free'
class sfepy.terms.terms_diffusion.ConvectVGradSTerm(name, arg_str, integral, region, **kwargs)[source]

Scalar gradient term with convective velocity.

Definition:

\int_{\Omega} q (\ul{u} \cdot \nabla p)

Call signature:
dw_convect_v_grad_s (virtual, state_v, state_s)
Arguments:
  • virtual : q
  • state_v : \ul{u}
  • state_s : p
arg_shapes = [{'state_s': 1, 'virtual': (1, 'state_s'), 'state_v': 'D'}]
arg_types = ('virtual', 'state_v', 'state_s')
function()
get_fargs(virtual, state_v, state_s, mode=None, term_mode=None, diff_var=None, **kwargs)[source]
name = 'dw_convect_v_grad_s'
class sfepy.terms.terms_diffusion.DiffusionCoupling(name, arg_str, integral, region, **kwargs)[source]

Diffusion copupling term with material parameter K_{j}.

Definition:

\int_{\Omega}  p K_{j} \nabla_j q \mbox{ , }
\int_{\Omega}  q K_{j} \nabla_j p

Call signature:
dw_diffusion_coupling (material, virtual, state)
(material, state, virtual)
(material, parameter_1, parameter_2)
Arguments:
  • material : K_{j}
  • virtual : q
  • state : p
arg_shapes = {'material': 'D, 1', 'parameter_1': 1, 'parameter_2': 1, 'state': 1, 'virtual': (1, 'state')}
arg_types = (('material', 'virtual', 'state'), ('material', 'state', 'virtual'), ('material', 'parameter_1', 'parameter_2'))
static d_fun(out, mat, val, grad, vg)[source]
static dw_fun(out, val, mat, bf, vg, fmode)[source]
get_eval_shape(mat, virtual, state, mode=None, term_mode=None, diff_var=None, **kwargs)[source]
get_fargs(mat, virtual, state, mode=None, term_mode=None, diff_var=None, **kwargs)[source]
modes = ('weak0', 'weak1', 'eval')
name = 'dw_diffusion_coupling'
set_arg_types()[source]
class sfepy.terms.terms_diffusion.DiffusionRTerm(name, arg_str, integral, region, **kwargs)[source]

Diffusion-like term with material parameter K_{j} (to use on the right-hand side).

Definition:

\int_{\Omega} K_{j} \nabla_j q

Call signature:
dw_diffusion_r (material, virtual)
Arguments:
  • material : K_j
  • virtual : q
arg_shapes = {'material': 'D, 1', 'virtual': (1, None)}
arg_types = ('material', 'virtual')
static function()
get_fargs(mat, virtual, mode=None, term_mode=None, diff_var=None, **kwargs)[source]
name = 'dw_diffusion_r'
class sfepy.terms.terms_diffusion.DiffusionTerm(name, arg_str, integral, region, **kwargs)[source]

General diffusion term with permeability K_{ij}. Can be evaluated. Can use derivatives.

Definition:

\int_{\Omega} K_{ij} \nabla_i q \nabla_j p \mbox{ , } \int_{\Omega}
K_{ij} \nabla_i \bar{p} \nabla_j r

Call signature:
dw_diffusion (material, virtual, state)
(material, parameter_1, parameter_2)
Arguments 1:
  • material : K_{ij}
  • virtual : q
  • state : p
Arguments 2:
  • material : K_{ij}
  • parameter_1 : \bar{p}
  • parameter_2 : r
arg_shapes = {'material': 'D, D', 'parameter_1': 1, 'parameter_2': 1, 'state': 1, 'virtual': (1, 'state')}
arg_types = (('material', 'virtual', 'state'), ('material', 'parameter_1', 'parameter_2'))
get_eval_shape(mat, virtual, state, mode=None, term_mode=None, diff_var=None, **kwargs)[source]
get_fargs(mat, virtual, state, mode=None, term_mode=None, diff_var=None, **kwargs)[source]
modes = ('weak', 'eval')
name = 'dw_diffusion'
set_arg_types()[source]
symbolic = {'expression': 'div( K * grad( u ) )', 'map': {'K': 'material', 'u': 'state'}}
class sfepy.terms.terms_diffusion.DiffusionVelocityTerm(name, arg_str, integral, region, **kwargs)[source]

Evaluate diffusion velocity.

Supports ‘eval’, ‘el_avg’ and ‘qp’ evaluation modes.

Definition:

- \int_{\Omega} K_{ij} \nabla_j \bar{p}

\mbox{vector for } K \from \Ical_h: - \int_{T_K} K_{ij} \nabla_j \bar{p}
/ \int_{T_K} 1

- K_{ij} \nabla_j \bar{p}

Call signature:
ev_diffusion_velocity (material, parameter)
Arguments:
  • material : K_{ij}
  • parameter : \bar{p}
arg_shapes = {'material': 'D, D', 'parameter': 1}
arg_types = ('material', 'parameter')
static function(out, grad, mat, vg, fmode)[source]
get_eval_shape(mat, parameter, mode=None, term_mode=None, diff_var=None, **kwargs)[source]
get_fargs(mat, parameter, mode=None, term_mode=None, diff_var=None, **kwargs)[source]
name = 'ev_diffusion_velocity'
class sfepy.terms.terms_diffusion.LaplaceTerm(name, arg_str, integral, region, **kwargs)[source]

Laplace term with c coefficient. Can be evaluated. Can use derivatives.

Definition:

\int_{\Omega} c \nabla q \cdot \nabla p \mbox{ , } \int_{\Omega}
c \nabla \bar{p} \cdot \nabla r

Call signature:
dw_laplace (opt_material, virtual, state)
(opt_material, parameter_1, parameter_2)
Arguments 1:
  • material : c
  • virtual : q
  • state : p
Arguments 2:
  • material : c
  • parameter_1 : \bar{p}
  • parameter_2 : r
arg_shapes = [{'opt_material': '1, 1', 'state': 1, 'parameter_1': 1, 'virtual': (1, 'state'), 'parameter_2': 1}, {'opt_material': None}]
arg_types = (('opt_material', 'virtual', 'state'), ('opt_material', 'parameter_1', 'parameter_2'))
modes = ('weak', 'eval')
name = 'dw_laplace'
set_arg_types()[source]
symbolic = {'expression': 'c * div( grad( u ) )', 'map': {'c': 'opt_material', 'u': 'state'}}
class sfepy.terms.terms_diffusion.SDDiffusionTerm(name, arg_str, integral, region, **kwargs)[source]

Diffusion sensitivity analysis term.

Definition:

\int_{\Omega} \left[ (\dvg \ul{\Vcal}) K_{ij} \nabla_i q\, \nabla_j p -
K_{ij} (\nabla_j \ul{\Vcal} \nabla q) \nabla_i p - K_{ij} \nabla_j q
(\nabla_i \ul{\Vcal} \nabla p)\right]

Call signature:
d_sd_diffusion (material, parameter_q, parameter_p, parameter_mesh_velocity)
Arguments:
  • material: K_{ij}
  • parameter_q: q
  • parameter_p: p
  • parameter_mesh_velocity: \ul{\Vcal}
arg_shapes = {'material': 'D, D', 'parameter_mesh_velocity': 'D', 'parameter_p': 1, 'parameter_q': 1}
arg_types = ('material', 'parameter_q', 'parameter_p', 'parameter_mesh_velocity')
static function()
get_eval_shape(mat, parameter_q, parameter_p, parameter_mv, mode=None, term_mode=None, diff_var=None, **kwargs)[source]
get_fargs(mat, parameter_q, parameter_p, parameter_mv, mode=None, term_mode=None, diff_var=None, **kwargs)[source]
name = 'd_sd_diffusion'
class sfepy.terms.terms_diffusion.SurfaceFluxOperatorTerm(name, arg_str, integral, region, **kwargs)[source]

Surface flux operator term.

Definition:

\int_{\Gamma} q \ul{n} \cdot \ull{K} \cdot \nabla p

Call signature:
dw_surface_flux (opt_material, virtual, state)
Arguments:
  • material : \ull{K}
  • virtual : q
  • state : p
arg_shapes = [{'opt_material': 'D, D', 'state': 1, 'virtual': (1, 'state')}, {'opt_material': None}]
arg_types = ('opt_material', 'virtual', 'state')
function()
get_fargs(mat, virtual, state, mode=None, term_mode=None, diff_var=None, **kwargs)[source]
integration = 'surface_extra'
name = 'dw_surface_flux'
class sfepy.terms.terms_diffusion.SurfaceFluxTerm(name, arg_str, integral, region, **kwargs)[source]

Surface flux term.

Supports ‘eval’, ‘el_eval’ and ‘el_avg’ evaluation modes.

Definition:

\int_{\Gamma} \ul{n} \cdot K_{ij} \nabla_j \bar{p}

\mbox{vector for } K \from \Ical_h: \int_{T_K} \ul{n}
\cdot K_{ij} \nabla_j \bar{p}\ / \int_{T_K} 1

\mbox{vector for } K \from \Ical_h: \int_{T_K} \ul{n}
\cdot K_{ij} \nabla_j \bar{p}

Call signature:
d_surface_flux (material, parameter)
Arguments:
  • material: \ul{K}
  • parameter: \bar{p},
arg_shapes = {'material': 'D, D', 'parameter': 1}
arg_types = ('material', 'parameter')
static function()
get_eval_shape(mat, parameter, mode=None, term_mode=None, diff_var=None, **kwargs)[source]
get_fargs(mat, parameter, mode=None, term_mode=None, diff_var=None, **kwargs)[source]
integration = 'surface_extra'
name = 'd_surface_flux'