File size: 26,120 Bytes
10f2621
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
/**
 *  @file       vel.h
 *  @ingroup    global_mc
 *  @brief      Class Vel: a canonical set element object.
 *  @author     Michael Holst
 *  @note       None 
 *  @version    $Id: vel.h,v 1.21 2010/08/12 05:19:07 fetk Exp $ 
 *
 *  @attention
 *  @verbatim
 *
 * MC = < Manifold Code >
 * Copyright (C) 1994-- Michael Holst
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 *  @endverbatim
 */

#ifndef _VEL_H_
#define _VEL_H_

#include <mc/mc_base.h>

/*
 * ***************************************************************************
 * Class Vel: Parameters and datatypes
 * ***************************************************************************
 */

/** @brief Gip.bits masks (implicit "0/1"s in front that pad out the word) 
 *         none */
#define MASK_00000000000000000000000000000000  000000000000 
/** @brief Gip.bits masks (implicit "0/1"s in front that pad out the word) 
 *         reality */
#define MASK_00000000000000000000000000000011  000000000003 
/** @brief Gip.bits masks (implicit "0/1"s in front that pad out the word) 
 *         dim */
#define MASK_00000000000000000000000000001100  000000000014
/** @brief Gip.bits masks (implicit "0/1"s in front that pad out the word) 
 *         class */
#define MASK_00000000000000000000000000110000  000000000060 
/** @brief Gip.bits masks (implicit "0/1"s in front that pad out the word) 
 *         type */
#define MASK_00000000000000000011111111000000  000000037700
/** @brief Gip.bits masks (implicit "0/1"s in front that pad out the word) 
 *         chart */
#define MASK_11111111111111111100000000000000  007777740000 
/* ------------------------------------------------------------------------ */
/** @brief Gip.bits masks (implicit "0/1"s in front that pad out the word) 
 *         none */
#define MASK_11111111111111111111111111111111 ~000000000000 
/** @brief Gip.bits masks (implicit "0/1"s in front that pad out the word) 
 *         reality */
#define MASK_11111111111111111111111111111100 ~000000000003 
/** @brief Gip.bits masks (implicit "0/1"s in front that pad out the word) 
 *         dim */
#define MASK_11111111111111111111111111110011 ~000000000014 
/** @brief Gip.bits masks (implicit "0/1"s in front that pad out the word) 
 *         class */
#define MASK_11111111111111111111111111001111 ~000000000060 
/** @brief Gip.bits masks (implicit "0/1"s in front that pad out the word) 
 *         type */
#define MASK_11111111111111111100000000111111 ~000000037700 
/** @brief Gip.bits masks (implicit "0/1"s in front that pad out the word) 
 *         chart */
#define MASK_00000000000000000011111111111111 ~007777740000 
/* ------------------------------------------------------------------------ */

/** @brief Sip.tags masks (implicit "0/1"s in front that pad out the word)
 *         refine edge0 */
#define MASK_00000000000000000000000000000111  000000000007 
/** @brief Sip.tags masks (implicit "0/1"s in front that pad out the word)
 *         marked edge1 */
#define MASK_00000000000000000000000000111000  000000000070 
/** @brief Sip.tags masks (implicit "0/1"s in front that pad out the word)
 *         marked edge2 */
#define MASK_00000000000000000000000111000000  000000000700 
/** @brief Sip.tags masks (implicit "0/1"s in front that pad out the word)
 *         marked edge3 */
#define MASK_00000000000000000000111000000000  000000007000 
/** @brief Sip.tags masks (implicit "0/1"s in front that pad out the word)
 *         degen marks */
#define MASK_00000000000000000111000000000000  000000070000
/** @brief Sip.tags masks (implicit "0/1"s in front that pad out the word)
 *         refine count */
#define MASK_00000000000000111000000000000000  000000700000 
/** @brief Sip.tags masks (implicit "0/1"s in front that pad out the word)
 *         refine Q0 */
#define MASK_00000000000001000000000000000000  000001000000
/** @brief Sip.tags masks (implicit "0/1"s in front that pad out the word)
 *         refine Q1 */
