rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes
XPartMap Class Reference

Detailed Description

a geometric tree where every nodes has geometry information attached.

The geometry relations are as follows
  • Child node's geometries lie in their parents geometries.
  • Sibling's geometries have zero intersection.
  • The union of all child node's geometries equals a parent's geometry.
  • The geometries are of arbitrary dimension and can be defined by an arbitrary number of coordinates.
The main features of this class are
  • Routines to split the geometries and to create new childs are provided.
  • The leaf nodes can be accessed over a sorted or an unsorted index.
  • We can check in \({\cal O}(\log)\)-time in which node's geometry a certain coordinate lies.

details

The nodes store the following information:

  1. a number with the ID of the first child of this node or 0 indicating a leaf node
  2. the ncoords coordinates describing the node's geometry.

So every node has a size of 1 + ncoords * dimension.

We distinguish between three enumerations of nodes:

  1. a "node ID" is given to every node in the tree and does not change during a refinement for nodes that are unchanged.
  2. a "leaf element index" is a consecutive enumeration of leaf indices which does not change for unchanged leaf nodes during a refinement
  3. a "sorted leaf element index" is a consecutive enumeration of leaf indices enumerating the leaf elements from left-to-right.

Definition at line 17 of file XPartMap.m.

Inheritance diagram for XPartMap:
Inheritance graph
[legend]
Collaboration diagram for XPartMap:
Collaboration graph
[legend]

Public Member Functions

function XPartMap copy = copy ()
 deep copy for an XPartMap instance More...
 
 XPartMap (dimension, ncoords, init_coords, level1_splits)
 constructor creating an XPartMap with one single root node. More...
 
function elems = coords2elem (tcoords)
 returns element IDs of leaf nodes whose geometries host the given coordinates. More...
 
function
new_vec = 
split (iind, split_point)
 default implementation for the splitting of one node's geometry More...
 
function [
changed_ids ,
new_ids ] = 
refine (iinds, split_points)
 refines nodes given by indices at given points More...
 
function bary = barycenter (iind)
 computes the barycenter of a node's geometry More...
 
function yes = intersect (coords, iind)
 checks whether a geometric entity intersects with another one given by a node's ID More...
 
function ok = is_inside (coord, iind)
 checks whether a given coord lies in a node's geometry More...
 
function [ XPartMap sxm
,
old_leaf_enum ] = 
sub_xpart_map (coords)
 creates new object holding a subset of the current XPartMap lying in the region specified by coords More...
 
function coords = get_coords (iind)
 helper function rearranging the vector of node coordinates into a matrix with row vectors as coordinates. More...
 

Static Public Member Functions

static function ce = crop_entity (coords1, coords2)
 helper function computing the actual intersection of two geometries given by their coordinates. More...
 

Public Attributes

 dimension = 1
 dimension of geometries More...
 
 ncoords = 2
 number of coordinates defining a geometry More...
 
 intervals = "[0 0 1]"
 actual tree with attached geometries More...
 
 split_size = 2
 integer specifying how many children are created at refinement step More...
 
 leaf_ids = 0
 an unsorted enumeration of the leaf indices More...
 
 leaf_enum = 0
 a sorted enumeration of the leaf indices. More...
 
 refine_levels = 0
 A vector which stores the refinement level for every node. More...
 
 siz
 the number of the leaf nodes More...
 
 skip
 storage size of a single tree node pair (c, coords) More...
 
 max_level
 the maximum refinement level of the tree More...
 
 noof_ids
 the number of node IDs in the tree More...
 

Constructor & Destructor Documentation

XPartMap.XPartMap (   dimension,
  ncoords,
  init_coords,
  level1_splits 
)

constructor creating an XPartMap with one single root node.

Parameters
dimensiondimension of geometries
ncoordsnumber of coordinates defining a geometry
init_coordsinitial coordinates for the root node's geometry.
level1_splitslevel1 splits

Definition at line 235 of file XPartMap.m.

Here is the caller graph for this function:

Member Function Documentation

function bary = XPartMap.barycenter (   iind)

computes the barycenter of a node's geometry

Parameters
iindnode ID of the node whose gemoetry's barycenter shall be computed
Return values
barycoordinate vector of the barycenter.

Definition at line 475 of file XPartMap.m.

Here is the caller graph for this function:

function elems = XPartMap.coords2elem (   tcoords)

returns element IDs of leaf nodes whose geometries host the given coordinates.

Parameters
tcoordsn x dimension matrix of n coordinate (row) vectors for which the enclosing entity ID shall be determined.
Return values
elemsa n vector holding the element IDs.

Definition at line 285 of file XPartMap.m.

Here is the call graph for this function:

function XPartMap copy = XPartMap.copy ( )

deep copy for an XPartMap instance

Return values
copythe copied object

Definition at line 216 of file XPartMap.m.

Here is the call graph for this function:

function ce = XPartMap.crop_entity (   coords1,
  coords2 
)
static

helper function computing the actual intersection of two geometries given by their coordinates.

Parameters
coords1first 2 x dimension matrix of cube extreme point coordinates.
coords2second 2 x dimension matrix of cube extreme point coordinates.
Return values
ceintersection of the two geometries given by the two arguments.

