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(n, l)[source]

l=[p1,p2]

addlines(ls, off=1)[source]

ls=[l1, l2, …]

addphysicalsurface(n, surfacelist)[source]

surfacelist=[s1,s2,s3,…]

addphysicalvolume(n, volumelist)[source]

volumelist=[v1,v2,v3,…]

addpoint(n, p)[source]

p=[x,y,z]

addpoints(ps, off=1)[source]

ps=[p1, p2, …]

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

s=[l1,l2,l3,…]

addsurfaces(ss, off=1)[source]

s=[s1,s2,s3,…]

addvolume(n, v)[source]

v=[s1,s2,s3,…]

addvolumes(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(snum)[source]
leaveonlyphysicalsurfaces()[source]
leaveonlyphysicalvolumes()[source]
printinfo(verbose=False)[source]
splitlines(ls, n)[source]
to_poly_file(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()[source]
class sfepy.mesh.geom_tools.line(g, n, l)[source]
getpoints()[source]
class sfepy.mesh.geom_tools.physicalsurface(g, n, s)[source]
getsurfaces()[source]
class sfepy.mesh.geom_tools.physicalvolume(g, n, v)[source]
getvolumes()[source]
class sfepy.mesh.geom_tools.point(g, n, p)[source]
getstr()[source]
getxyz()[source]
class sfepy.mesh.geom_tools.surface(g, n, s, is_hole=False)[source]
getcenterpoint()[source]
getholepoints()[source]
getinsidepoint()[source]
getlines()[source]
getpoints()[source]
separate(s)[source]
class sfepy.mesh.geom_tools.volume(g, n, v)[source]
getinsidepoint()[source]
getsurfaces()[source]