Thank you, Robert. Now all things are almost clear for me.

Alec.

On Monday, October 15, 2012 10:17:04 PM UTC+4, Robert Cimrman wrote:
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).

> 1. 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).

> 2. 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:
1. how to define a material parameter by an arbitrary function (get_pars - this
is what you need).
2. how to define a known function that belongs to a given FE space (field) -
this function, 'p', is defined in a FE sense by its nodal values only.

> 3. 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.