dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #26101
Namespace for CSG primitives
The dolfin-csg branch (and the dolfin-plot) branch are getting ready
for merge.
Benjamin and Johannes have worked on adding functionality
for generating meshes from geometries described by constructive solid
geometry (CSG):
geometry = circle*triangle + square - polygon
mesh = Mesh(geometry)
Before merging, what are the opinions of where to put the primitives,
in which namespace? Normally, we put everything into namespace dolfin,
but some of the new primitives may clash with existing classes for
mesh generation (UnitSquare etc).
To keep things simple, I would like to put everything in namespace
dolfin, so the CSG geometries become a natural part of the FEniCS
interface, not something one has to import from a separate namespace
(dolfin::csg).
The new primitives are
Circle (2D)
Ellipse (2D)
Rectangle (2D)
Polygon (2D)
Sphere (3D)
Box (3D)
Cone (3D)
Cylinder (3D)
Existing mesh classes that the above may clash with are
Interval
Rectangle
UnitCircle
UnitCube
UnitInterval
UnitSphere --> remove because it has bad quality mesh?
UnitSquare
UnitTetrahedron
UnitTriangle
These are mostly prefixed by "Unit" so that may take care of some of
the ambiguities. One could also argue that we should rename to
UnitSquareMesh etc, but it would break compatibility.
One option could be to rename mesh classes to UnitSquareMesh,
UnitCubeMesh, and keep deprecated (sub)classes UnitSquare, UnitCube
indefinitely to keep backwards compatibility.
In summary, I would like to add the new classes to namespace dolfin
but I'm looking for opinions on how to best handle naming conflicts.
--
Anders
Follow ups