I have a code which reads unstructured mesh. I wrote wrappers around geometric entities of sympy.geometry
such as:
class Point:
def __init__(self, x, y, parent_mesh):
self.shape = sympy.geometry.Point(x,y)
self.parent_mesh = parent_mesh
self.parent_cell = list()
Everything works fine but initialization of sympy.geometry.Point
takes a lot of time for each Point
. Actually, the code did not finish execution for thousands of points. Similar code written in C++ finished in a few seconds. Without it the code is fast enough (I removed it and timed). I read that a possible reason could be that sympy.geometry
converts floating point numbers to rationals for precision. Is there a way (flag) to speed up sympy.geometry
as I do not need exact precision?