Menu

Plotting a Hdiv function in 3D with discontinuous flag

2017-02-10
2017-02-10
  • Paulina Sepulveda

    Hello,

    I am using Netgen-6.2-dev. When I try to Draw a function in Hdiv, with discontinuous flag in 3D, I am getting an error message, for example:

    from ngsolve import *
    from netgen.csg import unit_cube
    
    mesh = Mesh (unit_cube.GenerateMesh(maxh=0.5))
    V = HDiv(mesh, order=2, flags={'discontinuous':True}) 
    
    u = GridFunction(V)
    u.Set(CoefficientFunction((x,0,0)))
    
    Draw(u[0],mesh,"u0")
    

    It outputs:

    terminate called after throwing an instance of 'std::bad_array_new_length'
    what(): std::bad_array_new_length
    Aborted (core dumped)

    How can I make this file work?

    Thanks,
    Paulina.

     
  • Paulina Sepulveda

    Hello again,

    I found how to make it work,

    Draw(u[0], mesh,"u0", draw_surf=False),   
    

    and for the vector function:

    us= CoefficientFunction(u)
    Draw(us,mesh,"us", draw_surf=False)
    

    and clipping.

    Thanks,
    Paulina.

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.