Hi Robert,

Thank you for your kind answer.
Added 'facet' to the regions did fix the error problem, but the values of the fluxes are not as expected :

flux1.sum() :  -0.817686412623

flux2.sum() :  0.904600038826

It should be -1 and 1...

flux1 has 8 "terms" and flux2 has 9 "terms"... 

Is it a problem in the mesh ? Or is it a "side effet" of to the "extend_cell_data()" issue ?

What values do you get ?

Best regards,


2014-04-02 22:34 GMT+02:00 Robert Cimrman <cimr...@ntc.zcu.cz>:
Hi David,

On 04/02/2014 07:09 PM, David Libault wrote:

I have rerun the "old" electro static poisson problem again with mac OsX
port of sfepy, and the flux evaluation doesn't seem to work...


sfepy: reading mesh [line2, tri3, quad4, tetra4, hexa8] (essai_2D.mesh)...
sfepy: equation "tmp":

sfepy: d_surface_flux.2.Gamma_Left(coef.sigma, v)

sfepy: updating materials...

sfepy:     coef

Traceback (most recent call last):

   File "/opt/local/bin/simple.py-2.7", line 155, in <module>


   File "/opt/local/bin/simple.py-2.7", line 152, in main


line 29, in call_basic

     return self.call(**kwargs)

line 213, in call


line 37, in __call__


line 715, in save_state

     out = post_process_hook(out, self, state, extend=extend)

   File "poisson_electrostatic.py", line 157, in post_process

     flux1 = pb.evaluate('d_surface_flux.2.Gamma_Left(coef.sigma, v)',

line 1179, in evaluate

     verbose=verbose, **kwargs)

line 1130, in create_evaluable


line 322, in time_update_materials


line 70, in time_update

     mat.time_update(ts, equations, mode=mode, problem=problem)

line 345, in time_update

     self.update_data(key, ts, equations, term, problem=problem)

line 247, in update_data

     coors = qps.get_merged_values()

line 26, in get_merged_values

     qps = nm.concatenate([self.values[ig] for ig in self.igs], axis=0)

ValueError: need at least one array to concatenate

simple.py-2.7 --version returns simple.py-2.7 2013.4 on my system which
should integrate the modifications you made two years ago.

Is your "testing function, that shows how to save the fluxes" still working

(I had to change 'nodes' to 'vertices' and 'elements' to 'cells' to have it
work again)

Two things are needed to make it work:

- set the kind of boundary regions to 'facet':

region_03 = {
    'name' : 'Gamma_Left',
    'select' : 'vertices of group 1',
    'kind' : 'facet',

region_4 = {
    'name' : 'Gamma_Right',
    'select' : 'vertices of group 2',
    'kind' : 'facet',

- get the latest git sources, as I have just fixed a bug in extend_cell_data() that occurred only for is_surface=True.

Then I can run your old script - let me know it the above works for you.

Best regards.

Best regards,


Le jeudi 30 août 2012 12:04:08 UTC+2, Robert Cimrman a écrit :

On 08/30/2012 11:08 AM, David Libault wrote:

Understood. I was not using the correct "mode" for what I was expecting.
Now the user interface looks nice.


Nevertheless, it should be documented (-> Issue 196).

So this is my current testing function, that shows how to save the fluxes
are displayed over the triangles that contain the boundary edges...):

def post_process(out, pb, state, extend=False):
      from sfepy.base.base import Struct
      from sfepy.fem import extend_cell_data

      electric_field = pb.evaluate('ev_grad.i1.Omega( v )', mode='el_avg')
      out['electric_field'] = Struct(name='Electric field', mode='cell',
                                     data=electric_field, dofs=None)

      flux1 = pb.evaluate('d_surface_flux.2.Gamma_Left(coef.sigma, v)',
      print flux1
      print flux1.sum()
      flux1 = extend_cell_data(flux1, pb.domain, 'Gamma_Left', val=0.0,
      out['flux1'] = Struct(name='output_data', mode='cell',
                            data=flux1, dofs=None)
      flux2 = pb.evaluate('d_surface_flux.2.Gamma_Right(coef.sigma, v)',
      print flux2
      print flux2.sum()
      flux2 = extend_cell_data(flux2, pb.domain, 'Gamma_Right', val=0.0,
      out['flux2'] = Struct(name='output_data', mode='cell',
                            data=flux2, dofs=None)

      print  pb.evaluate('d_surface_flux.2.Gamma_Right(coef.sigma, v)')
      return out


You received this message because you are subscribed to the Google Groups "sfepy-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sfepy-devel+unsubscribe@googlegroups.com.
To post to this group, send email to sfepy...@googlegroups.com.
Visit this group at http://groups.google.com/group/sfepy-devel.