#define MASK_00000000000010000000000000000000  000002000000
/* ------------------------------------------------------------------------ */
/** @brief Sip.tags masks (implicit "0/1"s in front that pad out the word)
 *         refine edge0 */
#define MASK_11111111111111111111111111111000 ~000000000007
/** @brief Sip.tags masks (implicit "0/1"s in front that pad out the word)
 *         refine edge1 */
#define MASK_11111111111111111111111111000111 ~000000000070
/** @brief Sip.tags masks (implicit "0/1"s in front that pad out the word)
 *         refine edge2 */
#define MASK_11111111111111111111111000111111 ~000000000700 
/** @brief Sip.tags masks (implicit "0/1"s in front that pad out the word)
 *         refine edge3 */
#define MASK_11111111111111111111000111111111 ~000000007000 
/** @brief Sip.tags masks (implicit "0/1"s in front that pad out the word)
 *         degen marks */
#define MASK_11111111111111111000111111111111 ~000000070000 
/** @brief Sip.tags masks (implicit "0/1"s in front that pad out the word)
 *         refine count */
#define MASK_11111111111111000111111111111111 ~000000700000 
/** @brief Sip.tags masks (implicit "0/1"s in front that pad out the word)
 *         refine Q0 */
#define MASK_11111111111110111111111111111111 ~000001000000 
/** @brief Sip.tags masks (implicit "0/1"s in front that pad out the word)
 *         refine Q1 */
#define MASK_11111111111101111111111111111111 ~000002000000 
/* ------------------------------------------------------------------------ */

/* ------------------------------------------------------------------------ */
/** @brief Sip.faces masks (implicit "0/1"s in front that pad out the word) 
 *         face 0 type */
#define MASK_00000000000000000000000011111111  000000000377 
/** @brief Sip.faces masks (implicit "0/1"s in front that pad out the word) 
 *         face 1 type */
#define MASK_00000000000000001111111100000000  000000177400 
/** @brief Sip.faces masks (implicit "0/1"s in front that pad out the word) 
 *         face 2 type */
#define MASK_00000000111111110000000000000000  000077600000 
/** @brief Sip.faces masks (implicit "0/1"s in front that pad out the word) 
 *         face 3 type */
#define MASK_11111111000000000000000000000000  037700000000 
/* ------------------------------------------------------------------------ */
/** @brief Sip.faces masks (implicit "0/1"s in front that pad out the word) 
 *         face 0 type */
#define MASK_11111111111111111111111100000000 ~000000000377
/** @brief Sip.faces masks (implicit "0/1"s in front that pad out the word) 
 *         face 1 type */
#define MASK_11111111111111110000000011111111 ~000000177400
/** @brief Sip.faces masks (implicit "0/1"s in front that pad out the word) 
 *         face 2 type */
#define MASK_11111111000000001111111111111111 ~000077600000 
/** @brief Sip.faces masks (implicit "0/1"s in front that pad out the word) 
 *         face 3 type */
#define MASK_00000000111111111111111111111111 ~037700000000 
/* ------------------------------------------------------------------------ */

/**
 * @ingroup global_mc
 * @brief   struct Gip (2*4=8 bytes) 
 * @author  Michael Holst
 */
typedef struct Gip {
  /**
   * @brief See note
   * @note
   * @verbatim 
   * (0-1)---> Reality (0--3=[2^2-1])           
   * -------->     0 = real                          
   * -------->     1 = ghost                          
   * -------->     2 = deleted                         
   * -------->     3 = <unused>                        
   * (2-3)---> Intrinsic Dimension (0--3=[2^2-1])     
   * -------->     0 = <unused>                       
   * -------->     1 = 1D                              
   * -------->     2 = 2D                              
   * -------->     3 = 3D                              
   * (4-5)---> Simplex Class (0--3=[2^2-1])            
   * -------->     0 = 0-simplex (vertex)             
   * -------->     1 = 1-simplex (edge)               
   * -------->     2 = 2-simplex (triangle)           
   * -------->     3 = 3-simplex (tetrahedron)        
   * (6-13)--> Material Type (0--256=[2^8-1])         
   * -------->     Simplex interpretation:            
   * -------->       0,1,2,3,...       = Material tag 
   * -------->     Vertex and Edge interpretation:    
   * -------->       0                 = Interior     
   * -------->       ODD (1,3,5,...)   = Dirichlet    
   * -------->       EVENP (2,4,6,...) = Neumann      
   * (14-31)-> Chart (in the atlas) (0--262K=[2^18-1])
   *  @endverbatim */
    unsigned int bits; 
  /** @brief --------> Unit id (0--4G=[2^32-1]) */
    unsigned int uid;
} Gip;

