bempp.api.utils

Interface to various utility modules.

Submodules

Package Contents

Classes

DefaultParameters

Default parameters for Bempp.

Octree

Data structure for handling Octrees.

Functions

which

A Python implemenation of the Unix which command.

bempp.api.utils.which(program)

Run the Unix which command in Python.

class bempp.api.utils.DefaultParameters

Bases: object

Default parameters for Bempp.

class bempp.api.utils.Octree(lbound, ubound, maximum_level, vertices)

Bases: object

Data structure for handling Octrees.

property diameter

Return diameter of the Octree in each dimension.

property lower_bound

Return lower bound of Octree in each dimension.

property upper_bound

Return upper bound of Octree in each dimension.

property maximum_level

Return the maximum level.

property vertices

Return the vertices.

property non_empty_leaf_nodes

Return the non-empty leaf nodes.

property sorted_indices

Return the indices sorted by leaf node.

property leaf_nodes_ptr

Return the index pointers for the leaf node elements.

Returns an array index_ptr, such that the indices from the jth non-empty leaf node can be obtained by self.sorted_indices[index_ptr[j]:index_ptr[j+1]] and the associated node index through self._non_empty_leaf_nodes[j].

property non_empty_nodes_by_level

Return the non-empty nodes by level.

property non_empty_nodes_ptr

Return the index pointers for non-empty nodes by level.

Returns an array index_ptr, such that the non-empty nodes of the jth level are given by self.non_empty_nodes_by_level[index_ptr[j]:index_ptr[j+1]].

property near_field_nodes

Return near field nodes.

property near_field_nodes_ptr

Return an index ptr to the near field nodes.

Returns an array index_ptr, such that self.near_field_nodes[index_ptr[j]:index_ptr[j+1]] contains the near field nodes for all nodes in level j. There are 27 entries for each near field node. The sequence of nodes is the same as for the array non_empty_nodes_by_level.

parent(node_index)

Return the parent index of a node.

children(node_index)

Return an iterator over the child indices.

nodes_per_side(level)

Return number of nodes along each dimension.

nodes_per_level(level)

Return the number of nodes in a given level.

leaf_containing_point(point)

Return the Morton index of a node containing the point.

node_bounds(morton_index, level)

Return the lower/upper bound of a node by Morton index.

The method returns a tuple (lbound, ubound) which define the lower and upper corners of a node given by its Morton index.

neighbors(node_index, level)

Return a list of indices of the neighbors of a node.

node_diameter(level)

Return node diameter in a given level.

_assign_nodes(vertices)

Compute leaf-nodes and parents.

_compute_nearfields()

Compute near fields of all non empty nodes.

Each node can have at most 27 near field nodes (including the node itself). If a near field node does not exist or is empty then the value -1 is stored, otherwise the node number.

_compute_interaction_list()

Compute the interaction list for each non empty node.