next up previous contents index
Next: Conversion Methods Up: General Meshes Previous: Global access to general

Methods on Mesh3d

 

   

GRAPE(mesh, "display")()
MESH3D *mesh

The Mesh3d instance mesh is rendered on the standard device in a default manner. All the boundary faces of the elements are displayed as flat shaded patches in patch mode and in grid mode the edges of these faces are drawn.

                   

GRAPE(mesh, "clip")(f,var,draw_clip,scal)
GRAPE(mesh, "clip-ball-disp")()
GRAPE(mesh, "clip-plane-disp")()
GRAPE(mesh, "clip-deg-fine-disp")()
GRAPE(mesh, "clip-isoline-disp")()
GRAPE(mesh, "clip-vect-disp")()
MESH3D *mesh
double (*f)(VEC3 x,void *var)
void *var
int (*draw_clip)(CLIPM3D_PAR)
void *scal

These methods are designed to support general clipping facilities with varying hypersurface and local rendering function. The most basic method with the greatest flexibility is the method "clip". The others are special predefined interactive methods derived from the latter one. The domain of the mesh is split by the implicitly given clipping function f into a visible (f > 0) and an invisible (f < 0) part. The zero level of this clipping function defines the intersection surface.

The variable var in the parameter list of the method call and of this function f must be of the same type. The parameter *var allows an interactive varying of the clipping function. The implicit functions describing a plane or a ball are predefined:

typedef struct MPLANE_PARM = { double n_x,n_y,n_z,distance;};

double mplane(VEC3 x, MPLANE_PARM *var)

typedef struct MBALL_PARM = { double center_x,center_y,center_z,radius;};

double mball(VEC3 x, MBALL_PARM *var)

The pointer draw_clip points to a function which renders the surface of intersection on a single element. This function works on the data corresponding to one single clipped element. A NIL pointer causes the standard visualization of the surfaces including normal shading.

There are some predefined local rendering functions:

The interactive methods "clip-isoline-disp", "clip-deg-fine-disp", "clip-vect-disp" use these routines while calling the standard clipping method "clip".

To construct a new private rendering method working on the surface of intersection, the user can add new clipping methods by using other and different surfaces or by adding new local rendering functions. Therefore we now explain the parameter structure for the local rendering function draw_clip. The general 'clip' method calls this function in the following way:

draw_clip((CLIPM3D_PAR *clip3d_par)

The structure clip3d_par with the following typedef is filled by the general "clip" method.

typedef struct clipm3d_par 
{ ELEMENT3D *e;        
  int n;     
  VEC3 *v;    
  double *coord;    
  double (*f)();  
  void *var;       
  void *scal; 
  int flag ;         
  int dimension_of_value;
} CLIPM3D_PAR;

This structure describes the intersection of the hypersurface with a single element. The filled structure is delivered by the actual method "clip". The variable e points to the intersected element and n gives the number of intersection points of one connected intersection patch. The array v[ tex2html_wrap_inline44452 ][ tex2html_wrap_inline44454 ] contains the global Euclidian coordinates of these points. They are located on edges of the element's boundary at a linearly interpolated intersection position. In all the listed interactive methods a plane is used as the clipping function. coord is a pointer to a list of the local coordinates of the intersection points , which are stored in global coordinates in v. In this 1D array the i'th coordinate vector starts at position (coord+i*d) where d is the dimension of coordinate space on the current element. The pointer var points to the parameters of the function describing the intersecting hypersurface.At the memory address scal the function draw_clip finds a user defined structure filled with parameters for the specific rendering style. These parameters can be influenced interactively, if the user supports this in an appropriate interactive method (see also the GRAPE reference manual).

               

GRAPE(mesh, "shrink")(p,f,fpar)
GRAPE(mesh, "shrink-disp")()
GRAPE(mesh, "shrink-focus-element-disp")()
GRAPE(mesh, "shrink-layer-disp")()
MESH3D *mesh
double p
int (*f)(ELEMENT3D *el,void *fpar)
void *fpar

The set of elements belonging to the Mesh3d instance is displayed on the standard device as a patch or grid model. They are separated from each other by a small gap of relative width p, this makes it possible to identify each element. There is a selection criterion for those elements which are of interest. The main method is called "shrink". Here a specific element is displayed if f(ELEMENT3D *el,void *fpar) is true otherwise it is skipped. There are several interactive versions with different predefined functions f.

           

GRAPE(mesh, "level")(func,lev)
GRAPE(mesh, "level-disp")()
GRAPE(mesh, "sub-level-disp")()
GRAPE(mesh, "super-level-disp")()
MESH3D *mesh
void (*func)(ELEMENT3D *el, double *coord, double *val)
double lev

The slices of those elements where the one-dimensional finite element function func has the level lev are calculated and displayed. The paramters of func are equal to those used for a one dimensional FEM function on a Mesh3d instance: f(ELEMENT3D *el, double *coord, double *val). If func is NIL and mesh includes a function then this finite element function is taken into account. If its dimension of value is greater than 1 the absolute value of the value vector defines the function under consideration. The resulting 2D level surface consists of a polygonal approximation. The "super" and the "sub"-methods display the super or sub volumes of the function on the volume geometry.


next up previous contents index
Next: Conversion Methods Up: General Meshes Previous: Global access to general

SFB 256 Universität Bonn and IAM Universität Freiburg

Copyright © by the Sonderforschungsbereich 256 at the Institut für Angewandte Mathematik, Universität Bonn.