/**
 * @ingroup global_mc
 * @brief   struct Vip (3*8+3*4=36 bytes) 
 * @author  Michael Holst
 */
typedef struct Vip {
  /** @brief --------> My coordinates (wrt my chart)           */
    double x[3];  
  /** @brief --------> Ptr to first of my edges                */  
    void   *ePtr; 
  /** @brief --------> Ptr to first of my simplices            */
    void   *sPtr; 
  /** @brief --------> Ptr to parent edge of which I am midpt  */
    void   *eParent;  
} Vip;

/** 
 * @ingroup global_mc
 * @brief   struct Eip (6*4=24 bytes) 
 * @author  Michael Holst
 */
typedef struct Eip { 
  /** @brief --------> Ptr to vertices forming my edge         */
    void   *vPtr[2]; 
  /** @brief --------> Ptr to next edge sharing my verts       */
    void   *ePtr[2]; 
  /** @brief --------> Ptr to my refined midpoint vertex       */
    void   *midPtr;  
  /** @brief --------> Ptr to parent edge (1 of 2 siblings)    */
    void   *eParent;   
} Eip;

/** 
 * @ingroup global_mc
 * @brief   struct Fip (3*4=12 bytes) 
 * @author  Michael Holst
 */
typedef struct Fip { 
  /** @brief --------> Group ID for simplex with mirror face   */
    int    gID;    
  /** @brief --------> Ptr to my (single) owning simplex       */  
    void   *sPtr;  
  /** @brief -------> child ID containing refinement history   */
    unsigned int rhist;
  /** @brief -------> refinement level for this face           */
    unsigned int rlevel;
} Fip;

/**
 * @ingroup global_mc
 * @brief   (14*4=56 bytes OR 24*4=96 bytes) 
 * @author  Michael Holst
 */
typedef struct Sip {
  /** @brief --------> Ptr to my dim+1 verts                   */
    void   *vPtr[4]; 
  /** @brief --------> dim+1 simplex ring ptrs                 */
    void   *sPtr[4];
  /** @brief --------> dim+1 potential boundary faces          */ 
    void   *fPtr[4];
#if defined(VG_ELEMENT)
  /** @brief --------> Global face numbers                     */
    int    fNum[4];  
  /** @brief --------> Global edge numbers                     */
    int    eNum[6];   
#endif
  /**
   * @brief See note
   * @note
   * @verbatim
   * (0-2)---> Marked edge 0 (ref edge) (0--5<[2^3]-1)
   * (3-5)---> Marked edge 1            (0--5<[2^3]-1)
   * (6-8)---> Marked edge 2            (0--5<[2^3]-1)
   * (9-11)--> Marked edge 3            (0--5<[2^3]-1) 
   * (12-14)-> Degenerate markings      (0--5<[2^3]-1) 
   * (15-17)-> Refinement counter       (0--7=[2^3]-1) 
   * (18-18)-> I'm on refinement Q0     (0=no, 1=yes)  
   * (19-19)-> I'm on refinement Q1     (0=no, 1=yes)  
   * (20-31)-> <unused>                                
   * @endverbatim
   */ 
    unsigned int tags; 
  /** @verbatim
   * (0-7)---> Face 0 (0=Interior,ODD=Diri,EVENP=Neum) 
   * (8-15)--> Face 1 (0=Interior,ODD=Diri,EVENP=Neum)
   * (16-23)-> Face 2 (0=Interior,ODD=Diri,EVENP=Neum)
   * (24-31)-> Face 3 (0=Interior,ODD=Diri,EVENP=Neum)
   * @endverbatim
   */
    unsigned int faces;
} Sip;

