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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1312 - (hide annotations)
Mon Sep 24 06:18:44 2007 UTC (12 years ago) by ksteube
File MIME type: text/plain
File size: 4489 byte(s)
The MPI branch is hereby closed. All future work should be in trunk.

Previously in revision 1295 I merged the latest changes to trunk into trunk-mpi-branch.
In this revision I copied all files from trunk-mpi-branch over the corresponding
trunk files. I did not use 'svn merge', it was a copy.

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26