Definition at line 651 of file XPartMap.m.

Here is the caller graph for this function:

function coords = XPartMap.get_coords (   iind)

helper function rearranging the vector of node coordinates into a matrix with row vectors as coordinates.

Parameters
iindthe node's ID
Return values
coordsthe rearranged coordinates. (ncoords x dimension matrix)

Definition at line 633 of file XPartMap.m.

Here is the caller graph for this function:

function yes = XPartMap.intersect (   coords,
  iind 
)

checks whether a geometric entity intersects with another one given by a node's ID

Parameters
coords2 x dimension matrix describing the geometric entity
iindID of other node entity
Return values
yesboolean flag indicating whether the intersection exists

Definition at line 491 of file XPartMap.m.

Here is the call graph for this function:

Here is the caller graph for this function:

function ok = XPartMap.is_inside (   coord,
  iind 
)

checks whether a given coord lies in a node's geometry

Parameters
coordthe coordinate vector of length dimension.
iindID of node entity to check with
Return values
okboolean flag

Definition at line 537 of file XPartMap.m.

Here is the call graph for this function:

Here is the caller graph for this function:

function [ changed_ids , new_ids ] = XPartMap.refine (   iinds,
  split_points 
)

refines nodes given by indices at given points

Parameters
iindsa vector of node IDs for elements that shall be refined.
split_pointsa matrix with row vectors of points are given to the split() method as second argument. This argument is optional. (default = barycenter)
Return values
changed_idsvector of the IDs of the nodes that were changed during the refinement.
new_idsvector of the IDs of the nodes that were newly created during the refinement.

Definition at line 395 of file XPartMap.m.

Here is the call graph for this function:

function new_vec = XPartMap.split (   iind,
  split_point 
)

default implementation for the splitting of one node's geometry

This split works as follows
  • If split_size is equal to 2^(dimension), the geometry is split in each of the dimension directions.
  • If split_size is equal to 2, the geometry is split in the direction where the geometry has its widest extent.
Parameters
iindthe node's ID
split_pointan optional matrix with coordinate vectors specifying where the geometry shall be split. (default=barycenter)
Return values
new_vecvector with coordinates of new geometries.

Definition at line 340 of file XPartMap.m.

Here is the caller graph for this function:

function [ XPartMap sxm , old_leaf_enum ] = XPartMap.sub_xpart_map (   coords)

creates new object holding a subset of the current XPartMap lying in the region specified by coords

Parameters
coordsa 2xdimension matrix describing the region in which all the nodes of the resulting XPartMap shall lie.
Return values
sxman object holding a subset of the current map.
old_leaf_enumold leaf enum
Generated fields of sxm:
  • intervals —  intervals
  • refine_levels —  refine levels
  • leaf_ids —  leaf ids
  • leaf_enum —  leaf enum

Definition at line 563 of file XPartMap.m.

Here is the call graph for this function:

Member Data Documentation

XPartMap.dimension = 1

dimension of geometries


Default: 1

Definition at line 61 of file XPartMap.m.

XPartMap.intervals = "[0 0 1]"

actual tree with attached geometries

This stores a list of pairs (c, coords) of the index of the first child c and the geometry coordinates coords. If c is equal to 0, the node is a leaf node. The first pair is the root node of the tree.


Default: "[0 0 1]"

Definition at line 77 of file XPartMap.m.

XPartMap.leaf_enum = 0

a sorted enumeration of the leaf indices.

This set is constructed by a deep traversal of the tree, with left-to-right enumeration of leafs.


Default: 0

Definition at line 110 of file XPartMap.m.

XPartMap.leaf_ids = 0

an unsorted enumeration of the leaf indices

If a leaf has not been refined, it keeps its position in this set.


Default: 0

Definition at line 99 of file XPartMap.m.

XPartMap.max_level

the maximum refinement level of the tree

Note
This property has the MATLAB attribute Dependent set to true.
Matlab documentation of property attributes.
[readonly]

Definition at line 156 of file XPartMap.m.

XPartMap.ncoords = 2

number of coordinates defining a geometry


Default: 2

Definition at line 69 of file XPartMap.m.

XPartMap.noof_ids

the number of node IDs in the tree

Note
This property has the MATLAB attribute Dependent set to true.
Matlab documentation of property attributes.
[readonly]

Definition at line 167 of file XPartMap.m.

XPartMap.refine_levels = 0

A vector which stores the refinement level for every node.


Default: 0

Definition at line 122 of file XPartMap.m.

XPartMap.siz

the number of the leaf nodes

Note
This property has the MATLAB attribute Dependent set to true.
Matlab documentation of property attributes.
[readonly]

Definition at line 134 of file XPartMap.m.

XPartMap.skip

storage size of a single tree node pair (c, coords)

Note
This property has the MATLAB attribute Dependent set to true.
Matlab documentation of property attributes.
[readonly]

Definition at line 145 of file XPartMap.m.

XPartMap.split_size = 2

integer specifying how many children are created at refinement step


Default: 2

Definition at line 90 of file XPartMap.m.


The documentation for this class was generated from the following file: