I would like to know if there’s a way to force a 2D mesh to be made of triangles only. Referring to the NGSolve tutorial for the solution of a parabolic problem, on Colab, where I have NGSolve 6.2.2401-1-g85cf946e7, and locally, where I have version 6.2.2307, I get different meshes. Indeed, the first returns a triangular mesh, whereas the second returns a mixed mesh with both triangles and quads.
I visualize the mesh using the Draw utility of the webgui on Colab, whereas locally I necessarily have to rely on the VTKOutput utility.
PS: I have not changed the default value for quad_dominated, which is False.
By locally I mean that I am running python scripts from the terminal where I have no graphical support. In order to use the graphical interface, if I am not mistaken, you need either Conda or some kind of environment equipped with an ipython-kernel.
Do you mean that VTKOutput might give me a different result?
first of all thanks for pointing out netgen.gui. I didn’t know it and it turned out to be very useful since it is the only one I can use from terminal. Indeed, relying on netgen.webgui, even if Draw commands execute without error using ipython, no window is opened to visualize.
I have this simple code that is a minimal setting for my inconsistent behaviour. Indeed, I obtain two different meshes in the vtk output file and through netgen.gui.
I would appreciate your feedback.
Thank you very much.
#!/usr/bin/env python
# coding: utf-8
import ngsolve as ng
import netgen.occ as occ
import os
path = os.getcwd()
shape = occ.Rectangle(2,2).Face().Move((-1,-1,0))
shape.edges.Min(occ.X).name="left"
shape.edges.Max(occ.X).name="right"
shape.edges.Min(occ.Y).name="bottom"
shape.edges.Max(occ.Y).name="top"
occmesh = occ.OCCGeometry(shape, dim=2).GenerateMesh(maxh=0.25)
# occmesh.Split2Tets() ERROR from terminal
mesh = ng.Mesh(occmesh)
vtk = ng.VTKOutput(ma = mesh, coefs = [0.], names = ['mesh'],
filename = path + 'mesh', subdivision=1)
vtk.Do()
import netgen.gui as gui
gui.StartGUI()