1 // GetDP - Copyright (C) 1997-2021 P. Dular and C. Geuzaine, University of Liege
2 //
3 // See the LICENSE.txt file for license information. Please report all
4 // issues on https://gitlab.onelab.info/getdp/getdp/issues.
5 
6 #include "ProData.h"
7 #include "Message.h"
8 
9 /* ------------------------------------------------------------------------ */
10 /*  B F _ E d g e _ 2                                                       */
11 /* ------------------------------------------------------------------------ */
12 
13 /* ------- */
14 /*  Edges  */
15 /* ------- */
16 
17 #define WrongNumEntity   Message::Error("Wrong Edge number in 'BF_Edge_2E'")
18 
BF_Edge_2E(struct Element * Element,int NumEntity,double u,double v,double w,double s[])19 void BF_Edge_2E(struct Element * Element, int NumEntity,
20 		double u, double v, double w,  double s[])
21 {
22   switch (Element->Type) {
23   case LINE   : case LINE_2 :
24   case LINE_3 : case LINE_4 :
25     switch(NumEntity) {
26     case 1  : s[0] = u  ; s[1] = 0. ; s[2] = 0. ; break ;
27     default : WrongNumEntity ;
28     }
29     break ;
30 
31   case TRIANGLE   : case TRIANGLE_2 :
32   case TRIANGLE_3 : case TRIANGLE_4 :
33     switch(NumEntity) {
34     case 1  : s[0] = -2.0*u+1.0-v ; s[1] = -u           ; s[2] = 0. ; break ;
35     case 2  : s[0] = -v           ; s[1] = -2.0*v+1.0-u ; s[2] = 0. ; break ;
36     case 3  : s[0] =  v           ; s[1] =  u           ; s[2] = 0. ; break ;
37     default : WrongNumEntity ;
38     }
39     break ;
40 
41   case QUADRANGLE   : case QUADRANGLE_2 : case QUADRANGLE_2_8N :
42   case QUADRANGLE_3 : case QUADRANGLE_4 :
43     switch(NumEntity) {
44     default : Message::Error("BF_Edge_2E not ready for QUADRANGLE");
45     }
46     break ;
47 
48   case TETRAHEDRON   : case TETRAHEDRON_2 :
49   case TETRAHEDRON_3 : case TETRAHEDRON_4 :
50     switch(NumEntity) {
51     case 1  : s[0] = -2.0*u+1.0-v-w ; s[1] = -u             ; s[2] = -u             ; break ;
52     case 2  : s[0] = -v             ; s[1] = -2.0*v+1.0-u-w ; s[2] = -v             ; break ;
53     case 3  : s[0] = -w             ; s[1] = -w             ; s[2] = -2.0*w+1.0-u-v ; break ;
54     case 4  : s[0] =  v             ; s[1] =  u             ; s[2] =  0.            ; break ;
55     case 5  : s[0] =  w             ; s[1] =  0.            ; s[2] =  u             ; break ;
56     case 6  : s[0] =  0.            ; s[1] =  w             ; s[2] =  v             ; break ;
57     default : WrongNumEntity ;
58     }
59     break ;
60 
61   case HEXAHEDRON   : case HEXAHEDRON_2 : case HEXAHEDRON_2_20N :
62   case HEXAHEDRON_3 : case HEXAHEDRON_4 :
63     switch(NumEntity) {
64     default : Message::Error("BF_Edge_2E not ready for HEXAHEDRON");
65     }
66     break ;
67 
68   case PRISM   : case PRISM_2 : case PRISM_2_15N :
69   case PRISM_3 : case PRISM_4 :
70     switch(NumEntity) {
71     default : Message::Error("BF_Edge_2E not ready for PRISM");
72     }
73     break ;
74 
75   case PYRAMID : case PYRAMID_2 : case PYRAMID_2_13N :
76   case PYRAMID_3 : // case PYRAMID_4
77     switch(NumEntity) {
78     default : Message::Error("BF_Edge_2E not ready for PYRAMID");
79     }
80     break ;
81 
82   default :
83     Message::Error("Unknown type of Element in BF_Edge_2E");
84     break ;
85   }
86 }
87 
88 #undef WrongNumEntity
89 
90 /* ------- */
91 /*  Faces  */
92 /* ------- */
93 
94 #define WrongNumEntity   Message::Error("Wrong Face number in 'BF_Edge_2F'")
95 
BF_Edge_2F(struct Element * Element,int NumEntity,double u,double v,double w,double s[])96 void BF_Edge_2F(struct Element * Element, int NumEntity,
97 		double u, double v, double w,  double s[])
98 {
99   Message::Error("You should never end up here!") ;
100 }
101 
102 #undef WrongNumEntity
103 
104 /* -------- */
105 /*  Volume  */
106 /* -------- */
107 
BF_Edge_2V(struct Element * Element,int NumEntity,double u,double v,double w,double s[])108 void BF_Edge_2V(struct Element * Element, int NumEntity,
109 		double u, double v, double w,  double s[])
110 {
111   Message::Error("You should never end up here!") ;
112 }
113 
114 /* ------------------------------------------------------------------------ */
115 /*  B F _ C u r l E d g e _ 2                                               */
116 /* ------------------------------------------------------------------------ */
117 
118 /* ------- */
119 /*  Edges  */
120 /* ------- */
121 
BF_CurlEdge_2E(struct Element * Element,int NumEntity,double u,double v,double w,double s[])122 void BF_CurlEdge_2E(struct Element * Element, int NumEntity,
123 		    double u, double v, double w,  double s[])
124 {
125   s[0] = 0. ; s[1] = 0. ; s[2] = 0. ;
126 }
127 
128 /* ------- */
129 /*  Faces  */
130 /* ------- */
131 
BF_CurlEdge_2F(struct Element * Element,int NumEntity,double u,double v,double w,double s[])132 void BF_CurlEdge_2F(struct Element * Element, int NumEntity,
133 		    double u, double v, double w,  double s[])
134 {
135   s[0] = 0. ; s[1] = 0. ; s[2] = 0. ;
136 }
137 
138 /* -------- */
139 /*  Volume  */
140 /* -------- */
141 
BF_CurlEdge_2V(struct Element * Element,int NumEntity,double u,double v,double w,double s[])142 void BF_CurlEdge_2V(struct Element * Element, int NumEntity,
143 		    double u, double v, double w,  double s[])
144 {
145   s[0] = 0. ; s[1] = 0. ; s[2] = 0. ;
146 }
147