Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

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

More
2 years 10 months ago - 2 years 10 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: 2 years 10 months ago by yzz.
More
2 years 10 months ago #3790 by schruste
Hi,

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

Best,
Christoph
More
2 years 10 months ago #3792 by yzz
Thanks Christoph,

Best,
Zongze Yang
Time to create page: 0.118 seconds