Topology¶

The topology module defines the topology objects, notably the StructuredTopology and UnstructuredTopology. Maintaining strict separation of topological and geometrical information, the topology represents a set of elements and their interconnectivity, boundaries, refinements, subtopologies etc, but not their positioning in physical space. The dimension of the topology represents the dimension of its elements, not that of the the space they are embedded in.

The primary role of topologies is to form a domain for nutils.function objects, like the geometry function and function bases for analysis, as well as provide tools for their construction. It also offers methods for integration and sampling, thus providing a high level interface to operations otherwise written out in element loops. For lower level operations topologies can be used as nutils.element iterators.

class nutils.topology.Topology(ndims)[source]

topology base class

elem_eval(funcs, ischeme, separate=False, geometry=None, asfunction=False, edit=<function <lambda>>, *, arguments=None)[source]

element-wise evaluation

elem_mean(funcs, geometry, ischeme, *, arguments=None)[source]

element-wise average

integrate(funcs, ischeme='gauss', degree=None, geometry=None, force_dense=False, fcache=None, edit=<function <lambda>>, *, arguments=None)[source]
integral(func, ischeme='gauss', degree=None, geometry=None, edit=<function <lambda>>)[source]
projection(fun, onto, geometry, **kwargs)[source]

project and return as function

project(fun, onto, geometry, tol=0, ischeme='gauss', degree=None, droptol=1e-12, exact_boundaries=False, constrain=None, verify=None, ptype='lsqr', precon='diag', edit=<function <lambda>>, *, arguments=None, **solverargs)[source]

L2 projection of function onto function space

refined_by(refine)[source]

create refined space by refining dofs in existing one

refine(n)[source]

refine entire topology n times

trim(levelset, maxrefine, ndivisions=8, name='trimmed', leveltopo=None, *, arguments=None)[source]

trim element along levelset

subset(elements, newboundary=None, strict=False)[source]

intersection

exception nutils.topology.LocateError[source]
class nutils.topology.WithGroupsTopology(basetopo, vgroups={}, bgroups={}, igroups={}, pgroups={})[source]

item topology

class nutils.topology.OppositeTopology(basetopo)[source]

opposite topology

class nutils.topology.EmptyTopology(ndims)[source]

empty topology

class nutils.topology.Point(trans, opposite=None)[source]

point

class nutils.topology.StructuredLine(root, i, j, periodic=False, bnames=None)[source]

structured topology

basis_spline(degree, periodic=None, removedofs=None)[source]

spline from vertices

basis_discont(degree)[source]

discontinuous shape functions

basis_std(degree, periodic=None, removedofs=None)[source]

spline from vertices

class nutils.topology.StructuredTopology(root, axes, nrefine=0, bnames=None)[source]

structured topology

basis_spline(degree, knotvalues=None, knotmultiplicities=None, periodic=None, removedofs=None)[source]

spline basis

basis_discont(degree)[source]

discontinuous shape functions

basis_std(degree, removedofs=None, periodic=None)[source]

spline from vertices

refined

refine non-uniformly

class nutils.topology.UnstructuredTopology(ndims, elements)[source]

unstructured topology

basis_bubble()[source]

bubble from vertices

basis_discont(degree)[source]

discontinuous shape functions

basis_lagrange(degree)[source]

lagrange shape functions

basis_bernstein(degree)[source]

bernstein shape functions

basis_std(degree)

bernstein shape functions

class nutils.topology.UnionTopology(topos, names=())[source]

grouped topology

class nutils.topology.SubsetTopology(basetopo, refs, newboundary=None)[source]

trimmed

class nutils.topology.OrientedGroupsTopology(basetopo, elems)[source]

unstructured topology with undirected semi-overlapping basetopology

class nutils.topology.RefinedTopology(basetopo)[source]

refinement

class nutils.topology.TrimmedTopologyItem(basetopo, refdict)[source]

trimmed topology item

class nutils.topology.TrimmedTopologyBoundaryItem(btopo, trimmed, othertopo)[source]

trimmed topology boundary item

class nutils.topology.HierarchicalTopology(basetopo, allelements, precise)[source]

collection of nested topology elments

basis(name, *args, **kwargs)[source]

build hierarchical function space

class nutils.topology.ProductTopology(topo1, topo2)[source]

product topology

refine(n)[source]

refine entire topology n times

class nutils.topology.RevolutionTopology[source]

topology consisting of a single revolution element

class nutils.topology.MultipatchTopology(patches)[source]

multipatch topology

class Patch(topo, verts, boundaries)
boundaries

Alias for field number 2

topo

Alias for field number 0

verts

Alias for field number 1

static build_boundarydata(connectivity)[source]

build boundary data based on connectivity

basis_spline(degree, patchcontinuous=True, knotvalues=None, knotmultiplicities=None)[source]

spline from vertices

Create a spline basis with degree degree per patch. If patchcontinuous is true the basis is $C^0$-continuous at patch interfaces.

basis_discont(degree)[source]

discontinuous shape functions

basis_patch()[source]

degree zero patchwise discontinuous basis

class nutils.topology.DimAxis(i, j, isperiodic)
i

Alias for field number 0

isperiodic

Alias for field number 2

j

Alias for field number 1

class nutils.topology.BndAxis(i, j, ibound, side)
i

Alias for field number 0

ibound

Alias for field number 2

j

Alias for field number 1

side`

Alias for field number 3