/**
 * @ingroup global_mc
 * @brief   typedef union VES 
 *          (40 bytes=max[36,24,40] OR 80 bytes=max[36,24,80])
 * @author  Michael Holst
 */
typedef union VES {
  /** @brief Vertex information package */
    Vip v;  
  /** @brief Edge information package */
    Eip e;
  /** @brief Simplex information package */
    Sip s;
} VES;

/*
 * ***************************************************************************
 * Class Vel: Global objects
 * ***************************************************************************
 */

/** @brief Useful simplex geometry mappings */
VEXTERNC const int vmapE[4][4];
/** @brief Useful simplex geometry mappings */
VEXTERNC const int vmapEI[6][2];
/** @brief Useful simplex geometry mappings */
VEXTERNC const int vmapV[6][4];
/** @brief Useful simplex geometry mappings */
VEXTERNC const int vmapF[4][3];
/** @brief Useful simplex geometry mappings */
VEXTERNC const int vmapFE[4][3];
/** @brief Useful simplex geometry mappings */
VEXTERNC const int vmapOV1[4][4][4];
/** @brief Useful simplex geometry mappings */
VEXTERNC const int vmapOV2[2][4][4];
/** @brief Useful simplex geometry mappings */
VEXTERNC const int vmapOV3[4][3];
/** @brief Useful simplex geometry mappings */
VEXTERNC const int vmapOE[4][3];

/**
 * @ingroup global_mc
 * @brief   Class Vel: Definition (8+80 bytes) 
 * @author  Michael Holst
 */
typedef struct Vel {
    Gip      g;        /**< @brief geometric information package            */
    VES      d;        /**< @brief vertex,edge,simplex data                 */
} Vel;

/*
 * ***************************************************************************
 * Class Vel: Inlineable methods (vel.c)
 * ***************************************************************************
 */

