Element

The element module defines reference elements such as the QuadElement and TriangularElement, but also more exotic objects like the TrimmedElement. A set of (interconnected) elements together form a nutils.topology. Elements have edges and children (for refinement), which are in turn elements and map onto self by an affine transformation. They also have a well defined reference coordinate system, and provide pointsets for purposes of integration and sampling.

class nutils.element.TrimmedIScheme(levelset, ischeme, maxrefine, finestscheme='uniform1', degree=3, retain=None)[source]

integration scheme for truncated elements

generate_ischeme(elem, maxrefine)[source]

generate integration scheme

class nutils.element.Transformation(fromdim, todim)[source]

transform points

eval(points)[source]

evaluate

class nutils.element.SliceTransformation(fromdim, start=None, stop=None, step=None)[source]

take slice

class nutils.element.AffineTransformation(offset, transform)[source]

affine transformation

invtrans[source]

inverse transformation

det[source]

determinant

nest(other)[source]

merge transformations

get_transform()[source]

get transformation copy

invapply(coords)[source]

apply inverse transformation

class nutils.element.Element(ndims, vertices, index=None, parent=None, context=None, interface=None)[source]

Element base class.

Represents the topological shape.

neighbor(other)[source]

level of neighborhood; 0=self

eval(where)[source]

get points

zoom(elemset, points)[source]

zoom points

intersected(levelset, lscheme, evalrefine=0)[source]

check levelset intersection:

+1 for levelset > 0 everywhere -1 for levelset < 0 everywhere =0 for intersected element

trim(levelset, maxrefine, lscheme, finestscheme, evalrefine)[source]

trim element along levelset

get_simplices(maxrefine)[source]

divide in simple elements

class nutils.element.ProductElement(elem1, elem2)[source]

element product

orientation[source]

Neighborhood of elem1 and elem2 and transformations to get mutual overlap in right location. Returns 3-element tuple: * neighborhood, as given by Element.neighbor(), * transf1, required rotation of elem1 map: {0:0, 1:pi/2, 2:pi, 3:3*pi/2}, * transf2, required rotation of elem2 map (is indep of transf1 in UnstructuredTopology.

eval(where)[source]

get integration scheme

class nutils.element.TrimmedElement(elem, levelset, maxrefine, lscheme, finestscheme, evalrefine, parent, vertices)[source]

trimmed element

children[source]

all 1x refined elements

edge(iedge)[source]
get_simplices(maxrefine)[source]

divide in simple elements

class nutils.element.QuadElement(ndims, vertices, index=None, parent=None, context=None, interface=None)[source]

quadrilateral element

children_by(N)[source]

divide element by n

children[source]

all 1x refined elements

ribbons[source]

ribbons

edge(iedge)[source]
refine(n)[source]

refine n times

select_contained(points, eps=0)[source]

select points contained in element

class nutils.element.TriangularElement(vertices, index=None, parent=None, context=None)[source]

Triangular element. Conventions: * reference elem: unit simplex {(x,y) | x>0, y>0, x+y<1} * vertex numbering: {(1,0):0, (0,1):1, (0,0):2} * edge numbering: {bottom:0, slanted:1, left:2} * edge local coords run counter-clockwise.

children[source]

all 1x refined elements

edge(iedge)[source]
refined(n)[source]

refine

select_contained(points, eps=0)[source]

select points contained in element

class nutils.element.TetrahedronElement(vertices, index=None, parent=None, context=None)[source]

tetrahedron element

children[source]

all 1x refined elements

edge(iedge)[source]
refined(n)[source]

refine

select_contained(points, eps=0)[source]

select points contained in element

class nutils.element.StdElem[source]

stdelem base class

extract(extraction)[source]

apply extraction matrix

class nutils.element.PolyProduct[source]

multiply standard elements

class nutils.element.PolyLine(poly)[source]

polynomial on a line

classmethod bernstein_poly(degree)[source]

bernstein polynomial coefficients

classmethod spline_poly(p, n)[source]

spline polynomial coefficients

classmethod spline(degree, nelems, periodic=False, neumann=0, curvature=False)[source]

spline elements, any amount

extract(extraction)[source]

apply extraction

class nutils.element.PolyTriangle[source]

poly triangle (linear for now) conventions: dof numbering as vertices, see TriangularElement docstring.

class nutils.element.BubbleTriangle[source]

linear triangle + bubble function conventions: dof numbering as vertices (see TriangularElement docstring), then barycenter.

class nutils.element.ExtractionWrapper(stdelem, extraction)[source]

extraction wrapper