rbmatlab 0.10.01
|
A hierarchical cubegrid of arbitrary dimension.
This is an axis parallel hexaedral grid, with non-conform refinement structure. All vertices are explicitly generated and stored. Only practical for low dimensions, i.e. 1 to 4 or perhaps 5.
Definition at line 1 of file cubegrid.m.
Public Member Functions | |
cubegrid ( varargin) | |
constructor of a hierarchical cubegrid | |
function [
compress , new ] = | tpart_refine ( lids, new_midpoints) |
refines certain grid entities | |
function res = | check_consistency () |
function checking the consistency of a polygonal grid, i.e. checking, whether the edge centroids correspond (implicit neighbour-index test) | |
function
leaf_element = | coord2leaf_element ( coord) |
function giving the leaf_element of a grid where the values of the coord-vector can be found (coord- can for example be a set of mu-values in a parameter grid. This function utilizes a ![]() | |
function | demo () |
small script demonstrating the possibilities of the cubegrid class. | |
function | display () |
cubegrid's display method. | |
function ret = | get ( propertyname, varargin) |
get-method for cubegrids | |
function [
p0 , p1 ] = | get_edges ( gid) |
method determining the world coordinates of the edges of a single element with global index gid . | |
function gids = | get_leafgids () |
return leaf ids of cubegrid, i.e. vector with global element indices of leaf elements | |
function range = | get_ranges_of_element ( element) |
return the ranges corresponding to the element of the grid, i.e. maximum vertex range of the part_num element of the grid. | |
function vols = | get_volume ( gids) |
method determining the volumes of a set of elements | |
function lids = | gid2lid ( gids) |
function converting global element ids to leaf element ids | |
function gids = | lid2gid ( lids) |
function converting leaf-element ids to global element ids | |
function p = | plot ( params) |
plot method for a cubegrid. | |
function p = | plot_grid ( params) |
plot method for a cubegrid. A line plot is performed. Text can be plotted in the leafs of the grid. | |
function p = | plot_leafelement_data ( data, params) |
plot method for piecewise constant data on the leaf level of the grid. | |
function p = | plot_leafvertex_data ( data, params) |
plot method for data on the leaf level of the grid. | |
function ngrid = | refine ( lids) |
refinement routine for cubegrid. | |
function ngrid = | remove_duplicate_vertices ( epsilon) |
method to be used, if a vertex list in the grid should be compressed | |
function cubegrid gcopy = | copy () |
a deep copy of the cubegrid | |
Public Attributes | |
dimension | |
dimension of grid/number of coordinates per vertex | |
vertex | |
vertex(i,j) is the j-th coordinate of i-th vertex point | |
vertexindex | |
vertexindex(id,j) is the index of j-th vertex of element id | |
level | |
level(id) equals refinement level of element id | |
isleaf | |
isleaf(id) indicates, wether element id is leaf or not | |
firstchild | |
firstchild(id) indicates the lowest-index of a child element | |
refine_steps | |
number of refinement-steps, that have been performed on the grid so far | |
creation_step | |
creation_step(id) stores the refinement step number that has led to the element id . |
cubegrid.cubegrid | ( | varargin | ) |
constructor of a hierarchical cubegrid
gid
denotes global element indices, i.e. also covering non-leaf elements,lid
denotes indices for leaf indices.gids = lid2gid(grid,lid)
Conversion can be performed by lids = gid2lid(grid,gid)
The constructor has the following
cubegrid()
: construction of a default cubegrid (2d unit square)cubegrid(cgrid)
: copy-constructorcubegrid(params)
: generate cubegrid with certain options. The range
: cell array of intervals, where the array lengths determine the grid dimensionnumintervals
: vector with number of intervals per dimensionvarargin | varargin |
dimension —
dimension of grid/number of coordinates per vertex nelements —
number of overall elements (leaf + nonleaf); nvertices —
number of vertices; vertex —
vertex(i,j) =
j-th coordinate of i
-th vertex point vertexindex —
vertexindex(id,j) =
index of j
-th vertex of element id
level —
level(id) =
level, i.e. refinement steps of element id isleaf —
isleaf(id) =
0 or 1 whether element id is leaf or not refine_steps —
number of refinement-steps, that have been performed on the grid so far creation_step —
creation_step(id)
stores the refinement step number that has led to the element id
. Definition at line 80 of file cubegrid.m.
function res = cubegrid.check_consistency | ( | ) |
function checking the consistency of a polygonal grid, i.e. checking, whether the edge centroids correspond (implicit neighbour-index test)
res | boolean value which is true if the check succeeds, or false if it fails. |
Reimplemented from gridbase.
Definition at line 2 of file check_consistency.m.
function leaf_element = cubegrid.coord2leaf_element | ( | coord | ) |
function giving the leaf_element of a grid where the values of the coord-vector can be found (coord- can for example be a set of mu-values in a parameter grid. This function utilizes a -search algorithm.
coord : vector of coord-values (must have same dimension as grid)
15.02.2010 Markus Dihlmann
coord | coord |
leaf_element | leaf element |
Definition at line 2 of file coord2leaf_element.m.
function cubegrid gcopy = cubegrid.copy | ( | ) | [virtual] |
a deep copy of the cubegrid
gcopy | a deep copy of this instance also |
Implements gridbase.
Definition at line 382 of file cubegrid.m.
function cubegrid.display | ( | ) |
function ret = cubegrid.get | ( | propertyname, | |
varargin | |||
) |
get-method for cubegrids
propertyname | A property name of the grid which can be one of the following
|
varargin | An optional list of arguments as described above. |
ret | ret |
function [ p0 , p1 ] = cubegrid.get_edges | ( | gid | ) |
method determining the world coordinates of the edges of a single element with global index gid
.
i
-th edge goes from p0(:,i)
to p1(:,i)
gid | global index of element for which edge coordinates are requested |
p0 | lowest coordinate of the edge |
p1 | highest coordinate of the edge |
Definition at line 2 of file get_edges.m.
function gids = cubegrid.get_leafgids | ( | ) |
return leaf ids of cubegrid, i.e. vector with global element indices of leaf elements
Bernard Haasdonk 27.3.2007
gids | gids |
vector | of global leaf indices |
Definition at line 2 of file get_leafgids.m.
function range = cubegrid.get_ranges_of_element | ( | element | ) |
return the ranges corresponding to the element of the grid, i.e. maximum vertex range of the part_num element of the grid.
Markus Dihlmann 16.02.2010
element | element |
range | range |
Definition at line 2 of file get_ranges_of_element.m.
function vols = cubegrid.get_volume | ( | gids | ) |
method determining the volumes of a set of elements
A simple product of edge-lengths is computed, i.e. the edges are assumed to be axis-parallel.
gids | Global indices |
vols | The volumes for the elements given by gids . |
Definition at line 2 of file get_volume.m.
function lids = cubegrid.gid2lid | ( | gids | ) |
function gids = cubegrid.lid2gid | ( | lids | ) |
function p = cubegrid.plot | ( | params | ) |
plot method for a cubegrid.
A line plot is performed. Currently implementation for more than 3D not implemented, as this would be a line-mess
Bernard Haasdonk 1.3.2007
params | params |
p | this is the list of handles to the graphics primitives |
LineStyle —
LineStylecolor —
RGB vector shrink_factor —
if this flag is given, the elements are plotted shrinked plot_level —
if this flag is nonzero, a level plot is performed level —
this integer must be specified in case of level-plot plot_patch —
if this flag is set (only 2D and 3D) the plot is done by colored patches axis_equal —
if this flag is set, set axis to equal scale function p = cubegrid.plot_grid | ( | params | ) |
plot method for a cubegrid. A line plot is performed. Text can be plotted in the leafs of the grid.
p is the list of handles to the graphics primitives
leaftext : vector of strings. Length must be equal to number of leafelements. The text is shown in the cogs (center of gravities) of the leafelements.
Markus Dihlmann 18.02.2010
params | params |
p | p |
text —
text Definition at line 2 of file plot_grid.m.
function p = cubegrid.plot_leafelement_data | ( | data, | |
params | |||
) |
plot method for piecewise constant data on the leaf level of the grid.
Currently only implemented for 2D. A patch plot is performed.
data | data |
params | params |
p | this is the list of handles to the graphics primitives |
Definition at line 2 of file plot_leafelement_data.m.
function p = cubegrid.plot_leafvertex_data | ( | data, | |
params | |||
) |
plot method for data on the leaf level of the grid.
Currently only implemented for 2D. A patch plot is performed, such that the vertices have corresponding values as given by data, the values in between are interpolated by MATLAB.
data | data |
params | params |
p | this is the list of handles to the graphics primitives |
Definition at line 2 of file plot_leafvertex_data.m.
function ngrid = cubegrid.refine | ( | lids | ) |
refinement routine for cubegrid.
Refinement rule is a simple division into smaller cubes After refinement, a condensation of the vertex list is performed by remove_duplicate_vetrices(), i.e. duplicate vertices generated during refinement are removed.
lids | List of leaf-element ids of the to-be-refined codim 0 entities. Only leaf-elements can reasonably be refined, so do not pass global elements here, as internally a translation into global element ids is performed. |
ngrid | the refined grid |
function ngrid = cubegrid.remove_duplicate_vertices | ( | epsilon | ) |
method to be used, if a vertex list in the grid should be compressed
This might be required after refinement of a grid, merging of grids, etc. Duplicate detection is based on l2-error deviation thresholded by epsilon
.
epsilon | l2-error deviation threshold. (Default = 1e-6 ) |
ngrid | the compressed grid |
vertex —
vertex vertexindex —
vertexindex nvertices —
nvertices Definition at line 2 of file remove_duplicate_vertices.m.
function [ compress , new ] = cubegrid.tpart_refine | ( | lids, | |
new_midpoints | |||
) |
refines certain grid entities
lids | ids of grid entities to be refined |
new_midpoints | the newly created vertices of the refined grid. |
compress | the ids of entities which are getting smaller due to the refinement. |
new | ids of the newly created elements |
Definition at line 317 of file cubegrid.m.