next up previous contents index
Next: Methods on Mesh2d Up: General Meshes Previous: Examples for the implementation

Mesh2D

 

In the above discussion we always have considered the three dimensional case and argued that it is of more interest. Discussing the 2D structures is more or less straightforward. Here we present now the appropriate 2D structures including the class Mesh2d. The meaning of the structure entries are analogous to those already discussed in 3D. The main difference is in ELEMENT2D_DESCRIPTION, where everything is much simpler, because the reference element is always a convex (planar) polygon in parameter space. Thus, an array of vertex coordinates contains all geometric information. For the neighbour() and boundary() functions, edge n lies between vertex n and vertex tex2html_wrap_inline44478 .

 

typedef struct element2d_description  ELEMENT2D_DESCRIPTION;
typedef struct element2d              ELEMENT2D; 
typedef struct mesh2d                 MESH2D;
typedef struct f_data2d               F_DATA2D;
typedef struct f_el_info2d            F_EL_INFO2D;

struct element2d_description
{
  int       number_of_vertices;    

  int       dimension_of_coord;    
  double    **coord;               
  int       parametric_degree;     
  int       (*world_to_coord)(ELEMENT2D *,float *, double *);
  void      (*coord_to_world)(ELEMENT2D *,double *, float *);
  int       (*check_inside)(ELEMENT2D *, double *);

  ELEMENT2D *(*neighbour)(ELEMENT2D *, int, int,  double *, float *);
  int       (*boundary)(ELEMENT2D *, int);
};

struct element2d
{
  MESH2D                *mesh;         
  float                 **vertex;      
  int                   *vindex;       
  int                   eindex;        
  ELEMENT2D_DESCRIPTION *descr;        

  int                   size_of_user_data;
  void                  *user_data;    
};

struct mesh2d
{
  ELEMENT2D     *(*first_element)(MESH2D *);
  ELEMENT2D     *(*next_element)(ELEMENT2D *);
  ELEMENT2D     *(*copy_element)(ELEMENT2D *);
  void          (*free_element)(ELEMENT2D *);

  int           dimension_of_world;    
  int           max_dimension_of_coord;
  int           max_eindex;            
  int           max_vindex;            
  int           max_number_of_vertices;

  F_DATA2D      *f_data;

  int           size_of_user_data;   
  void          *user_data;          
};

struct f_data2d
{
  char     *name;                    
  int      dimension_of_value;       
  int      continuous_data;          
  void     (*f)(ELEMENT2D *, int,  double[],  double[]);   
  void     (*f_el_info)(ELEMENT2D *, F_EL_INFO2D *);

  int      size_of_user_data;        
  void     *user_data;               

  F_DATA2D *last, *next;             
};

struct f_el_info2d
{
  int           polynomial_degree; 
};



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.