1 /*--------------------------------------------------------------------------*/
2 /* ALBERTA: an Adaptive multi Level finite element toolbox using */
3 /* Bisectioning refinement and Error control by Residual */
4 /* Techniques for scientific Applications */
5 /* */
6 /* file: element_0d.c */
7 /* */
8 /* */
9 /* description: routines on elements that depend on the dimension in 1d */
10 /* */
11 /*--------------------------------------------------------------------------*/
12 /* */
13 /* authors: Alfred Schmidt */
14 /* Zentrum fuer Technomathematik */
15 /* Fachbereich 3 Mathematik/Informatik */
16 /* Universitaet Bremen */
17 /* Bibliothekstr. 2 */
18 /* D-28359 Bremen, Germany */
19 /* */
20 /* Kunibert G. Siebert */
21 /* Institut fuer Mathematik */
22 /* Universitaet Augsburg */
23 /* Universitaetsstr. 14 */
24 /* D-86159 Augsburg, Germany */
25 /* */
26 /* http://www.mathematik.uni-freiburg.de/IAM/ALBERTA */
27 /* */
28 /* (c) by A. Schmidt and K.G. Siebert (1996-2003) */
29 /* */
30 /*--------------------------------------------------------------------------*/
31
32 #ifdef HAVE_CONFIG_H
33 # include "config.h" /* probably a good idea to pull this one in here ... */
34 #endif
35
36 #include "alberta.h"
37
38 /****************************************************************************/
39 /* Some trivial 0d stuff. */
40 /****************************************************************************/
41
world_to_coord_0d(const EL_INFO * el_info,const REAL * x,REAL_B lambda)42 int world_to_coord_0d(const EL_INFO *el_info,
43 const REAL *x, REAL_B lambda)
44 {
45 FUNCNAME("world_to_coord_0d");
46 int i;
47
48 lambda[0] = 1.0;
49 for (i = 1; i < N_LAMBDA_MAX; i++) {
50 lambda[i] = 0.0;
51 }
52
53 return -1;
54 }
55
coord_to_world_0d(const EL_INFO * el_info,const REAL * l,REAL_D w)56 const REAL *coord_to_world_0d(const EL_INFO *el_info, const REAL *l, REAL_D w)
57 {
58 FUNCNAME("coord_to_world_0d");
59 static REAL world[DIM_OF_WORLD];
60 REAL *ret;
61 int i;
62
63 DEBUG_TEST_EXIT((el_info->fill_flag & FILL_COORDS) ||
64 !el_info->mesh->parametric ||
65 el_info->mesh->parametric->use_reference_mesh,
66 "You must enable the use_reference_mesh entry in the "
67 "PARAMETRIC structure to use this function on the "
68 "reference mesh. Use parametric->coord_to_world() "
69 "to access the parametric mesh\n");
70
71 ret = w ? w : world;
72
73 for(i = 0; i < DIM_OF_WORLD; i++)
74 ret[i] = el_info->coord[0][i];
75
76 return (const REAL *)ret;
77 }
78
el_grd_lambda_0d(const EL_INFO * el_info,REAL_BD grd_lam)79 REAL el_grd_lambda_0d(const EL_INFO *el_info, REAL_BD grd_lam)
80 {
81 SET_DOW(0.0, grd_lam[0]);
82
83 return 1.0;
84 }
85
el_det_0d(const EL_INFO * el_info)86 REAL el_det_0d(const EL_INFO *el_info)
87 {
88 return 1.0;
89 }
90
el_volume_0d(const EL_INFO * el_info)91 REAL el_volume_0d(const EL_INFO *el_info)
92 {
93 return 1.0;
94 }
95
get_wall_normal_0d(const EL_INFO * el_info,int i0,REAL_D normal)96 REAL get_wall_normal_0d(const EL_INFO *el_info, int i0, REAL_D normal)
97 {
98 FUNCNAME("get_face_normal_0d");
99
100 WARNING("Does not makes sense for dim == 0!\n");
101
102 return HUGE_VAL;
103 }
104
wall_orientation_0d(const EL * el,int wall)105 int wall_orientation_0d(const EL *el, int wall)
106 {
107 FUNCNAME("wall_orientation");
108
109 WARNING("Does not makes sense for dim == 0!\n");
110
111 return -1;
112 }
113
wall_rel_orientation_0d(const EL * el,const EL * neigh,int wall,int ov)114 int wall_rel_orientation_0d(const EL *el, const EL *neigh, int wall, int ov)
115 {
116 FUNCNAME("wall_orientation_rel_0d");
117
118 WARNING("Does not makes sense for dim == 0!\n");
119
120 return -1;
121 }
122
123