/[escript]/trunk/escript/src/DataC.h
ViewVC logotype

Contents of /trunk/escript/src/DataC.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1811 - (show annotations)
Thu Sep 25 23:11:13 2008 UTC (11 years, 2 months ago) by ksteube
File MIME type: text/plain
File size: 4454 byte(s)
Copyright updated in all files

1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2008 by University of Queensland
5 * Earth Systems Science Computational Center (ESSCC)
6 * http://www.uq.edu.au/esscc
7 *
8 * Primary Business: Queensland, Australia
9 * Licensed under the Open Software License version 3.0
10 * http://www.opensource.org/licenses/osl-3.0.php
11 *
12 *******************************************************/
13
14
15 #if !defined escript_DataC_20040611_H
16 #define escript_DataC_20040611_H
17 #include "system_dep.h"
18
19 #define ESCRIPT_MAX_DATA_RANK 4
20 /**
21 \brief
22 Provide a wrapper around a Data object so Data may be accessed from C.
23
24 Description:
25 Provide a wrapper around a Data object so Data may be accessed from C.
26
27 */
28 struct escriptDataC {
29 void* m_dataPtr;
30 };
31
32 typedef struct escriptDataC escriptDataC;
33
34 /**
35 \brief
36 Return the function space type code.
37 \param data Input - C wrapper for Data.
38 */
39 ESCRIPT_DLL_API int getFunctionSpaceType(escriptDataC* data);
40
41 /**
42 \brief
43 sets the int variable _fs_ the function space type of _data_ if the data are not empty.
44 \param _fs_ Input/Output - variable to be updated.
45 \param _data_ Input - C wrapper for Data.
46 */
47 #define updateFunctionSpaceType(_fs_,_data_) _fs_=(isEmpty(_data_) ? _fs_ : getFunctionSpaceType(_data_))
48
49 /**
50 \brief
51 is true if the function space type of _data_ is equal to _fs_ or is empty
52 \param _fs_ Input - function space type to checked against
53 \param _data_ Input - C wrapper for Data.
54 */
55 #define functionSpaceTypeEqual(_fs_,_data_) ( (isEmpty(_data_) || _fs_==getFunctionSpaceType(_data_)) ) ? 1 : 0
56
57 /**
58 \brief
59 Returns the true if the data are empty or data is NULL.
60 \param data Input - C wrapper for Data.
61 */
62 ESCRIPT_DLL_API int isEmpty(escriptDataC* data);
63
64 /**
65 \brief
66 Return true if the input shape matches the data point shape for data
67 \param data Input - C wrapper for Data.
68 \param rank Input - number of dimensions.
69 \param dimensions Input -
70 */
71 ESCRIPT_DLL_API int isDataPointShapeEqual(escriptDataC* data, int rank, int* dimensions);
72 /**
73 \brief
74 Return true if the number of data points per sample and the number
75 of samples equal the input values. In the case that data is empty or NULL,
76 true is returned.
77 \param data Input - C wrapper for Data.
78 \param numDataPointsPerSample Input - number of data points per sample
79 \param numSamples Input - number of samples
80 */
81 ESCRIPT_DLL_API int numSamplesEqual(escriptDataC* data, int numDataPointsPerSample,
82 int numSamples);
83
84 /**
85 \brief
86 Returns the number of data points per sample
87 \param data Input - C wrapper for Data.
88 */
89 ESCRIPT_DLL_API int getNumDataPointsPerSample(escriptDataC* data);
90
91 /**
92 \brief
93 Returns the rank of the point data for the data.
94 \param data Input - C wrapper for Data.
95 */
96 ESCRIPT_DLL_API int getDataPointRank(escriptDataC* data);
97
98 /**
99 \brief
100 Returns the value of the i-th component of the shape of the point data.
101 \param data Input - C wrapper for Data.
102 \param i Input - index of shape component.
103 */
104 ESCRIPT_DLL_API int getDataPointShape(escriptDataC* data,int i);
105
106 /**
107 \brief
108 Return the number of doubles needed for each data point.
109 \param data Input - C wrapper for Data.
110 */
111 ESCRIPT_DLL_API int getDataPointSize(escriptDataC* data);
112 /**
113 \brief
114 Return the number of doubles stored for the Data object.
115 Argument data may be NULL, in which case 0 is returnd.
116 \param data Input - C wrapper for Data.
117 */
118 ESCRIPT_DLL_API int getLength(escriptDataC* data);
119 /**
120 \brief
121 Return true if data is expanded.
122 Argument data may be NULL, in which case false is returnd.
123 \param data Input - C wrapper for Data.
124 */
125 ESCRIPT_DLL_API int isExpanded(escriptDataC* data);
126 /**
127 \brief
128 Return a pointer to the data for the given sample number.
129 if data is empty NULL is returned.
130 data may be NULL, in which case NULL is returnd.
131 \param data Input - C wrapper for Data.
132 \param sampleNo Input - The sample number.
133 */
134 ESCRIPT_DLL_API double* getSampleData(escriptDataC* data, int sampleNo);
135 /**
136 \brief
137 Return a pointer to the data for the given sample number.
138 Fast version of getSampledata: does no error checking.
139 \param data Input - C wrapper for Data.
140 \param sampleNo Input - The sample number.
141 */
142 ESCRIPT_DLL_API double* getSampleDataFast(escriptDataC* data, int sampleNo);
143 #endif

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26