COVISE Core
coDoRectilinearGrid.h
Go to the documentation of this file.
1 /* This file is part of COVISE.
2 
3  You can use it under the terms of the GNU Lesser General Public License
4  version 2.1 or later, see lgpl-2.1.txt.
5 
6  * License: LGPL 2+ */
7 
8 #ifndef CO_DO_RECTILINEAR_GRID_H
9 #define CO_DO_RECTILINEAR_GRID_H
10 
12 
13 /*
14  $Log: $
15  * Revision 1.2 1993/10/21 21:44:38 zrfg0125
16  * bugs in type fixed
17  *
18  * Revision 1.1 93/09/25 20:51:34 zrhk0125
19  * Initial revision
20  *
21 */
22 
23 /***********************************************************************\
24  ** **
25  ** Structured class Version: 1.1 **
26  ** **
27  ** **
28  ** Description : Classes for the handling of a structured grid **
29  ** and the data on it in a distributed manner. **
30  ** **
31  ** Classes : coDoGeometry, coDoStructuredGrid, **
32  ** DO_Scalar_3d_data, DO_Vector_3d_data, **
33  ** DO_Solution **
34  ** **
35  ** Copyright (C) 1993 by University of Stuttgart **
36  ** Computer Center (RUS) **
37  ** Allmandring 30 **
38  ** 7000 Stuttgart 80 **
39  ** **
40  ** **
41  ** Author : A. Wierse (RUS) **
42  ** **
43  ** History : **
44  ** 15.04.93 Ver 1.0 **
45  ** 26.05.93 Ver 1.1 new Shm-Datatypes introduced **
46  ** redesign of rebuildFromShm **
47  ** **
48  ** **
49 \***********************************************************************/
50 namespace covise
51 {
52 
54 {
55  friend class coDoInitializer;
56  static coDistributedObject *virtualCtor(coShmArray *arr);
57  coIntShm x_disc; // number of points in x-direction (X)
58  coIntShm y_disc; // number of points in y-direction (Y)
59  coIntShm z_disc; // number of points in z-direction (Z)
60  coFloatShmArray x_coord; // coordinates in x-direction (length X)
61  coFloatShmArray y_coord; // coordinates in y-direction (length Y)
62  coFloatShmArray z_coord; // coordinates in z-direction (length Z)
63 
64 protected:
65  int rebuildFromShm();
66  int getObjInfo(int, coDoInfo **) const;
67  coDoRectilinearGrid *cloneObject(const coObjInfo &newinfo) const;
68 
69 public:
71  : coDoAbstractStructuredGrid(info, "RCTGRD")
72  {
73  if (name)
74  {
75  if (getShmArray() != 0)
76  {
77  if (rebuildFromShm() == 0)
78  {
79  print_comment(__LINE__, __FILE__, "rebuildFromShm == 0");
80  }
81  }
82  else
83  {
84  print_comment(__LINE__, __FILE__, "object %s doesn't exist", name);
85  new_ok = 0;
86  }
87  }
88  };
89  coDoRectilinearGrid(const coObjInfo &info, coShmArray *arr);
90  coDoRectilinearGrid(const coObjInfo &info, int x, int y, int z,
91  float *xc, float *yc, float *zc);
92  coDoRectilinearGrid(const coObjInfo &info, int x, int y, int z);
93  virtual ~coDoRectilinearGrid(){};
94  virtual void getGridSize(int *x, int *y, int *z) const
95  {
96  *x = x_disc;
97  *y = y_disc;
98  *z = z_disc;
99  };
100  virtual void getPointCoordinates(int i, float *x_c,
101  int j, float *y_c, int k, float *z_c) const
102  {
103  *x_c = x_coord[i];
104  *y_c = y_coord[j];
105  *z_c = z_coord[k];
106  };
107  void getAddresses(float **x_c, float **y_c, float **z_c) const
108  {
109  *x_c = (float *)x_coord.getDataPtr();
110  *y_c = (float *)y_coord.getDataPtr();
111  *z_c = (float *)z_coord.getDataPtr();
112  };
113  virtual int interpolateField(float *v_interp, const float *point,
114  int *cell, int no_arrays, int array_dim,
115  const float *const *velo);
116 };
117 }
118 #endif
Definition: covise_shm.h:481
coFloatShmArray z_coord
Definition: coDoRectilinearGrid.h:62
Definition: coDistributedObject.h:266
coDoRectilinearGrid(const coObjInfo &info)
Definition: coDoRectilinearGrid.h:70
virtual void getGridSize(int *x, int *y, int *z) const
Definition: coDoRectilinearGrid.h:94
void * getDataPtr() const
Definition: covise_shm.h:543
virtual void getPointCoordinates(int i, float *x_c, int j, float *y_c, int k, float *z_c) const
Definition: coDoRectilinearGrid.h:100
coIntShm z_disc
Definition: coDoRectilinearGrid.h:59
Definition: coDoAbstractStructuredGrid.h:53
GLdouble GLdouble z
Definition: khronos-glext.h:6565
Definition: coObjID.h:230
Definition: covise_statics.cpp:54
coFloatShmArray y_coord
Definition: coDoRectilinearGrid.h:61
Definition: coDoRectilinearGrid.h:53
Definition: coDistributedObject.h:295
GLint GLint GLint GLint GLint x
Definition: khronos-glext.h:6346
static coShmArray * getShmArray(const char *name)
Definition: coDistributedObject.cpp:60
coIntShm y_disc
Definition: coDoRectilinearGrid.h:58
GLint GLint GLint GLint GLint GLint y
Definition: khronos-glext.h:6346
#define DOEXPORT
Definition: coExport.h:331
virtual ~coDoRectilinearGrid()
Definition: coDoRectilinearGrid.h:93
coIntShm x_disc
Definition: coDoRectilinearGrid.h:57
void print_comment(int line, const char *filename, const char *fmt,...)
Definition: coLog.cpp:25
list of all chemical elements
Definition: coConfig.h:26
coFloatShmArray x_coord
Definition: coDoRectilinearGrid.h:60
GLuint const GLchar * name
Definition: khronos-glext.h:6722
void getAddresses(float **x_c, float **y_c, float **z_c) const
Definition: coDoRectilinearGrid.h:107