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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 82 - (show annotations)
Tue Oct 26 06:53:54 2004 UTC (15 years ago) by jgs
Original Path: trunk/esys2/escript/src/Data/DataC.h
File MIME type: text/plain
File size: 4285 byte(s)
Initial revision

1 /*
2 ******************************************************************************
3 * *
4 * COPYRIGHT ACcESS 2004 - All Rights Reserved *
5 * *
6 * This software is the property of ACcESS. No part of this code *
7 * may be copied in any form or by any means without the expressed written *
8 * consent of ACcESS. Copying, use or modification of this software *
9 * by any unauthorised person is illegal unless that person has a software *
10 * license agreement with ACcESS. *
11 * *
12 ******************************************************************************
13 */
14
15 #if !defined escript_DataC_20040611_H
16 #define escript_DataC_20040611_H
17
18 #define ESCRIPT_MAX_DATA_RANK 4
19 /**
20 \brief
21 Provide a wrapper around a Data object so Data may be accessed from C.
22
23 Description:
24 Provide a wrapper around a Data object so Data may be accessed from C.
25
26 */
27 struct escriptDataC {
28 void* m_dataPtr;
29 };
30
31 typedef struct escriptDataC escriptDataC;
32
33 /**
34 \brief
35 Return the function space type code.
36 \param data Input - C wrapper for Data.
37 */
38 int getFunctionSpaceType(escriptDataC* data);
39
40 /**
41 \brief
42 sets the int variable _fs_ the function space type of _data_ if the data are not empty.
43 \param _fs_ Input/Output - variable to be updated.
44 \param _data_ Input - C wrapper for Data.
45 */
46 #define updateFunctionSpaceType(_fs_,_data_) _fs_=(isEmpty(_data_) ? _fs_ : getFunctionSpaceType(_data_))
47
48 /**
49 \brief
50 is true if the function space type of _data_ is equal to _fs_ or is empty
51 \param _fs_ Input - function space type to checked against
52 \param _data_ Input - C wrapper for Data.
53 */
54 #define functionSpaceTypeEqual(_fs_,_data_) ( (_fs_==getFunctionSpaceType(_data_)) || isEmpty(_data_) ) ? 1 : 0
55
56 /**
57 \brief
58 Returns the true if the data are empty or data is NULL.
59 \param data Input - C wrapper for Data.
60 */
61 int isEmpty(escriptDataC* data);
62
63 /**
64 \brief
65 Return true if the input shape matches the data point shape for data
66 \param data Input - C wrapper for Data.
67 \param rank Input - number of dimensions.
68 \param dimensions Input -
69 */
70 int isDataPointShapeEqual(escriptDataC* data, int rank, int* dimensions);
71 /**
72 \brief
73 Return true if the number of data points per sample and the number
74 of samples equal the input values. In the case that data is empty or NULL,
75 true is returned.
76 \param data Input - C wrapper for Data.
77 \param noDataPointsPerSample Input - number of data points per sample
78 \param noSamples Input - number of samples
79 */
80 int numSamplesEqual(escriptDataC* data, int numDataPointsPerSample,
81 int numSamples);
82
83 /**
84 \brief
85 Returns the rank of the point data for the data.
86 \param data Input - C wrapper for Data.
87 */
88 int getDataPointRank(escriptDataC* data);
89
90 /**
91 \brief
92 Returns the pointer to the shape array of the point data.
93 \param data Input - C wrapper for Data.
94 */
95 int* getDataPointShape(escriptDataC* data);
96
97 /**
98 \brief
99 Return the number of doubles needed for each data point.
100 \param data Input - C wrapper for Data.
101 */
102 int getDataPointSize(escriptDataC* data);
103 /**
104 \brief
105 Return the number of doubles stored for the Data object.
106 Argument data may be NULL, in which case 0 is returnd.
107 \param data Input - C wrapper for Data.
108 */
109 int getLength(escriptDataC* data);
110 /**
111 \brief
112 Return true if data is expanded.
113 Argument data may be NULL, in which case false is returnd.
114 \param data Input - C wrapper for Data.
115 */
116 int isExpanded(escriptDataC* data);
117 /**
118 \brief
119 Return a pointer to the data for the given sample number.
120 if data is empty NULL is returned.
121 data may be NULL, in which case NULL is returnd.
122 \param data Input - C wrapper for Data.
123 \param sampleNo Input - The sample number.
124 */
125 double* getSampleData(escriptDataC* data, int sampleNo);
126
127 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26