- Thank you received: 0
How can I output results on surface meshes to vtk file?
3 years 5 months ago - 3 years 5 months ago #3787
by yzz
How can I output results on surface meshes to vtk file? was created 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?
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.
3 years 5 months ago #3790
by schruste
Replied by schruste on topic How can I output results on surface meshes to vtk file?
Hi,
just use Do(BND) instead of Do() and only the surface mesh will be treated.
Best,
Christoph
just use Do(BND) instead of Do() and only the surface mesh will be treated.
Best,
Christoph
Time to create page: 0.126 seconds