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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 102 - (show annotations)
Wed Dec 15 07:08:39 2004 UTC (14 years, 10 months ago) by jgs
Original Path: trunk/esys2/escript/src/Data/DataC.h
File MIME type: text/plain
File size: 4296 byte(s)
*** empty log message ***

1 /* $Id$ */
2 /*
3 ******************************************************************************
4 * *
5 * COPYRIGHT ACcESS 2004 - All Rights Reserved *
6 * *
7 * This software is the property of ACcESS. No part of this code *
8 * may be copied in any form or by any means without the expressed written *
9 * consent of ACcESS. Copying, use or modification of this software *
10 * by any unauthorised person is illegal unless that person has a software *
11 * license agreement with ACcESS. *
12 * *
13 ******************************************************************************
14 */
15
16 #if !defined escript_DataC_20040611_H
17 #define escript_DataC_20040611_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 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 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 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 noDataPointsPerSample Input - number of data points per sample
79 \param noSamples Input - number of samples
80 */
81 int numSamplesEqual(escriptDataC* data, int numDataPointsPerSample,
82 int numSamples);
83
84 /**
85 \brief
86 Returns the rank of the point data for the data.
87 \param data Input - C wrapper for Data.
88 */
89 int getDataPointRank(escriptDataC* data);
90
91 /**
92 \brief
93 Returns the pointer to the shape array of the point data.
94 \param data Input - C wrapper for Data.
95 */
96 int* getDataPointShape(escriptDataC* data);
97
98 /**
99 \brief
100 Return the number of doubles needed for each data point.
101 \param data Input - C wrapper for Data.
102 */
103 int getDataPointSize(escriptDataC* data);
104 /**
105 \brief
106 Return the number of doubles stored for the Data object.
107 Argument data may be NULL, in which case 0 is returnd.
108 \param data Input - C wrapper for Data.
109 */
110 int getLength(escriptDataC* data);
111 /**
112 \brief
113 Return true if data is expanded.
114 Argument data may be NULL, in which case false is returnd.
115 \param data Input - C wrapper for Data.
116 */
117 int isExpanded(escriptDataC* data);
118 /**
119 \brief
120 Return a pointer to the data for the given sample number.
121 if data is empty NULL is returned.
122 data may be NULL, in which case NULL is returnd.
123 \param data Input - C wrapper for Data.
124 \param sampleNo Input - The sample number.
125 */
126 double* getSampleData(escriptDataC* data, int sampleNo);
127
128 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26