#if !defined(VINLINE_GEM)
    /** 
     *  @ingroup Vel
     *  @brief   Initialize the element. 
     *  @author  Michael Holst
     *  @note    Class Vel: Inlineable methods (vel.c) 
     *  @return  None
     *  @param   thee  Pointer to class Vel
     *  @param   tdim  the dimension bits
     *  @param   tid   the ID bits
     */
    VEXTERNC void Vel_init(Vel *thee, int tdim, int tid);

    /** 
     *  @ingroup Vel
     *  @brief   Re-Initialize the element. 
     *  @author  Michael Holst
     *  @note    Class Vel: Inlineable methods (vel.c) 
     *  @return  None
     *  @param   thee  Pointer to class Vel
     */
    VEXTERNC void Vel_reinit(Vel *thee);

    /** 
     *  @ingroup Vel
     *  @brief   Set the reality bits.
     *  @author  Michael Holst
     *  @note    Class Vel: Inlineable methods (vel.c) 
     *  @return  None
     *  @param   thee  Pointer to class Vel
     *  @param   reel  the reality bits
     */
    VEXTERNC void Vel_setReality(Vel *thee, int reel);

    /** 
     *  @ingroup Vel
     *  @brief   Set the dimension bits.
     *  @author  Michael Holst
     *  @note    Class Vel: Inlineable methods (vel.c) 
     *  @return  None
     *  @param   thee  Pointer to class Vel
     *  @param   dim   the dimension bits
     */
    VEXTERNC void Vel_setDim(Vel *thee, int dim);

    /** 
     *  @ingroup Vel
     *  @brief   Set the class bits.
     *  @author  Michael Holst
     *  @note    Class Vel: Inlineable methods (vel.c) 
     *  @return  None
     *  @param   thee  Pointer to class Vel
     *  @param   clas  the class bits
     */
    VEXTERNC void Vel_setClass(Vel *thee, int clas);

    /** 
     *  @ingroup Vel
     *  @brief   Set the type bits.
     *  @author  Michael Holst
     *  @note    Class Vel: Inlineable methods (vel.c) 
     *  @return  None
     *  @param   thee  Pointer to class Vel
     *  @param   type  the type bits
     */
    VEXTERNC void Vel_setType(Vel *thee, int type);

    /** 
     *  @ingroup Vel
     *  @brief   Set the chart bits.
     *  @author  Michael Holst
     *  @note    Class Vel: Inlineable methods (vel.c) 
     *  @return  None
     *  @param   thee   Pointer to class Vel
     *  @param   chart  the chart bits
     */
    VEXTERNC void Vel_setChart(Vel *thee, int chart);

    /** 
     *  @ingroup Vel
     *  @brief   Set the ID bits.
     *  @author  Michael Holst
     *  @note    Class Vel: Inlineable methods (vel.c) 
     *  @return  None
     *  @param   thee  Pointer to class Vel
     *  @param   id    the ID bits
     */
    VEXTERNC void Vel_setId(Vel *thee, int id);

    /** 
     *  @ingroup Vel
     *  @brief   Return the reality.
     *  @author  Michael Holst
     *  @note    Class Vel: Inlineable methods (vel.c) 
     *  @return  the reality
     *  @param   thee  Pointer to class Vel
     */
    VEXTERNC unsigned int Vel_reality(Vel *thee);

    /** 
     *  @ingroup Vel
     *  @brief   Return the dimension.
     *  @author  Michael Holst
     *  @note    Class Vel: Inlineable methods (vel.c) 
     *  @return  the dimension
     *  @param   thee  Pointer to class Vel
     */
    VEXTERNC unsigned int Vel_dim(Vel *thee);

    /** 
     *  @ingroup Vel
     *  @brief   Return the number of vertices in a simplex.  
     *  @author  Michael Holst
     *  @note    Class Vel: Inlineable methods (vel.c) 
     *  @return  the number of vertices in a simplex.  
     *  @param   thee  Pointer to class Vel
     */
    VEXTERNC unsigned int Vel_dimVV(Vel *thee);

    /** 
     *  @ingroup Vel
     *  @brief   Return the number of edges in a simplex.     
     *  @author  Michael Holst
     *  @note    Class Vel: Inlineable methods (vel.c) 
     *  @return  the number of edges in a simplex.     
     *  @param   thee  Pointer to class Vel
     */
    VEXTERNC unsigned int Vel_dimEE(Vel *thee);

    /** 
     *  @ingroup Vel
     *  @brief   Return the number of faces in a simplex.   
     *  @author  Michael Holst
     *  @note    Class Vel: Inlineable methods (vel.c) 
     *  @return  the number of faces in a simplex.     
     *  @param   thee  Pointer to class Vel
     */
    VEXTERNC unsigned int Vel_dimFF(Vel *thee);

    /** 
     *  @ingroup Vel
     *  @brief   Return the class
     *  @author  Michael Holst
     *  @note    Class Vel: Inlineable methods (vel.c) 
     *  @return  the class
     *  @param   thee  Pointer to class Vel
     */
    VEXTERNC unsigned int Vel_class(Vel *thee);

    /** 
     *  @ingroup Vel
     *  @brief   Return the type
     *  @author  Michael Holst
     *  @note    Class Vel: Inlineable methods (vel.c) 
     *  @return  the type
     *  @param   thee  Pointer to class Vel
     */
    VEXTERNC unsigned int Vel_type(Vel *thee);

    /** 
     *  @ingroup Vel
     *  @brief   Return the chart
     *  @author  Michael Holst
     *  @note    Class Vel: Inlineable methods (vel.c) 
     *  @return  the chart
     *  @param   thee  Pointer to class Vel
     */
    VEXTERNC unsigned int Vel_chart(Vel *thee);

    /** 
     *  @ingroup Vel
     *  @brief   Return the ID
     *  @author  Michael Holst
     *  @note    Class Vel: Inlineable methods (vel.c) 
     *  @return  the ID
     *  @param   thee  Pointer to class Vel
     */
    VEXTERNC unsigned int Vel_id(Vel *thee);
#else /* if defined(VINLINE_GEM) */
/** @brief   Initialize the element
 *  @ingroup Vel
 *  @brief   Initialize the element. 
 *  @author  Michael Holst
 *  @note    Class Vel: Inlineable methods (vel.c) if defined(VINLINE_GEM) 
 *  @return  None
 *  @param   thee  Pointer to class Vel
 *  @param   tdim  the dimension bits
 *  @param   tid   the ID bits
 */
