Hi,
Mixed meshes seem to be possible.
This tutorial
shows how to make a quad mesh by hand.
Here's a snippet that creates a mesh with 2 elements -- one quad and one trig.
Code:
import netgen.meshing as nm
ngmesh = nm.Mesh(dim=2)
pnums = [ngmesh.Add(nm.MeshPoint(nm.Pnt(*pt, 0)))
for pt in [(0,0),(1,0),(1.5, .5),(1,1),(0,1)]]
idx_dom = ngmesh.AddRegion("mat", dim=2)
ngmesh.Add(nm.Element2D(idx_dom, [pnums[0], pnums[1], pnums[3], pnums[4]]))
ngmesh.Add(nm.Element2D(idx_dom, [pnums[1], pnums[2], pnums[3]]))
ngmesh.Add(nm.Element1D([pnums[0], pnums[1]], index=1))
ngmesh.Add(nm.Element1D([pnums[1], pnums[2]], index=1))
ngmesh.Add(nm.Element1D([pnums[2], pnums[3]], index=1))
ngmesh.Add(nm.Element1D([pnums[3], pnums[4]], index=1))
ngmesh.Add(nm.Element1D([pnums[4], pnums[0]], index=1))
ngmesh.Save('quad_trig.vol')
The saved mesh file 'quad_trig.vol' seems to load correctly if we do
Code:
from ngsolve import Mesh
mesh = Mesh('quad_trig.vol')
But I believe that NGSolve cannot currently generate a mesh containing quads automatically from a geometry.
For your second question, I don't know of any C++ tutorials for MPI, but you could look at the
Python tutorials
, and work backwards from the Pybind bindings (python_*.cpp) in the source tree.
Best,
Dow