meshpro / dmsh

:spider_web: Simple mesh generator inspired by distmesh.
GNU General Public License v3.0
210 stars 25 forks source link

Missing boundary cells? #33

Closed cghernandez closed 4 years ago

cghernandez commented 4 years ago

I've recently started using dmsh to generate some simple grids, and after some testing I've noticed that some cells are missing close or at the boundary, even using primitive classes. Is this an expected behavior?

Python script:

import dmsh
import optimesh
import numpy as np

c1 = dmsh.Circle([0.0,0.0],1.0)

X, cells = dmsh.generate(c1,0.1,tol=1.0e-10)

X, cells = optimesh.cvt.quasi_newton_uniform_full(X, cells, 1.0e-10,200)

np.savetxt("nodeCoords.txt", X, delimiter=" ")
np.savetxt("cellIndices.txt", cells, fmt='%i', delimiter=" ")

with open("toplot.txt","w") as toplotFile:
    for cell in range(len(cells)):

        for i in range(3):
            node = cells[cell][i]
            nodeX = X[node][0]
            nodeY = X[node][1]

            toplotFile.write(str(nodeX)+" "+str(nodeY)+"\n")

        toplotFile.write("\n")

gnuplot script:

set size ratio -1
p "toplot.txt" w l

missing_elements

Thank you very much.

cghernandez commented 4 years ago

This was related to the way gnuplot draws the domain, no cells were missing.