#   define Vel_init(thee,tdim,tid) ( \
        (thee)->g.bits = MASK_00000000000000000000000000000000, \
        (thee)->g.uid  = MASK_00000000000000000000000000000000, \
        Vel_setDim((thee),(tdim)), \
        Vel_setId((thee),(tid)) \
    )

/** 
 *  @ingroup Vel
 *  @brief   Re-Initialize the element. 
 *  @author  Michael Holst
 *  @note    Class Vel: Inlineable methods (vel.c) if defined(VINLINE_GEM) 
 *  @return  None
 *  @param   thee  Pointer to class Vel
 */
#   define Vel_reinit(thee) ( \
        (thee)->g.bits &= MASK_11111111111111111100000000111111, \
        (thee)->g.uid  &= MASK_11111111111111111111111111111111 \
    )

/** 
 *  @ingroup Vel
 *  @brief   Set the reality bits.
 *  @author  Michael Holst
 *  @note    Class Vel: Inlineable methods (vel.c) if defined(VINLINE_GEM) 
 *  @return  None
 *  @param   thee  Pointer to class Vel
 *  @param   reel  the reality bits
 */
#   define Vel_setReality(thee,reel) ( \
        (thee)->g.bits &= MASK_11111111111111111111111111111100, \
        (thee)->g.bits |= (reel) \
    )

/** 
 *  @ingroup Vel
 *  @brief   Set the dimension bits.
 *  @author  Michael Holst
 *  @note    Class Vel: Inlineable methods (vel.c) if defined(VINLINE_GEM) 
 *  @return  None
 *  @param   thee  Pointer to class Vel
 *  @param   dim   the dimension bits
 */
#   define Vel_setDim(thee,dim) ( \
        (thee)->g.bits &= MASK_11111111111111111111111111110011, \
        (thee)->g.bits |= ((dim) << 2) \
    )

/** 
 *  @ingroup Vel
 *  @brief   Set the class bits.
 *  @author  Michael Holst
 *  @note    Class Vel: Inlineable methods (vel.c) if defined(VINLINE_GEM) 
 *  @return  None
 *  @param   thee  Pointer to class Vel
 *  @param   clas  the class bits
 */
#   define Vel_setClass(thee,clas) ( \
        (thee)->g.bits &= MASK_11111111111111111111111111001111, \
        (thee)->g.bits |= ((clas) << 4) \
    )

/** 
 *  @ingroup Vel
 *  @brief   Set the type bits.
 *  @author  Michael Holst
 *  @note    Class Vel: Inlineable methods (vel.c) if defined(VINLINE_GEM) 
 *  @return  None
 *  @param   thee  Pointer to class Vel
 *  @param   type  the type bits
 */
#   define Vel_setType(thee,type) ( \
        (thee)->g.bits &= MASK_11111111111111111100000000111111, \
        (thee)->g.bits |= ((type) << 6) \
    )

/** 
 *  @ingroup Vel
 *  @brief   Set the chart bits.
 *  @author  Michael Holst
 *  @note    Class Vel: Inlineable methods (vel.c) if defined(VINLINE_GEM) 
 *  @return  None
 *  @param   thee   Pointer to class Vel
 *  @param   chart  the chart bits
 */
#   define Vel_setChart(thee,chart) ( \
        (thee)->g.bits &= MASK_00000000000000000011111111111111, \
        (thee)->g.bits |= ((chart) << 14) \
    )

/** 
 *  @ingroup Vel
 *  @brief   Set the ID bits.
 *  @author  Michael Holst
 *  @note    Class Vel: Inlineable methods (vel.c) if defined(VINLINE_GEM) 
 *  @return  None
 *  @param   thee  Pointer to class Vel
 *  @param   id    the ID bits
 */
#   define Vel_setId(thee,id) ((thee)->g.uid = (id))

/** 
 *  @ingroup Vel
 *  @brief   Return the reality.
 *  @author  Michael Holst
 *  @note    Class Vel: Inlineable methods (vel.c) if defined(VINLINE_GEM) 
 *  @return  the reality
 *  @param   thee  Pointer to class Vel
 */
#   define Vel_reality(thee) ( \
        ((thee)->g.bits & MASK_00000000000000000000000000000011) \
    )

