Inconsistencies in allocations if finite volumes

Summary

  • Inconsistency in allocation of fluxes for finite volumes
    • FLUX is allocated with size [6*NPOIN+1]
    • FLUXT is allocated with size [MESH%NSEG*4**REF]
  • Bug in init FLUXT (loop on NSEG instead of NPOIN)

Several questions/suggestions:

  • why []x4^REF in alloc: to take into account refinment levels (REF); However: when using refinment NELEM <- NELEMx4^REF is true; But NSEG =! NSEGx4^REF (so my guess is that alloc of FLUXT is not properly done in that case)
  • REF taken into account in FLUXT but not in FLUX, why?
  • FLUX and FLUXT should be the same size (contains the sum of boundary fluxes for a given cell), so should be of size 3*NPOIN for FLUX and NPOIN for FLUXT !
  • Why not using BIEF_ALLVEC with status 1 ? Whould be easier since it depends directly on mesh size (like QU, QV); for example we could do BIEF_ALLVEC(1,FLUX,'FLUX',IELM1,3,1,MESH) and BIEF_ALLVEC(1,FLUXT,'FLUXT',IELM1,1,1,MESH)

Steps to reproduce

No problem detected since NSEG>NPOIN

What is the current bug behaviour?

  • possibly allocate to much memory than required.
  • when refinment levels are used, possible problem of allocation

Possible fixes

  • Fix allocations in point_telemac2d.f
  • Prevent the use of refinment levels if FV ?
  • Fix init of FLUXT in init_trac.f
Edited by Fabien Souille