1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 /****************************************************************************/
4 /*																			*/
5 /* File:	  initgm.c														*/
6 /*																			*/
7 /* Purpose:   call the init routines of the grid manager module                         */
8 /*																			*/
9 /* Author:	  Henrik Rentz-Reichert                                                                                 */
10 /*			  Institut fuer Computeranwendungen III                                                 */
11 /*			  Universitaet Stuttgart										*/
12 /*			  Pfaffenwaldring 27											*/
13 /*			  70569 Stuttgart												*/
14 /*			  email: ug@ica3.uni-stuttgart.de						        */
15 /*																			*/
16 /* History:   27.02.95 begin, ug version 3.0								*/
17 /*																			*/
18 /* Remarks:                                                                                                                             */
19 /*																			*/
20 /****************************************************************************/
21 
22 
23 /****************************************************************************/
24 /*																			*/
25 /* include files															*/
26 /*			  system include files											*/
27 /*			  application include files                                                                     */
28 /*																			*/
29 /****************************************************************************/
30 
31 /* ANSI-C includes */
32 #include <config.h>
33 #include <cstdio>
34 
35 /* low module */
36 #include <dune/uggrid/low/misc.h>
37 #include <dune/uggrid/low/ugstruct.h>
38 #include <dune/uggrid/low/ugtypes.h>
39 
40 /* gm module */
41 #include "gm.h"
42 #include "enrol.h"
43 #include "algebra.h"
44 #include "cw.h"
45 #include "ugm.h"
46 #include "ugio.h"
47 #include "elements.h"
48 #include "refine.h"
49 #include "rm.h"
50 
51 /* own header */
52 #include "initgm.h"
53 
54 
55 USING_UG_NAMESPACE
56 USING_UGDIM_NAMESPACE
57 
58 /****************************************************************************/
59 /*                                                                          */
60 /* definition of variables global to this source file only (static!)        */
61 /*                                                                          */
62 /****************************************************************************/
63 
64 /****************************************************************************/
65 /*
66    InitGm - Call the inits for the grid manger module
67 
68    SYNOPSIS:
69    INT InitGm ();
70 
71    PARAMETERS:
72    .  void
73 
74    DESCRIPTION:
75    This function calls the inits for the grid manger module.
76 
77    RETURN VALUE:
78    INT
79    .n     0 if ok
80    .n     1 if some error occured.
81  */
82 /****************************************************************************/
83 
InitGm()84 INT NS_DIM_PREFIX InitGm ()
85 {
86   INT err;
87 
88   /* cw.c */
89   if ((err=InitCW())!=0)
90   {
91     SetHiWrd(err,__LINE__);
92     return (err);
93   }
94 
95   /* elements.c */
96   if ((err=PreInitElementTypes())!=0)
97   {
98     SetHiWrd(err,__LINE__);
99     return (err);
100   }
101 
102 
103   /* enrol.c */
104   if ((err=InitEnrol())!=0)
105   {
106     SetHiWrd(err,__LINE__);
107     return (err);
108   }
109 
110   /* algebra.c */
111   if ((err=InitAlgebra())!=0)
112   {
113     SetHiWrd(err,__LINE__);
114     return (err);
115   }
116 
117   /* ugm.c */
118   if ((err=InitUGManager())!=0)
119   {
120     SetHiWrd(err,__LINE__);
121     return (err);
122   }
123 
124   /* ugio.c */
125   if ((err=InitUgio())!=0)
126   {
127     SetHiWrd(err,__LINE__);
128     return (err);
129   }
130 
131   /* rm.c */
132   if ((err=InitRuleManager())!=0)
133   {
134     SetHiWrd(err,__LINE__);
135     return (err);
136   }
137 
138   /* set config variables for the script */
139   if (SetStringValue("conf:dim",(DOUBLE)DIM))
140     return(__LINE__);
141 
142   return (0);
143 }
144 
145 
ExitGm()146 INT NS_DIM_PREFIX ExitGm()
147 {
148   INT err;
149 
150   /* ugm.c */
151   if ((err=ExitUGManager())!=0)
152   {
153     SetHiWrd(err,__LINE__);
154     return (err);
155   }
156 
157   return 0;
158 }
159