/** 
 *  @ingroup Vel
 *  @brief   Return the dimension.
 *  @author  Michael Holst
 *  @note    Class Vel: Inlineable methods (vel.c) if defined(VINLINE_GEM) 
 *  @return  the dimension
 *  @param   thee  Pointer to class Vel
 */
#   define Vel_dim(thee) ( \
        ((thee)->g.bits & MASK_00000000000000000000000000001100) >> 2 \
    )

/** 
 *  @ingroup Vel
 *  @brief   Return the number of vertices in a simplex.  
 *  @author  Michael Holst
 *  @note    Class Vel: Inlineable methods (vel.c) if defined(VINLINE_GEM) 
 *  @return  the number of vertices in a simplex.  
 *  @param   thee  Pointer to class Vel
 */
#   define Vel_dimVV(thee) ( \
        Vel_dim((thee))+1 \
    )

/** 
 *  @ingroup Vel
 *  @brief   Return the number of edges in a simplex.     
 *  @author  Michael Holst
 *  @note    Class Vel: Inlineable methods (vel.c) if defined(VINLINE_GEM) 
 *  @return  the number of edges in a simplex.     
 *  @param   thee  Pointer to class Vel
 */
#   define Vel_dimEE(thee) ( \
        3*(Vel_dim((thee))-1) \
    )

/** 
 *  @ingroup Vel
 *  @brief   Return the number of faces in a simplex.   
 *  @author  Michael Holst
 *  @note    Class Vel: Inlineable methods (vel.c) if defined(VINLINE_GEM) 
 *  @return  the number of faces in a simplex.     
 *  @param   thee  Pointer to class Vel
 */
#   define Vel_dimFF(thee) ( \
        Vel_dim((thee))+1 \
    )

/** 
 *  @ingroup Vel
 *  @brief   Return the class
 *  @author  Michael Holst
 *  @note    Class Vel: Inlineable methods (vel.c) if defined(VINLINE_GEM) 
 *  @return  the class
 *  @param   thee  Pointer to class Vel
 */
#   define Vel_class(thee) ( \
        ((thee)->g.bits & MASK_00000000000000000000000000110000) >> 4 \
    )

/** 
 *  @ingroup Vel
 *  @brief   Return the type
 *  @author  Michael Holst
 *  @note    Class Vel: Inlineable methods (vel.c) if defined(VINLINE_GEM) 
 *  @return  the type
 *  @param   thee  Pointer to class Vel
 */
#   define Vel_type(thee) ( \
        ((thee)->g.bits & MASK_00000000000000000011111111000000) >> 6 \
    )

/** 
 *  @ingroup Vel
 *  @brief   Return the chart
 *  @author  Michael Holst
 *  @note    Class Vel: Inlineable methods (vel.c) if defined(VINLINE_GEM) 
 *  @return  the chart
 *  @param   thee  Pointer to class Vel
 */
#   define Vel_chart(thee) ( \
        ((thee)->g.bits & MASK_11111111111111111100000000000000) >> 14 \
    )

/** 
 *  @ingroup Vel
 *  @brief   Return the ID
 *  @author  Michael Holst
 *  @note    Class Vel: Inlineable methods (vel.c) if defined(VINLINE_GEM) 
 *  @return  the ID
 *  @param   thee  Pointer to class Vel
 */
#   define Vel_id(thee) ((thee)->g.uid)
#endif /* if !defined(VINLINE_GEM) */


/**
 * @ingroup Vel
 * @brief   The Vel constructor.
 * @author  Michael Holst 
 * @note    Class Vel: Non-Inlineable methods (vel.c) 
 * @return  Pointer to a new allocated Vel class
 * @param   dim  the dimension bits
 * @param   id   the ID bits
 */
VEXTERNC Vel* Vel_ctor(int dim, int id);

/**
 * @ingroup Vel
 * @brief   The Vel destructor.
 * @author  Michael Holst 
 * @note    Class Vel: Non-Inlineable methods (vel.c) 
 * @return  None
 * @param   thee  Pointer to class Vel
 */
VEXTERNC void Vel_dtor(Vel **thee);

#endif /* _VEL_H_ */