sfepy.mesh.geom_tools module

class sfepy.mesh.geom_tools.geometry(dim=3)[source]

The geometry is given by a sets of points (d0), lines (d1), surfaces (d2) and volumes (d3). A lines are constructed from 2 points, a surface from any number of lines, a volume from any number of surfaces.

Physical volumes are contruted from any number of volumes.

The self.d0, self.d1, self.d2 and self.d3 are dictionaries holding a map

geometry element number -> instance of point,line,surface of volume

Examples

To get all the points which define a surface 5, use:

self.d2[5].getpoints()

This would give you a list [..] of point() instances.

addline(self, n, l)[source]

l=[p1,p2]

addlines(self, ls, off=1)[source]

ls=[l1, l2, …]

addphysicalsurface(self, n, surfacelist)[source]

surfacelist=[s1,s2,s3,…]

addphysicalvolume(self, n, volumelist)[source]

volumelist=[v1,v2,v3,…]

addpoint(self, n, p)[source]

p=[x,y,z]

addpoints(self, ps, off=1)[source]

ps=[p1, p2, …]

addsurface(self, n, s, is_hole=False)[source]

s=[l1,l2,l3,…]

addsurfaces(self, ss, off=1)[source]

s=[s1,s2,s3,…]

addvolume(self, n, v)[source]

v=[s1,s2,s3,…]

addvolumes(self, vs, off=1)[source]

v=[v1,v2,v3,…]

static from_gmsh_file(filename)[source]

Import geometry - Gmsh geometry format.

Parameters
filenamestring

file name

Returns
geogeometry

geometry description

getBCnum(self, snum)[source]
leaveonlyphysicalsurfaces(self)[source]
leaveonlyphysicalvolumes(self)[source]
printinfo(self, verbose=False)[source]
splitlines(self, ls, n)[source]
to_poly_file(self, filename)[source]

Export geometry to poly format (tetgen and triangle geometry format).

Parameters
geogeometry

geometry description

filenamestring

file name

class sfepy.mesh.geom_tools.geomobject[source]
getn(self)[source]
class sfepy.mesh.geom_tools.line(g, n, l)[source]
getpoints(self)[source]
class sfepy.mesh.geom_tools.physicalsurface(g, n, s)[source]
getsurfaces(self)[source]
class sfepy.mesh.geom_tools.physicalvolume(g, n, v)[source]
getvolumes(self)[source]
class sfepy.mesh.geom_tools.point(g, n, p)[source]
getstr(self)[source]
getxyz(self)[source]
class sfepy.mesh.geom_tools.surface(g, n, s, is_hole=False)[source]
getcenterpoint(self)[source]
getholepoints(self)[source]
getinsidepoint(self)[source]
getlines(self)[source]
getpoints(self)[source]
separate(self, s)[source]
class sfepy.mesh.geom_tools.volume(g, n, v)[source]
getinsidepoint(self)[source]
getsurfaces(self)[source]