COVISE Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
coDoStructuredGrid.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_STRUCTURED_GRID_H
9 #define CO_DO_STRUCTURED_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; // x-coordinates (length X * Y * Z)
61  coFloatShmArray y_coord; // y-coordinates (length X * Y * Z)
62  coFloatShmArray z_coord; // z-coordinates (length X * Y * Z)
63 protected:
64  int rebuildFromShm();
65  int getObjInfo(int, coDoInfo **) const;
66  coDoStructuredGrid *cloneObject(const coObjInfo &newinfo) const;
67 
68 public:
70  : coDoAbstractStructuredGrid(info, "STRGRD")
71  {
72  if (name)
73  {
74  if (getShmArray() != 0)
75  {
76  if (rebuildFromShm() == 0)
77  {
78  print_comment(__LINE__, __FILE__, "rebuildFromShm == 0");
79  }
80  }
81  else
82  {
83  print_comment(__LINE__, __FILE__, "object %s doesn't exist", name);
84  new_ok = 0;
85  }
86  }
87  };
88  coDoStructuredGrid(const coObjInfo &info, coShmArray *arr);
89  coDoStructuredGrid(const coObjInfo &info, int x, int y, int z,
90  float *xc, float *yc, float *zc);
91  coDoStructuredGrid(const coObjInfo &info, int x, int y, int z);
93  {
94  }
95  virtual void getGridSize(int *x, int *y, int *z) const
96  {
97  *x = x_disc;
98  *y = y_disc;
99  *z = z_disc;
100  };
101  virtual void getPointCoordinates(int i, float *x_c,
102  int j, float *y_c, int k, float *z_c) const
103  {
104  *x_c = x_coord[i * y_disc.get() * z_disc.get() + j * z_disc.get() + k];
105  *y_c = y_coord[i * y_disc.get() * z_disc.get() + j * z_disc.get() + k];
106  *z_c = z_coord[i * y_disc.get() * z_disc.get() + j * z_disc.get() + k];
107  };
108  void getAddresses(float **x_c, float **y_c, float **z_c) const
109  {
110  *x_c = (float *)x_coord.getDataPtr();
111  *y_c = (float *)y_coord.getDataPtr();
112  *z_c = (float *)z_coord.getDataPtr();
113  };
114  virtual int interpolateField(float *v_interp, const float *point,
115  int *cell, int no_arrays, int array_dim,
116  const float *const *velo);
117 };
118 }
119 #endif
GLuint const GLchar * name
Definition: khronos-glext.h:6722
coFloatShmArray y_coord
Definition: coDoStructuredGrid.h:61
coIntShm y_disc
Definition: coDoStructuredGrid.h:58
Definition: covise_shm.h:481
GLint GLint GLint GLint GLint GLint y
Definition: khronos-glext.h:6346
virtual void getGridSize(int *x, int *y, int *z) const
Definition: coDoStructuredGrid.h:95
Definition: covise_statics.cpp:54
GLdouble GLdouble z
Definition: khronos-glext.h:6565
Definition: coDoAbstractStructuredGrid.h:53
Definition: coObjID.h:230
GLint GLint GLint GLint GLint x
Definition: khronos-glext.h:6346
virtual void getPointCoordinates(int i, float *x_c, int j, float *y_c, int k, float *z_c) const
Definition: coDoStructuredGrid.h:101
Definition: coDistributedObject.h:266
coFloatShmArray z_coord
Definition: coDoStructuredGrid.h:62
coDoStructuredGrid(const coObjInfo &info)
Definition: coDoStructuredGrid.h:69
#define DOEXPORT
Definition: coExport.h:307
coIntShm z_disc
Definition: coDoStructuredGrid.h:59
void print_comment(int line, const char *filename, const char *fmt,...)
Definition: coLog.cpp:25
Definition: coDoStructuredGrid.h:53
Definition: coDistributedObject.h:295
static coShmArray * getShmArray(const char *name)
Definition: coDistributedObject.cpp:60
virtual ~coDoStructuredGrid()
Definition: coDoStructuredGrid.h:92
coIntShm x_disc
Definition: coDoStructuredGrid.h:57
coFloatShmArray x_coord
Definition: coDoStructuredGrid.h:60
void getAddresses(float **x_c, float **y_c, float **z_c) const
Definition: coDoStructuredGrid.h:108