Hello Alec,
On 10/15/2012 07:15 PM, Alec Kalinin wrote:
Hello SfePy users,
I am solving a Poisson's equation with a free term $b(x)$: $\Delta u(x) = b(x), \quad x \in Omega$. I take "diffusion/poisson_functions.py" as the base script for my task. But something in this script is not clear for me.
this examples is not exactly what you need - use term dw_volume_integrate term with the optional material parameter equal to b(x).
- In the script we have two definitions: $p$ is a given function and $f$ is a load parameter. What function does correspond to the free term $b(x)$?
Both :) as b(x) = p(x) f(x).
- The known function $f$ (in the code it is named as "load") is defined in materials, but the function $p$ is also known, but defined in the "variables" section. Usually in variable section we define functions to be find during solution. Why we define known function in the variable section?
The example demonstrates two things: this function, 'p', is defined in a FE sense by its nodal values only.
- how to define a material parameter by an arbitrary function (get_pars - this is what you need).
- how to define a known function that belongs to a given FE space (field) -
- For the evaluation of the function $f$ ("load") we have a python function "get_pars(ts, coors, mode=None, **kwargs)". In this python function we evaluate $f$ only if "mode == qp" condition is true.
For the evaluation of the function $p$ we also have a python function "get_load_variable(ts, coors, region=None)". But in this function we do not use "mode" condition.
Why those function $f$ and $p$ are evaluated in different ways?
See above - those two functions are fundamentally different - one is s field function, approximated by FE (p), the other is a general function of coordinates evaluated in quadrature points (f)
Does it help?
Cheers, r.