[Bug] VolumeEnclosed give NaNs when it has a point coincident with its origin #133
Labels
bug
Something isn't working
functionals
This issue is with a functional
good first issue
Good for newcomers
import meshtools
import plot
import optimize
var vertexlist = [[0.5,0.5,0.5], [0.5,1.5,0.5], [1.5,1.5,0.5], [1.5,0.5,0.5], [0.5,0.5,1.5],[0.5,1.5,1.5], [1.5,1.5,1.5], [1.5,0.5,1.5]]
var facelist = [[0,3,2,1], [0,4,5,1], [0,3,7,4], [2,3,7,6], [4,5,6,7], [1,2,6,5]]
var m = PolyhedronMesh(vertexlist, facelist)
//Show(plotmesh(m, grade=[0,1,2]))
print(m)
var problem = OptimizationProblem(m)
var la = Area()
var lv = VolumeEnclosed()
problem.addenergy(la)
problem.addconstraint(lv)
var opt = ShapeOptimizer(problem, m)
var mr=MeshRefiner([m])
var refmap = mr.refine()
for (el in [problem, opt]) el.update(refmap)
m = refmap[m]
opt.relax(100)
Show(plotmesh(m, grade=[0,1,2]))
The text was updated successfully, but these errors were encountered: