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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 971 - (hide annotations)
Wed Feb 14 04:40:49 2007 UTC (12 years, 7 months ago) by ksteube
File size: 3466 byte(s)
Had to undo commit to new MPI branch. The changes went into the original and
not the branch. The files committed here are exactly the same as revision 969.


1 jgs 102 // $Id$
2 jgs 82 /*
3 elspeth 615 ************************************************************
4     * Copyright 2006 by ACcESS MNRF *
5     * *
6     * http://www.access.edu.au *
7     * Primary Business: Queensland, Australia *
8     * Licensed under the Open Software License version 3.0 *
9     * http://www.opensource.org/licenses/osl-3.0.php *
10     * *
11     ************************************************************
12 jgs 82 */
13    
14     extern "C" {
15 jgs 474 #include "DataC.h"
16 jgs 82 }
17    
18 jgs 474 #include "Data.h"
19     #include "DataArrayView.h"
20 jgs 82
21     int getFunctionSpaceType(struct escriptDataC* data)
22     {
23     escript::Data* temp=(escript::Data*)(data->m_dataPtr);
24     return temp->getFunctionSpace().getTypeCode();
25     }
26    
27    
28     int isDataPointShapeEqual(struct escriptDataC* data, int rank, int* dimensions)
29     {
30     if (data == (struct escriptDataC*)0) {
31     return true;
32     } else {
33     escript::Data* temp=(escript::Data*)(data->m_dataPtr);
34     if (temp->isEmpty()) {
35     return true;
36     } else {
37     escript::DataArrayView::ShapeType givenShape(&dimensions[0],&dimensions[rank]);
38     return (temp->getPointDataView().getShape()==givenShape);
39     }
40     }
41     }
42    
43     int numSamplesEqual(struct escriptDataC* data, int numDataPointsPerSample,
44     int numSamples)
45     {
46     if (data == (struct escriptDataC*)0) {
47     return true;
48     } else {
49     escript::Data* temp=(escript::Data*)(data->m_dataPtr);
50     if (temp->isEmpty()) {
51     return true;
52     } else {
53     int result=(numDataPointsPerSample==temp->getNumDataPointsPerSample());
54     result=result && (numSamples==temp->getNumSamples());
55     return result;
56     }
57     }
58     }
59    
60     int getDataPointRank(struct escriptDataC* data)
61     {
62 jgs 102 if (data == (struct escriptDataC*)0) {
63     return 0;
64     } else {
65     escript::Data* temp=(escript::Data*)(data->m_dataPtr);
66     return temp->getDataPointRank();
67     }
68 jgs 82 }
69    
70 jgs 113 int getDataPointShape(struct escriptDataC* data,int i)
71 jgs 82 {
72 jgs 113 if (data == (struct escriptDataC*)0) {
73     return 0;
74     } else {
75     escript::Data* temp=(escript::Data*)(data->m_dataPtr);
76     int rank = temp->getDataPointRank();
77     if (i<0 || i>=rank) {
78     return 1;
79     } else {
80     const escript::DataArrayView::ShapeType view=temp->getDataPointShape();
81     return view[i];
82     }
83     }
84 jgs 82 }
85    
86     int getDataPointSize(struct escriptDataC* data)
87     {
88     escript::Data* temp=(escript::Data*)(data->m_dataPtr);
89     return temp->getDataPointSize();
90     }
91    
92     int getLength(struct escriptDataC* data)
93     {
94     escript::Data* temp=(escript::Data*)(data->m_dataPtr);
95     return temp->getLength();
96     }
97    
98     int isExpanded(struct escriptDataC* data)
99     {
100     if (data == (struct escriptDataC*)0) {
101     return false;
102     } else {
103     escript::Data* temp=(escript::Data*)(data->m_dataPtr);
104     if (temp->isEmpty()) {
105     return false;
106     } else {
107     return temp->isExpanded();
108     }
109     }
110     }
111    
112     int isEmpty(escriptDataC* data)
113     {
114     if (data == (struct escriptDataC*)0) {
115     return true;
116     } else {
117     escript::Data* temp=(escript::Data*)(data->m_dataPtr);
118     return temp->isEmpty();
119     }
120     }
121    
122    
123     double* getSampleData(struct escriptDataC* data, int sampleNo)
124     {
125     if (data == (struct escriptDataC*)0) {
126     return NULL;
127     } else {
128     escript::Data* temp=(escript::Data*)(data->m_dataPtr);
129     if (temp->isEmpty()) {
130     return NULL;
131     } else {
132     return temp->getSampleData(sampleNo);
133     }
134     }
135     }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26