On Sunday, 11 August 2013 23:21:13 UTC+5:30, Robert Cimrman wrote:
Hi Ankit,

On Sat, 10 Aug 2013, Ankit Mahato wrote:

> Hi R,
>
> I tried mem_checkIntegrity inside the functions but it is not printing
> any debugging result.�
> mem_checkIntegrity(421,"convect_build_vtg","termsNavierStokes.c","~/sfepy/sfepy/
> terms/extmods");
> mem_checkIntegrity(546,"term_ns_asm_convect","termsNavierStokes.c","~/sfepy/sfep
> y/terms/extmods");
>
> Am I adding it correctly?

Use the macro without arguments (see sfepy/fem/extmods/common.h for
definition):

check_memory_integrity();

and do not forget to rebuild the sources.

After adding it to convect_build_vtg()

...
   default:
     errput( ErrHead "ERR_Switch\n" );
     return( RET_Fail );
   }
   check_memory_integrity();
   return( RET_OK );
}
...


and typing "make", I get tons of

checking memory integrity in
sfepy/terms/extmods, sfepy/terms/extmods/termsNavierStokes.c,
convect_build_vtg(), 476:
allocated memory: 8 records, usage: 52032, max: 52032
memory OK.

- trying with the examples/navier_stokes/navier_stokes2d.py


Also try changing the debug flags in site_cfg.py:

debug_flags = '-DDEBUG_FMF'

or even

debug_flags = '-DDEBUG_FMF -DDEBUG_MESH'


It printed the debug results for examples/navier_stokes/navier_stokes2d.py
Then I tried running the convective_difffusive.py and it did not print any
line containing allocated memory report:
..
..
..
convdiff: matrix structural nonzeros: 1747752 (8.65e-04% fill)
convdiff: updating materials...
convdiff:     m
convdiff: ...done in 0.01 s
convdiff: nls: iter: 0, residual: 2.002082e-02 (rel: 1.000000e+00)
convect_build_vtg(): ERR_Switch
Traceback (most recent call last):
  File "examples/phase_change/convective_diffusive/convective_diffusive.py", line 131, in <module>
    main()
  File "examples/phase_change/convective_diffusive/convective_diffusive.py", line 113, in main
    flow = problem.solve()
  File "/usr/local/lib/python2.7/dist-packages/sfepy/fem/problemDef.py", line 933, in solve
    vec = solvers.nls(vec0)
  File "/usr/local/lib/python2.7/dist-packages/sfepy/solvers/nls.py", line 345, in __call__
    mtx_a = fun_grad(vec_x)
  File "/usr/local/lib/python2.7/dist-packages/sfepy/fem/evaluate.py", line 66, in eval_tangent_matrix
    mtx = pb.equations.eval_tangent_matrices(vec, mtx)
  File "/usr/local/lib/python2.7/dist-packages/sfepy/fem/equations.py", line 640, in eval_tangent_matrices
    self.evaluate(mode='weak', dw_mode='matrix', asm_obj=tangent_matrix)
  File "/usr/local/lib/python2.7/dist-packages/sfepy/fem/equations.py", line 526, in evaluate
    asm_obj=asm_obj)
  File "/usr/local/lib/python2.7/dist-packages/sfepy/fem/equations.py", line 766, in evaluate
    ret_status=True)
  File "/usr/local/lib/python2.7/dist-packages/sfepy/terms/terms.py", line 1474, in evaluate
    vals.append(self.sign * val)
RuntimeError: ccore error (see above)


 
r.