diff --git a/io/file/grapedataio.hh b/io/file/grapedataio.hh index 0ff2b137d158ac6b68c863ab16e43f18228d7058..09dfafd6e83ec8b7866ac5ea6e3e095c53370e8c 100644 --- a/io/file/grapedataio.hh +++ b/io/file/grapedataio.hh @@ -13,28 +13,28 @@ namespace Dune { /** \brief convert type to string */ template <typename T> - StringType typeIdentifier () + inline StringType typeIdentifier () { StringType tmp = "unknown"; return tmp; }; template <> - StringType typeIdentifier<float> () + inline StringType typeIdentifier<float> () { StringType tmp = "float"; return tmp; }; template <> - StringType typeIdentifier<int> () + inline StringType typeIdentifier<int> () { StringType tmp = "int"; return tmp; }; template <> - StringType typeIdentifier<double> () + inline StringType typeIdentifier<double> () { StringType tmp = "double"; return tmp; @@ -55,13 +55,13 @@ namespace Dune { * to actually write the grid, within this method the real file name is * generated out of filename and timestep */ - bool writeGrid (const GridType & grid, - const FileFormatType ftype, const char * fnprefix - , double time=0.0, int timestep=0, int precision = 6); + inline bool writeGrid (const GridType & grid, + const FileFormatType ftype, const char * fnprefix + , double time=0.0, int timestep=0, int precision = 6); //! get Grid from file with time and timestep , return true if ok - bool readGrid (GridType & grid, - const char * fnprefix , double & time , int timestep); + inline bool readGrid (GridType & grid, + const char * fnprefix , double & time , int timestep); /** @@ -71,19 +71,19 @@ namespace Dune { //! this method use the write method of the implementation of the //! discrete function template <class DiscreteFunctionType> - bool writeData(DiscreteFunctionType & df, - const FileFormatType ftype, const char *filename, - int timestep, int precision = 6); + inline bool writeData(DiscreteFunctionType & df, + const FileFormatType ftype, const char *filename, + int timestep, int precision = 6); //! same as write only read template <class DiscreteFunctionType> - bool readData(DiscreteFunctionType & df, - const char *filename, int timestep); + inline bool readData(DiscreteFunctionType & df, + const char *filename, int timestep); }; template <class GridType> - bool GrapeDataIO<GridType> :: writeGrid + inline bool GrapeDataIO<GridType> :: writeGrid (const GridType & grid, const FileFormatType ftype, const char * fnprefix , double time, int timestep, int precision ) @@ -113,7 +113,7 @@ namespace Dune { template <class GridType> - bool GrapeDataIO<GridType> :: readGrid + inline bool GrapeDataIO<GridType> :: readGrid (GridType & grid, const char * fnprefix , double & time , int timestep) { const char * fn; @@ -156,8 +156,8 @@ namespace Dune { template <class GridType> template <class DiscreteFunctionType> - bool GrapeDataIO<GridType> :: writeData(DiscreteFunctionType & df, - const FileFormatType ftype, const char *filename, int timestep, int precision ) + inline bool GrapeDataIO<GridType> :: writeData(DiscreteFunctionType & df, + const FileFormatType ftype, const char *filename, int timestep, int precision ) { { typedef typename DiscreteFunctionType::FunctionSpaceType DiscreteFunctionSpaceType; @@ -197,7 +197,7 @@ namespace Dune { template <class GridType> template <class DiscreteFunctionType> - bool GrapeDataIO<GridType> :: + inline bool GrapeDataIO<GridType> :: readData(DiscreteFunctionType & df, const char *filename, int timestep) { typedef typename DiscreteFunctionType::FunctionSpaceType DiscreteFunctionSpaceType; diff --git a/io/visual/grape/geldesc.hh b/io/visual/grape/geldesc.hh index 2c7f16ecf186768f863d8d0b578a93afac4783a0..38db8956f0a644b7e12c7bd489469581013ccde1 100644 --- a/io/visual/grape/geldesc.hh +++ b/io/visual/grape/geldesc.hh @@ -143,9 +143,9 @@ static VINHERIT vinherit_point_2 = {2,pindex_point_2,pweight_point_2}; ****************************************************************************** *****************************************************************************/ -static HELEMENT2D * triangle_neighbour(HELEMENT2D *el, int np, int flag, +inline static HELEMENT2D * triangle_neighbour(HELEMENT2D *el, int np, int flag, - double * coord, double * xyz, MESH_ELEMENT_FLAGS p) { + double * coord, double * xyz, MESH_ELEMENT_FLAGS p) { printf(" neighbour nicht implementiert \n"); @@ -153,7 +153,7 @@ static HELEMENT2D * triangle_neighbour(HELEMENT2D *el, int np, int flag, } -int triangle_boundary(HELEMENT2D * el, int np) { +inline int triangle_boundary(HELEMENT2D * el, int np) { printf(" boundary \n"); @@ -170,40 +170,40 @@ int triangle_boundary(HELEMENT2D * el, int np) { ***********************************************************************/ /* the 2d versions */ -int el_check_inside(HELEMENT2D * e, const double * coord) +inline int el_check_inside(HELEMENT2D * e, const double * coord) { DUNE_DAT * dat = (DUNE_DAT *) ((HMESH2D *) e->mesh)->user_data; return dat->check_inside((DUNE_ELEM *) e->user_data, coord); } -int world2coord(HELEMENT2D * e, const double * xyz,double * coord) +inline int world2coord(HELEMENT2D * e, const double * xyz,double * coord) { DUNE_DAT * dat = (DUNE_DAT *) ((HMESH2D *) e->mesh)->user_data; return dat->wtoc((DUNE_ELEM *) e->user_data, xyz, coord); } -void coord2world(HELEMENT2D * e, const double * coord,double * xyz) +inline void coord2world(HELEMENT2D * e, const double * coord,double * xyz) { DUNE_DAT * dat = (DUNE_DAT *) ((HMESH2D *) e->mesh)->user_data; dat->ctow((DUNE_ELEM *) e->user_data, coord, xyz); } /* the 3d versions */ -int el_check_inside_3d(HELEMENT3D * e, double * coord) +inline int el_check_inside_3d(HELEMENT3D * e, double * coord) { DUNE_DAT * dat = (DUNE_DAT *) ((HMESH3D *) e->mesh)->user_data; return dat->check_inside((DUNE_ELEM *) e->user_data, coord); } -static int world2coord_3d(HELEMENT3D * e, const double * xyz, - double * coord) +inline static int world2coord_3d(HELEMENT3D * e, const double * xyz, + double * coord) { DUNE_DAT * dat = (DUNE_DAT *) ((HMESH3D *) e->mesh)->user_data; return dat->wtoc((DUNE_ELEM *) e->user_data, xyz, coord); } -static void coord2world_3d(HELEMENT3D * e, const double * coord, - double * xyz) +inline static void coord2world_3d(HELEMENT3D * e, const double * coord, + double * xyz) { DUNE_DAT * dat = (DUNE_DAT *) ((HMESH3D *) e->mesh)->user_data; dat->ctow((DUNE_ELEM *) e->user_data, coord, xyz); @@ -302,9 +302,9 @@ static int *tetra_next_polygon_o[4] = {t_p0_o,t_p1_o,t_p2_o,t_p3_o}; ****************************************************************************** *****************************************************************************/ -static HELEMENT3D * tetra_neighbour(HELEMENT3D *el, int np, int flag, +inline static HELEMENT3D * tetra_neighbour(HELEMENT3D *el, int np, int flag, - double * coord, double * xyz, MESH_ELEMENT_FLAGS p) { + double * coord, double * xyz, MESH_ELEMENT_FLAGS p) { printf(" neighbour nicht implementiert \n"); @@ -312,7 +312,7 @@ static HELEMENT3D * tetra_neighbour(HELEMENT3D *el, int np, int flag, } -static int tetra_boundary(HELEMENT3D * el, int np) +inline static int tetra_boundary(HELEMENT3D * el, int np) { return ((DUNE_ELEM *)el->user_data)->bnd[np] ; } @@ -483,7 +483,7 @@ static int cube_world2coord(HELEMENT3D *cube, #endif /* fill the upper reference elements */ -void setupReferenceElements() +inline void setupReferenceElements() { /* fill the helement description in 2D*/ diff --git a/io/visual/grape/ghmesh.cc b/io/visual/grape/ghmesh.cc index 734c975a89692753b200458684a188e804850ffb..bbe13ebdbf08e167d46dc3a732529b0401cf056e 100644 --- a/io/visual/grape/ghmesh.cc +++ b/io/visual/grape/ghmesh.cc @@ -80,14 +80,14 @@ int switchMethods( GENMESHnD *actHmesh); //void setupLeafButton(MANAGER *mgr, void *sc, int yesTimeScene); /***************************************************************************/ -static void swapQuadrilateral( double ** vertex, double (* vp)[3]) +inline static void swapQuadrilateral( double ** vertex, double (* vp)[3]) { vertex[2] = vp[3]; vertex[3] = vp[2]; } #if GRAPE_DIM == 3 -static void swapHexahedron( double ** vertex, DUNE_ELEM * el) +inline static void swapHexahedron( double ** vertex, DUNE_ELEM * el) { swapQuadrilateral(vertex,el->vpointer); @@ -103,7 +103,7 @@ static void swapHexahedron( double ** vertex, DUNE_ELEM * el) ** ** ****************************************************************************** *****************************************************************************/ -static HELEMENT *get_stackentry() +inline static HELEMENT *get_stackentry() { STACKENTRY *stel; DUNE_ELEM * elem; @@ -123,14 +123,14 @@ static HELEMENT *get_stackentry() } -static void free_stackentry(HELEMENT *stel) +inline static void free_stackentry(HELEMENT *stel) { ((STACKENTRY *)stel)->next = stackfree ; stackfree = (STACKENTRY*)stel; } -static void gFreeElement(ELEMENT *el) +inline static void gFreeElement(ELEMENT *el) { if (el) { @@ -142,7 +142,7 @@ static void gFreeElement(ELEMENT *el) /***************************************************************************** * little help routines *****************************************************************************/ -static double dist(const double *x, const double *y) +inline static double dist(const double *x, const double *y) { double dist=0.0; int i; @@ -154,7 +154,7 @@ static double dist(const double *x, const double *y) return (sqrt(dist)); } -static double calc_hmax(HELEMENT *el) +inline static double calc_hmax(HELEMENT *el) { return ( dist(el->vertex[0], el->vertex[1]) ); } @@ -167,7 +167,7 @@ static double calc_hmax(HELEMENT *el) ** ****************************************************************************** *****************************************************************************/ -static void helementUpdate( DUNE_ELEM *elem, HELEMENT *grapeEl ) +inline static void helementUpdate( DUNE_ELEM *elem, HELEMENT *grapeEl ) { grapeEl->vindex = elem->vindex ; grapeEl->eindex = elem->eindex ; @@ -176,7 +176,7 @@ static void helementUpdate( DUNE_ELEM *elem, HELEMENT *grapeEl ) grapeEl->user_data = (void *)elem ; } -static HELEMENT * first_macro (GENMESHnD *mesh, MESH_ELEMENT_FLAGS flag) +inline static HELEMENT * first_macro (GENMESHnD *mesh, MESH_ELEMENT_FLAGS flag) { int i ; HELEMENT * el = get_stackentry(); @@ -263,7 +263,7 @@ static HELEMENT * first_macro (GENMESHnD *mesh, MESH_ELEMENT_FLAGS flag) } /* go next macro element */ -static HELEMENT * next_macro(HELEMENT * el, MESH_ELEMENT_FLAGS flag) +inline static HELEMENT * next_macro(HELEMENT * el, MESH_ELEMENT_FLAGS flag) { int mflag=0; assert(el) ; @@ -286,7 +286,7 @@ static HELEMENT * next_macro(HELEMENT * el, MESH_ELEMENT_FLAGS flag) /***********************************************************/ /* first_child, go to first child of current element */ /************************************************************/ -static HELEMENT * first_child (HELEMENT * ael, MESH_ELEMENT_FLAGS flag) +inline static HELEMENT * first_child (HELEMENT * ael, MESH_ELEMENT_FLAGS flag) { HELEMENT * el; DUNE_ELEM * elem; @@ -371,7 +371,7 @@ static HELEMENT * first_child (HELEMENT * ael, MESH_ELEMENT_FLAGS flag) } /* go to next child of the current element */ -static HELEMENT * next_child(HELEMENT * el, MESH_ELEMENT_FLAGS flag) +inline static HELEMENT * next_child(HELEMENT * el, MESH_ELEMENT_FLAGS flag) { assert(el) ; el->present = (MESH_ELEMENT_FLAGS) (hefAll & !hefVinh); @@ -393,14 +393,14 @@ static HELEMENT * next_child(HELEMENT * el, MESH_ELEMENT_FLAGS flag) } /* fake that no children exixst */ -static HELEMENT * fake_child (HELEMENT * ael, MESH_ELEMENT_FLAGS flag) +inline static HELEMENT * fake_child (HELEMENT * ael, MESH_ELEMENT_FLAGS flag) { return NULL; } /* first_child, go to first child of current element */ -static HELEMENT * select_child (HELEMENT * ael, double *parent_coord, - double *child_coord, MESH_ELEMENT_FLAGS flag) +inline static HELEMENT * select_child (HELEMENT * ael, double *parent_coord, + double *child_coord, MESH_ELEMENT_FLAGS flag) { HELEMENT *child = NULL; HMESH *mesh = (HMESH *) ael->mesh; @@ -434,13 +434,13 @@ static HELEMENT * select_child (HELEMENT * ael, double *parent_coord, return NULL; } -static ELEMENT * first_element (GRAPEMESH *mesh, MESH_ELEMENT_FLAGS flag) +inline static ELEMENT * first_element (GRAPEMESH *mesh, MESH_ELEMENT_FLAGS flag) { return first_macro((GENMESHnD * )mesh,flag); } /* go next macro element */ -static ELEMENT * next_element(ELEMENT * el, MESH_ELEMENT_FLAGS flag) +inline static ELEMENT * next_element(ELEMENT * el, MESH_ELEMENT_FLAGS flag) { return next_macro(el,flag); } @@ -449,16 +449,16 @@ static ELEMENT * next_element(ELEMENT * el, MESH_ELEMENT_FLAGS flag) * f_data function * ***************************************************************************/ -void f_bounds(HELEMENT *el, double* min, double* max, - void *function_data) +inline void f_bounds(HELEMENT *el, double* min, double* max, + void *function_data) { (*min) = 1.0E+308; (*max) = -1.0E+308; return; } /****************************************************************************/ -void grape_get_vertex_estimate(HELEMENT *el, double *value, - void *function_data) +inline void grape_get_vertex_estimate(HELEMENT *el, double *value, + void *function_data) { *value = 1.0E+308; return; @@ -466,14 +466,14 @@ void grape_get_vertex_estimate(HELEMENT *el, double *value, /****************************************************************************/ -double grape_get_element_estimate(HELEMENT *el, void *function_data) +inline double grape_get_element_estimate(HELEMENT *el, void *function_data) { return 1.0E+308; } /***************************************************************************/ -void f_real_el_info(HELEMENT *el, F_EL_INFO *f_el_info, - void *function_data) +inline void f_real_el_info(HELEMENT *el, F_EL_INFO *f_el_info, + void *function_data) { f_el_info->polynomial_degree = ((DUNE_FDATA *) function_data)->polyOrd; return; @@ -482,14 +482,14 @@ void f_real_el_info(HELEMENT *el, F_EL_INFO *f_el_info, /***************************************************************************/ /* print DUNE_FUNC STRUCT */ -void printfFdata(DUNE_FUNC *df) +inline void printfFdata(DUNE_FUNC *df) { DUNE_FDATA *fem = df->all; printf("Dune Func %p | Dune Fdata %p \n",df,fem); printf("comp %d | DiscFunc %p \n",fem->component,fem->discFunc); printf("-------------------------------------------\n"); } -void printDuneFunc(DUNE_FDATA *df) +inline void printDuneFunc(DUNE_FDATA *df) { printf("DUNE_FDATA %p \n",df); printf("discFunc %p \n",df->discFunc); @@ -498,8 +498,8 @@ void printDuneFunc(DUNE_FDATA *df) } -void f_real(HELEMENT *el, int ind, double G_CONST *coord, - double *val, void *function_data) +inline void f_real(HELEMENT *el, int ind, double G_CONST *coord, + double *val, void *function_data) { assert(el); DUNE_ELEM * elem = (DUNE_ELEM *)el->user_data; @@ -520,7 +520,7 @@ void f_real(HELEMENT *el, int ind, double G_CONST *coord, } /***************************************************************************/ -void grapeInitScalarData(GRAPEMESH *grape_mesh, DUNE_FUNC * dfunc) +inline void grapeInitScalarData(GRAPEMESH *grape_mesh, DUNE_FUNC * dfunc) { F_DATA *f_data = NULL; char * name = NULL; @@ -600,7 +600,7 @@ void grapeInitScalarData(GRAPEMESH *grape_mesh, DUNE_FUNC * dfunc) ****************************************************************************** *****************************************************************************/ -static ELEMENT * copy_element(ELEMENT *el, MESH_ELEMENT_FLAGS flag) +inline static ELEMENT * copy_element(ELEMENT *el, MESH_ELEMENT_FLAGS flag) { HELEMENT * cel = get_stackentry(); @@ -625,7 +625,7 @@ static ELEMENT * copy_element(ELEMENT *el, MESH_ELEMENT_FLAGS flag) return ( (ELEMENT *)cel ); } -static void get_geometry_vertex_estimate(HELEMENT* helement, double* results) +inline static void get_geometry_vertex_estimate(HELEMENT* helement, double* results) { /* planar mesh -> all geometry-estimates 0*/ int i; @@ -635,14 +635,14 @@ static void get_geometry_vertex_estimate(HELEMENT* helement, double* results) } -static double get_geometry_element_estimate(HELEMENT* helement) +inline static double get_geometry_element_estimate(HELEMENT* helement) { /*planar mesh -> estimators 0*/ return(1e5); } /* method to get partition number from mesh */ -HMESH * get_partition_number (int * partition) +inline HMESH * get_partition_number (int * partition) { HMESH * hmesh = (HMESH *) START_METHOD (G_INSTANCE); assert(hmesh != 0); @@ -661,16 +661,16 @@ HMESH * get_partition_number (int * partition) ** ****************************************************************************** *****************************************************************************/ -void * hmesh(int (* const f_leaf) (DUNE_ELEM *), int (* const n_leaf) (DUNE_ELEM *), - int (* const f_mac) (DUNE_ELEM *), int (* const n_mac) (DUNE_ELEM *), - int (* const f_chi) (DUNE_ELEM *), int (* const n_chi) (DUNE_ELEM *), - void * (* const cp)(const void *), - int (* const check_inside) (DUNE_ELEM *, const double *), - int (* const wtoc) (DUNE_ELEM *, const double *, double *), - void (* const ctow) (DUNE_ELEM *, const double *, double *), - void (* const func_real) (DUNE_ELEM *, DUNE_FDATA*, int ind, const double *, double *), - const int noe, const int nov, const int maxlev, int partition, - DUNE_ELEM *he , DUNE_FDATA * fe) +inline void * hmesh(int (* const f_leaf) (DUNE_ELEM *), int (* const n_leaf) (DUNE_ELEM *), + int (* const f_mac) (DUNE_ELEM *), int (* const n_mac) (DUNE_ELEM *), + int (* const f_chi) (DUNE_ELEM *), int (* const n_chi) (DUNE_ELEM *), + void * (* const cp)(const void *), + int (* const check_inside) (DUNE_ELEM *, const double *), + int (* const wtoc) (DUNE_ELEM *, const double *, double *), + void (* const ctow) (DUNE_ELEM *, const double *, double *), + void (* const func_real) (DUNE_ELEM *, DUNE_FDATA*, int ind, const double *, double *), + const int noe, const int nov, const int maxlev, int partition, + DUNE_ELEM *he , DUNE_FDATA * fe) { DUNE_DAT *dune = (DUNE_DAT *) malloc(sizeof(DUNE_DAT)); assert(dune != NULL); @@ -758,7 +758,7 @@ void * hmesh(int (* const f_leaf) (DUNE_ELEM *), int (* const n_leaf) (DUNE_ELEM /* forward declaration */ static void grape_add_remove_methods(void); -void handleMesh(void *hmesh) +inline void handleMesh(void *hmesh) { GRAPEMESH *mesh = (GRAPEMESH *) hmesh; assert(mesh != NULL); @@ -794,8 +794,8 @@ void handleMesh(void *hmesh) } /* setup TimeScene Tree */ -void addDataToHmesh(void *hmesh, DUNE_FDATA * fe, - void (* const func_real) (DUNE_ELEM *, DUNE_FDATA*, int ind, const double *, double *) ) +inline void addDataToHmesh(void *hmesh, DUNE_FDATA * fe, + void (* const func_real) (DUNE_ELEM *, DUNE_FDATA*, int ind, const double *, double *) ) { GRAPEMESH *mesh = (GRAPEMESH *) hmesh; assert(mesh != NULL); @@ -823,7 +823,7 @@ void addDataToHmesh(void *hmesh, DUNE_FDATA * fe, /* * setup TimeScene Tree */ -void addHmeshToTimeScene(void * timescene, double time, void *hmesh, int proc) +inline void addHmeshToTimeScene(void * timescene, double time, void *hmesh, int proc) { TIMESCENE *tsc = (TIMESCENE *) timescene; GRAPEMESH *mesh = (GRAPEMESH *) hmesh; @@ -846,7 +846,7 @@ void addHmeshToTimeScene(void * timescene, double time, void *hmesh, int proc) return; } -DUNE_FDATA * extractData ( void * hmesh , int num ) +inline DUNE_FDATA * extractData ( void * hmesh , int num ) { HMESH *mesh = (HMESH *) hmesh; int count = 0; @@ -873,7 +873,7 @@ DUNE_FDATA * extractData ( void * hmesh , int num ) /* copy function data */ -void copyFdata(F_DATA *copy, F_DATA *org) +inline void copyFdata(F_DATA *copy, F_DATA *org) { copy->name = org->name; copy->last = org->last; @@ -899,8 +899,8 @@ void copyFdata(F_DATA *copy, F_DATA *org) } /* interpol method for timescence, just constant interpolation */ -static GRAPEMESH *grape_mesh_interpol(GRAPEMESH *mesh1, GRAPEMESH *mesh2, - double factor) +inline static GRAPEMESH *grape_mesh_interpol(GRAPEMESH *mesh1, GRAPEMESH *mesh2, + double factor) { GRAPEMESH *self=NULL; GRAPEMESH *newMesh =NULL; @@ -1017,7 +1017,7 @@ static GRAPEMESH *grape_mesh_interpol(GRAPEMESH *mesh1, GRAPEMESH *mesh2, /* handling of multiple functions (selection by next/last) */ /****************************************************************************/ -static HMESH *next_f_data_send(void) +inline static HMESH *next_f_data_send(void) { HMESH *self; printf("next_f_data_send called! \n"); @@ -1036,7 +1036,7 @@ static HMESH *next_f_data_send(void) END_METHOD(self); } -static HMESH *prev_f_data_send(void) +inline static HMESH *prev_f_data_send(void) { HMESH *self; printf("prev_f_data_send called! \n"); @@ -1055,7 +1055,7 @@ static HMESH *prev_f_data_send(void) END_METHOD(self); } -SCENE* scene_leaf_button_on_off () +inline SCENE* scene_leaf_button_on_off () { SCENE* sc = (SCENE*) START_METHOD (G_INSTANCE); ALERT (sc, "level-button-on-off: No hmesh!", END_METHOD(NULL)); @@ -1074,7 +1074,7 @@ SCENE* scene_leaf_button_on_off () END_METHOD (sc); } -SCENE* scene_maxlevel_on_off () +inline SCENE* scene_maxlevel_on_off () { SCENE* sc = (SCENE*) START_METHOD (G_INSTANCE); ALERT( sc, "maxlevel-on-off: No hmesh!", END_METHOD(NULL)); @@ -1101,7 +1101,7 @@ GENMESH3D * genmesh3d_switch_iterateLeafs_on_off(); static int calledAddMethods = 0; /* add some usefull methods */ -static void grape_add_remove_methods(void) +inline static void grape_add_remove_methods(void) { if(!calledAddMethods) { @@ -1141,7 +1141,7 @@ static void grape_add_remove_methods(void) } /* switch methods from LevelIterator to LeafIterator */ -int switchMethods(GENMESHnD *actHmesh) +inline int switchMethods(GENMESHnD *actHmesh) { DUNE_DAT * dune = (DUNE_DAT *) actHmesh->user_data; GENMESH_FDATA *fd = NULL; @@ -1184,7 +1184,7 @@ int switchMethods(GENMESHnD *actHmesh) /* action function for the levelButton */ /* switch button on or off */ -GENMESH3D * genmesh3d_switch_iterateLeafs_on_off() +inline GENMESH3D * genmesh3d_switch_iterateLeafs_on_off() { GENMESH3D * self = (GENMESH3D *) START_METHOD(G_INSTANCE); assert(self!=NULL); diff --git a/io/visual/grape/grapecommon.cc b/io/visual/grape/grapecommon.cc index d25ede1684eaf677a1a11c4a96d7875cfe3a43f5..3ca9fbc6edafe244e1181f88356a0a770460aad8 100644 --- a/io/visual/grape/grapecommon.cc +++ b/io/visual/grape/grapecommon.cc @@ -9,7 +9,7 @@ #include "grapecommon.hh" /* add Button which can switch between LevelIteration and LeafIteration */ -void setupLeafButton(MANAGER *mgr, void *sc, int yesTimeScene) +inline void setupLeafButton(MANAGER *mgr, void *sc, int yesTimeScene) { assert(!leafButton); assert(!maxlevelButton); @@ -42,16 +42,10 @@ void setupLeafButton(MANAGER *mgr, void *sc, int yesTimeScene) } -void timeSceneInit(INFO *info, int n_info, int procs, int time_bar) +inline void timeSceneInit(INFO *info, int n_info, int procs, int time_bar) { int n,p; int numProcs = (procs <= 1) ? 1 : (procs-1); -#ifdef TIMEBAR - void def_timebar_methods(void); - - if (time_bar) - def_timebar_methods(); -#endif for (n = 0; n < MAXIMUM(1, n_info); n++) { @@ -87,7 +81,7 @@ void timeSceneInit(INFO *info, int n_info, int procs, int time_bar) } /* call handle for a bunch of timescenes */ -void displayTimeScene(INFO * info, int numberOfProcs ) +inline void displayTimeScene(INFO * info, int numberOfProcs ) { TIMESCENE *tsc = (TIMESCENE *) info[0].tsc; if(tsc) @@ -116,16 +110,6 @@ void displayTimeScene(INFO * info, int numberOfProcs ) } } -#ifdef TIMEBAR -void tsc_timebar(void *timescene, double t_start, double t_end) -{ - TIMESCENE *tsc = (TIMESCENE *) timescene; - GRAPE(tsc,"timebar-v") (t_start, t_end); -} - -#include "tsc_timebar.c" -#endif - #undef MINIMUM #undef MAXIMUM diff --git a/io/visual/grape/grapedatadisplay.cc b/io/visual/grape/grapedatadisplay.cc index fe14dfffb1e941702b3bb9969043acfb67adcfc5..c475d35ae9f119854fad6223c0a651c87ebbdfaf 100644 --- a/io/visual/grape/grapedatadisplay.cc +++ b/io/visual/grape/grapedatadisplay.cc @@ -279,7 +279,7 @@ namespace Dune } template<class GridType, class DiscFuncType> - void GrapeDataDisplay<GridType,DiscFuncType>::dataDisplay(DiscFuncType &func) + inline void GrapeDataDisplay<GridType,DiscFuncType>::dataDisplay(DiscFuncType &func) { /* add function data */ this->addData(func,"myFunc",0.0); @@ -290,7 +290,7 @@ namespace Dune template<class GridType, class DiscFuncType> - void GrapeDataDisplay<GridType,DiscFuncType>:: + inline void GrapeDataDisplay<GridType,DiscFuncType>:: addData(DiscFuncType &func , const char *name , double time ) { typedef typename DiscFuncType::LocalFunctionType LocalFuncType; diff --git a/io/visual/grape/grapegriddisplay.cc b/io/visual/grape/grapegriddisplay.cc index 38e9cc7ec959381b6b10b0ccf6dff961f0d103cb..9d656eba8cebead02c6edf4dd9f8713e9bbe81a1 100644 --- a/io/visual/grape/grapegriddisplay.cc +++ b/io/visual/grape/grapegriddisplay.cc @@ -513,7 +513,7 @@ namespace Dune } template<class GridType> - void GrapeGridDisplay<GridType>::display() + inline void GrapeGridDisplay<GridType>::display() { /* call handle mesh in g_hmesh.c */ GrapeInterface<dim,dimworld>::handleMesh ( hmesh_ ); @@ -521,20 +521,27 @@ namespace Dune } template<class GridType> - void * GrapeGridDisplay<GridType>::getHmesh() + inline void * GrapeGridDisplay<GridType>::getHmesh() { if(!hmesh_) hmesh_ = setupHmesh(); return (void *) hmesh_; } template<class GridType> - GridType & GrapeGridDisplay<GridType>::getGrid() + inline void GrapeGridDisplay<GridType>:: + addMyMeshToTimeScene(void * timescene, double time, int proc) + { + GrapeInterface<dim,dimworld>::addHmeshToTimeScene(timescene,time,this->getHmesh(),proc); + } + + template<class GridType> + inline GridType & GrapeGridDisplay<GridType>::getGrid() { return grid_; } template<class GridType> - void * GrapeGridDisplay<GridType>::setupHmesh() + inline void * GrapeGridDisplay<GridType>::setupHmesh() { int noe, nov; int maxlevel; diff --git a/io/visual/grape/grapeinclude.hh b/io/visual/grape/grapeinclude.hh index f4c6cf8990f5a7c387740a20545d1d417a0be29d..f13a14f6321153abe746e1720b9e7b03b299aebd 100644 --- a/io/visual/grape/grapeinclude.hh +++ b/io/visual/grape/grapeinclude.hh @@ -45,23 +45,23 @@ namespace Dune typedef GrapeInterface_two_two::DUNE_ELEM DUNE_ELEM; typedef GrapeInterface_two_two::DUNE_FDATA DUNE_FDATA; - static void init() + inline static void init() { GrapeInterface_two_two::grape_add_remove_methods(); } - static void handleMesh (void *hmesh) + inline static void handleMesh (void *hmesh) { GrapeInterface_two_two::handleMesh(hmesh); } - static void addDataToHmesh(void *hmesh, DUNE_FDATA * fe, - void (* const func_real) (DUNE_ELEM *, DUNE_FDATA*, int ind, const - double *, double *) ) + inline static void addDataToHmesh(void *hmesh, DUNE_FDATA * fe, + void (* const func_real) (DUNE_ELEM *, DUNE_FDATA*, int ind, const + double *, double *) ) { GrapeInterface_two_two::addDataToHmesh(hmesh,fe,func_real); } - static void *hmesh( + inline static void *hmesh( int (* const f_leaf) (DUNE_ELEM *), int (* const n_leaf) (DUNE_ELEM *), int (* const f_mac) (DUNE_ELEM *), int (* const n_mac) (DUNE_ELEM *), int (* const f_chi) (DUNE_ELEM *), int (* const n_chi) (DUNE_ELEM *), @@ -77,7 +77,7 @@ namespace Dune cp,check_inside,wtoc,ctow,func_real,noe,nov,maxlev,partition,he,fe); } - static void addHmeshToTimeScene(void * timescene, double time, void *hmesh , int proc) + inline static void addHmeshToTimeScene(void * timescene, double time, void *hmesh , int proc) { GrapeInterface_two_two::addHmeshToTimeScene(timescene,time,hmesh,proc); } @@ -128,7 +128,7 @@ namespace Dune typedef GrapeInterface_three_three::DUNE_ELEM DUNE_ELEM; typedef GrapeInterface_three_three::DUNE_FDATA DUNE_FDATA; - static void init() + inline static void init() { GrapeInterface_three_three::initPartitionDisp(2); GrapeInterface_three_three::grape_add_remove_methods(); @@ -136,18 +136,18 @@ namespace Dune //GrapeInterface_two_two::setupLeafButton(mgr,tsc,1); } - static void handleMesh (void *hmesh) + inline static void handleMesh (void *hmesh) { GrapeInterface_three_three::handleMesh(hmesh); } - static void addDataToHmesh(void *hmesh, DUNE_FDATA * fe, - void (* const func_real) (DUNE_ELEM *, DUNE_FDATA*, int ind, const - double *, double *) ) + inline static void addDataToHmesh(void *hmesh, DUNE_FDATA * fe, + void (* const func_real) (DUNE_ELEM *, DUNE_FDATA*, int ind, const + double *, double *) ) { GrapeInterface_three_three::addDataToHmesh(hmesh,fe,func_real); } - static void *hmesh( + inline static void *hmesh( int (* const f_leaf) (DUNE_ELEM *), int (* const n_leaf) (DUNE_ELEM *), int (* const f_mac) (DUNE_ELEM *), int (* const n_mac) (DUNE_ELEM *), int (* const f_chi) (DUNE_ELEM *), int (* const n_chi) (DUNE_ELEM *), @@ -163,7 +163,7 @@ namespace Dune cp,check_inside,wtoc,ctow,func_real,noe,nov,maxlev,partition,he,fe); } - static void addHmeshToTimeScene(void * timescene, double time, void *hmesh , int proc) + inline static void addHmeshToTimeScene(void * timescene, double time, void *hmesh , int proc) { GrapeInterface_two_two::addHmeshToTimeScene(timescene,time,hmesh,proc); } diff --git a/io/visual/grape/partitiondisplay.cc b/io/visual/grape/partitiondisplay.cc index f1d3766cae31026f7de2b1f5f1fa3afcb285c363..d3ce75e5961dd8b5e82a607de8be82a52477ab1a 100644 --- a/io/visual/grape/partitiondisplay.cc +++ b/io/visual/grape/partitiondisplay.cc @@ -42,12 +42,12 @@ static int last_partition; /* true wenn wir auf der letzten partition arbeiten static int max_partition = 1; /* max number of partitions */ static int thread = 0; /* actual partition number */ -SUPROP_DEV suprop; +static SUPROP_DEV suprop; /* ------------------------------------------------------------------ */ -GENMESHnD* genmesh3d_switch_part_light_model_on_off () +inline GENMESHnD* genmesh3d_switch_part_light_model_on_off () { GENMESHnD* hmesh = (GENMESHnD*) START_METHOD (G_INSTANCE); ALERT (hmesh, "genmesh3d-switch-part-light-model-on-off: No hmesh!", END_METHOD(NULL)); @@ -62,7 +62,7 @@ GENMESHnD* genmesh3d_switch_part_light_model_on_off () END_METHOD (hmesh); } -GENMESHnD* genmesh3d_switch_part_diagnostic_on_off () +inline GENMESHnD* genmesh3d_switch_part_diagnostic_on_off () { GENMESHnD* hmesh = (GENMESHnD*) START_METHOD (G_INSTANCE); ALERT (hmesh, "genmesh3d-switch-part-diagnostic-on-off: No hmesh!", END_METHOD(NULL)); @@ -76,7 +76,7 @@ GENMESHnD* genmesh3d_switch_part_diagnostic_on_off () END_METHOD (hmesh); } -GENMESHnD* genmesh3d_switch_part_displaybar_on_off () +inline GENMESHnD* genmesh3d_switch_part_displaybar_on_off () { GENMESHnD* hmesh = (GENMESHnD*) START_METHOD (G_INSTANCE); ALERT (hmesh, "genmesh3d-switch-part-displaybar-on-off: No hmesh!", END_METHOD(NULL)); @@ -91,17 +91,17 @@ GENMESHnD* genmesh3d_switch_part_displaybar_on_off () } static int * globalNumberOfElements = 0 ; -double globalTime = 0.0; -double minmax[15][2] = {{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1}, - {0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1}}; -double ymin=-1.0; -double ymax=1.0; -int norm_data = 1; -int show_sc1_item = 0; -int show_sc2_item = 0; -int linear_item = 0; -int which_part_sc1_trans = -1; -int which_part_sc2_trans = -1; +static double globalTime = 0.0; +static double minmax[15][2] = {{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1}, + {0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1}}; +static double ymin=-1.0; +static double ymax=1.0; +static int norm_data = 1; +static int show_sc1_item = 0; +static int show_sc2_item = 0; +static int linear_item = 0; +static int which_part_sc1_trans = -1; +static int which_part_sc2_trans = -1; static double maxnoElements = 8000000; static double maxTime = 200; @@ -126,7 +126,7 @@ static int initColorBarDone = 0; static void set_colors (int currProcs); -static void get_graphicdevice() +inline static void get_graphicdevice() { dev = (GRAPHICDEVICE *)GRAPE(GraphicDevice,"get-stddev") (); @@ -141,7 +141,7 @@ static void get_graphicdevice() } -void initColorBarDisp() +inline void initColorBarDisp() { int i ; assert (max_partition >= 0) ; @@ -156,7 +156,7 @@ void initColorBarDisp() } -static void colorbar_display(int nProcs) +inline static void colorbar_display(int nProcs) { int i, light_model, off = OFF,totalnoElements; VEC3 xyz, xyz_g, back_color = { 0.3, 0.3, 0.3 }; @@ -267,7 +267,7 @@ static void colorbar_display(int nProcs) return; } -static void hsv_to_rgb (VEC3 rgb, VEC3 hsv) +inline static void hsv_to_rgb (VEC3 rgb, VEC3 hsv) { double h, s, v, f, p, q, t; int i; @@ -317,7 +317,7 @@ static void hsv_to_rgb (VEC3 rgb, VEC3 hsv) } /* set partition colors */ -static void set_colors (int currProcs) +inline static void set_colors (int currProcs) { /* for( i=0; i<max_partition+1; ++i ) @@ -362,7 +362,7 @@ GENMESHnD* genmesh3d_partition_disp (); static int initialized = 0; /* init max_partition and declare partition methods */ -void initPartitionDisp (int mp) +inline void initPartitionDisp (int mp) { if(!initialized) { @@ -380,7 +380,7 @@ void initPartitionDisp (int mp) } } -GENMESHnD* genmesh3d_partition_disp () +inline GENMESHnD* genmesh3d_partition_disp () { MANAGER* mgr; GRAPHICDEVICE* dev; @@ -537,8 +537,8 @@ GENMESHnD* genmesh3d_partition_disp () END_METHOD (hmesh); } -static int hm3_partition_draw_element (HELEMENT3D* helement, - HM3_GENERAL* general, void* el_data, void* action_arg) +inline static int hm3_partition_draw_element (HELEMENT3D* helement, + HM3_GENERAL* general, void* el_data, void* action_arg) { GRAPHICDEVICE* dev = general->dev; HELEMENT3D_DESCRIPTION* descr = (HELEMENT3D_DESCRIPTION*) helement->descr; @@ -633,10 +633,10 @@ static int hm3_partition_draw_element (HELEMENT3D* helement, } -int hm3_simpl_projection (HELEMENT3D* helement, - HM3_GENERAL* general, - void* el_data, - void* pa_data) +inline int hm3_simpl_projection (HELEMENT3D* helement, + HM3_GENERAL* general, + void* el_data, + void* pa_data) { HM3_COORD_DATA* element_data = (HM3_COORD_DATA*)el_data; HM3_COORD_DATA* parent_data = (HM3_COORD_DATA*)pa_data; @@ -664,9 +664,9 @@ int hm3_simpl_projection (HELEMENT3D* helement, return TRUE; } -int hm3_simpl_test_if_proceed (HELEMENT3D* helement, - HM3_GENERAL* general, - void* el_data) +inline int hm3_simpl_test_if_proceed (HELEMENT3D* helement, + HM3_GENERAL* general, + void* el_data) { int result; diff --git a/io/visual/grapedatadisplay.hh b/io/visual/grapedatadisplay.hh index 4d0c8466a6d04901cf41143f90ac4e65af87cc2c..509d6de3db6273df53f46b3a6dd4d71fa3c77726 100644 --- a/io/visual/grapedatadisplay.hh +++ b/io/visual/grapedatadisplay.hh @@ -34,20 +34,20 @@ namespace Dune public: //! Constructor, make a GrapeDataDisplay for given grid and myRank = -1 - GrapeDataDisplay(GridType &grid); + inline GrapeDataDisplay(GridType &grid); //! Constructor, make a GrapeDataDisplay for given grid - GrapeDataDisplay(GridType &grid, const int myrank); + inline GrapeDataDisplay(GridType &grid, const int myrank); //! Calls the display of the grid and draws the discrete function //! if discretefunction is NULL, then only the grid is displayed - void dataDisplay(DiscFuncType &func); + inline void dataDisplay(DiscFuncType &func); //! - void addData(DiscFuncType &func, const char * name , double time ); + inline void addData(DiscFuncType &func, const char * name , double time ); private: - void createQuadrature(); + inline void createQuadrature(); //! hold the diffrent datas on this mesh // std::vector sucks @@ -63,41 +63,41 @@ namespace Dune // for the data visualization template <class EntityType, class LocalFuncType> - void evalCoord (EntityType &en, DiscFuncType &func, LocalFuncType &lf, - int comp, const double *coord, double * val); + inline void evalCoord (EntityType &en, DiscFuncType &func, LocalFuncType &lf, + int comp, const double *coord, double * val); // for the data visualization template <class EntityType, class LocalFuncType> - void evalDof (EntityType &en, DiscFuncType &func,LocalFuncType &lf, - int comp , int localNum, double * val); + inline void evalDof (EntityType &en, DiscFuncType &func,LocalFuncType &lf, + int comp , int localNum, double * val); // for the data visualization template <class EntityType, class LocalFuncType> - void evalScalar (EntityType &en, DiscFuncType & func, LocalFuncType &lf, - int comp , int localNum, double * val); + inline void evalScalar (EntityType &en, DiscFuncType & func, LocalFuncType &lf, + int comp , int localNum, double * val); // for the data visualization template <class EntityType, class LocalFuncType> - void evalVector (EntityType &en, DiscFuncType & func,LocalFuncType &lf, - int comp , int localNum, double * val); + inline void evalVector (EntityType &en, DiscFuncType & func,LocalFuncType &lf, + int comp , int localNum, double * val); - void evalCoord (DUNE_ELEM *he, DUNE_FDATA *df, - const double *coord, double * val); - void evalDof (DUNE_ELEM *he, DUNE_FDATA *df, int localNum, double * val); + inline void evalCoord (DUNE_ELEM *he, DUNE_FDATA *df, + const double *coord, double * val); + inline void evalDof (DUNE_ELEM *he, DUNE_FDATA *df, int localNum, double * val); - static void func_real (DUNE_ELEM *he , DUNE_FDATA * fe,int ind, - const double *coord, double *val); + inline static void func_real (DUNE_ELEM *he , DUNE_FDATA * fe,int ind, + const double *coord, double *val); }; //! default, do nothing template <GeometryType elType> - int mapElType(int localNum) + inline int mapElType(int localNum) { return localNum; } //! specialization for quadrilaterals template <> - int mapElType<quadrilateral>(int localNum) + inline int mapElType<quadrilateral>(int localNum) { switch(localNum) { @@ -109,7 +109,7 @@ namespace Dune //! specialization for hexahedrons template <> - int mapElType<hexahedron>(int localNum) + inline int mapElType<hexahedron>(int localNum) { switch(localNum) { diff --git a/io/visual/grapegriddisplay.hh b/io/visual/grapegriddisplay.hh index abc7d4b132006edca343e66907e41ed805b3a956..b053f84cbcc83454b0ff056dc362d03059fcf539 100644 --- a/io/visual/grapegriddisplay.hh +++ b/io/visual/grapegriddisplay.hh @@ -46,28 +46,25 @@ namespace Dune public: //! Constructor, make a GrapeGridDisplay for given grid - GrapeGridDisplay(GridType &grid, const int myrank ); + inline GrapeGridDisplay(GridType &grid, const int myrank ); //! Constructor, make a GrapeGridDisplay for given grid - GrapeGridDisplay(GridType &grid); + inline GrapeGridDisplay(GridType &grid); //! Destructor for GrapeGridDisplay - ~GrapeGridDisplay(); + inline ~GrapeGridDisplay(); //! Calls the display of the grid and draws the discrete function //! if discretefunction is NULL, then only the grid is displayed - void display(); + inline void display(); //! return pointer to Grape Hmesh - void * getHmesh(); + inline void * getHmesh(); - void addMyMeshToTimeScene(void * timescene, double time, int proc) - { - GrapeInterface<dim,dimworld>::addHmeshToTimeScene(timescene,time,this->getHmesh(),proc); - } + inline void addMyMeshToTimeScene(void * timescene, double time, int proc); //! return reference to Dune Grid - GridType& getGrid(); + inline GridType& getGrid(); // internal vec for local to global methods FieldVector<double,dimworld> globalVec_; @@ -75,7 +72,7 @@ namespace Dune private: // generate hmesh - void * setupHmesh(); + inline void * setupHmesh(); protected: //**************************************************************** @@ -85,57 +82,57 @@ namespace Dune //**************************************************************** // update element from entity template <class GridIteratorType> - static int el_update (GridIteratorType *, DUNE_ELEM *) ; + inline static int el_update (GridIteratorType *, DUNE_ELEM *) ; // update child element template <class GridIteratorType> - static int child_update (GridIteratorType *, DUNE_ELEM *) ; + inline static int child_update (GridIteratorType *, DUNE_ELEM *) ; template <class GridIteratorType> - static int child_n_update (GridIteratorType *, DUNE_ELEM *) ; + inline static int child_n_update (GridIteratorType *, DUNE_ELEM *) ; // first and next macro element via LevelIterator level 0 - int first_leaf (DUNE_ELEM * he) ; - int next_leaf (DUNE_ELEM * he) ; + inline int first_leaf (DUNE_ELEM * he) ; + inline int next_leaf (DUNE_ELEM * he) ; // first and next macro element via LevelIterator level 0 - int first_macro (DUNE_ELEM * he) ; - int next_macro (DUNE_ELEM * he) ; + inline int first_macro (DUNE_ELEM * he) ; + inline int next_macro (DUNE_ELEM * he) ; // first and next child via HierarchicIterator with given maxlevel in Grape - static int first_child (DUNE_ELEM * he) ; - static int next_child (DUNE_ELEM * he) ; + inline static int first_child (DUNE_ELEM * he) ; + inline static int next_child (DUNE_ELEM * he) ; - static void * copy_iterator (const void * i) ; + inline static void * copy_iterator (const void * i) ; // local to world - static void ctow (DUNE_ELEM * he, const double * c, double * w); + inline static void ctow (DUNE_ELEM * he, const double * c, double * w); // world to local - static int wtoc (DUNE_ELEM * he, const double * w, double * c); + inline static int wtoc (DUNE_ELEM * he, const double * w, double * c); // check inside reference element - static int check_inside (DUNE_ELEM * he, const double * w); + inline static int check_inside (DUNE_ELEM * he, const double * w); // dito template <class EntityType> - int checkInside(EntityType &en, const double * w); + inline int checkInside(EntityType &en, const double * w); // dito template <class EntityType> - int world_to_local(EntityType &en, const double * w, double * c); + inline int world_to_local(EntityType &en, const double * w, double * c); // dito template <class EntityType> - void local_to_world(EntityType &en, const double * c, double * w); + inline void local_to_world(EntityType &en, const double * c, double * w); // wrapper methods for first_child and next_child - static int first_mac (DUNE_ELEM * he); - static int next_mac (DUNE_ELEM * he); + inline static int first_mac (DUNE_ELEM * he); + inline static int next_mac (DUNE_ELEM * he); // wrapper methods for first_child and next_child - static int fst_leaf (DUNE_ELEM * he); - static int nxt_leaf (DUNE_ELEM * he); + inline static int fst_leaf (DUNE_ELEM * he); + inline static int nxt_leaf (DUNE_ELEM * he); }; // end class GrapeGridDisplay