How can I output results on surface meshes to vtk file?

More
3 years 5 months ago - 3 years 5 months ago #3787 by yzz
Recently, I am solving some problems on surfaces with ngsolve. I am wondering if it can output the results to file for surface domains.

The vtk file output by the following code is almost empty. Are the parameters for Vtkoutput wrong?

Code:
import netgen.gui from ngsolve import * from netgen.csg import * from netgen.meshing import MeshingStep # from ngsolve.webgui import Draw geo = CSGeometry() geo.Add(Sphere(Pnt(0,0,0),1)) mesh = Mesh(geo.GenerateMesh(maxh=0.5, perfstepsend=MeshingStep.MESHSURFACE)) V_HS = HDivSurface(mesh) u = GridFunction(V_HS) vtk = VTKOutput(ma=mesh,coefs=[u],names=["sol"],filename="data/hdiv") for i in range(u.space.ndof): u.vec[:] = 0 u.vec[i] = 1 vtk.Do()
Last edit: 3 years 5 months ago by yzz.
More
3 years 5 months ago #3790 by schruste
Hi,

just use Do(BND) instead of Do() and only the surface mesh will be treated.

Best,
Christoph
More
3 years 5 months ago #3792 by yzz
Thanks Christoph,

Best,
Zongze Yang
Time to create page: 0.126 seconds