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

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

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.cpp
File size: 3545 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 extern "C" {
16 #include "escript/Data/DataC.h"
17 }
18
19 #include "escript/Data/Data.h"
20 #include "escript/Data/DataArrayView.h"
21
22 int getFunctionSpaceType(struct escriptDataC* data)
23 {
24 escript::Data* temp=(escript::Data*)(data->m_dataPtr);
25 return temp->getFunctionSpace().getTypeCode();
26 }
27
28
29 int isDataPointShapeEqual(struct escriptDataC* data, int rank, int* dimensions)
30 {
31 if (data == (struct escriptDataC*)0) {
32 return true;
33 } else {
34 escript::Data* temp=(escript::Data*)(data->m_dataPtr);
35 if (temp->isEmpty()) {
36 return true;
37 } else {
38 escript::DataArrayView::ShapeType givenShape(&dimensions[0],&dimensions[rank]);
39 return (temp->getPointDataView().getShape()==givenShape);
40 }
41 }
42 }
43
44 int numSamplesEqual(struct escriptDataC* data, int numDataPointsPerSample,
45 int numSamples)
46 {
47 if (data == (struct escriptDataC*)0) {
48 return true;
49 } else {
50 escript::Data* temp=(escript::Data*)(data->m_dataPtr);
51 if (temp->isEmpty()) {
52 return true;
53 } else {
54 int result=(numDataPointsPerSample==temp->getNumDataPointsPerSample());
55 result=result && (numSamples==temp->getNumSamples());
56 return result;
57 }
58 }
59 }
60
61 int getDataPointRank(struct escriptDataC* data)
62 {
63 escript::Data* temp=(escript::Data*)(data->m_dataPtr);
64 return temp->getDataPointRank();
65 }
66
67 int* getDataPointShape(struct escriptDataC* data)
68 {
69 escript::Data* temp=(escript::Data*)(data->m_dataPtr);
70 const escript::DataArrayView::ShapeType view=temp->getDataPointShape();
71 return (int*) &(view[0]);
72 }
73
74 int getDataPointSize(struct escriptDataC* data)
75 {
76 escript::Data* temp=(escript::Data*)(data->m_dataPtr);
77 return temp->getDataPointSize();
78 }
79
80 int getLength(struct escriptDataC* data)
81 {
82 escript::Data* temp=(escript::Data*)(data->m_dataPtr);
83 return temp->getLength();
84 }
85
86 int isExpanded(struct escriptDataC* data)
87 {
88 if (data == (struct escriptDataC*)0) {
89 return false;
90 } else {
91 escript::Data* temp=(escript::Data*)(data->m_dataPtr);
92 if (temp->isEmpty()) {
93 return false;
94 } else {
95 return temp->isExpanded();
96 }
97 }
98 }
99
100 int isEmpty(escriptDataC* data)
101 {
102 if (data == (struct escriptDataC*)0) {
103 return true;
104 } else {
105 escript::Data* temp=(escript::Data*)(data->m_dataPtr);
106 return temp->isEmpty();
107 }
108 }
109
110
111 double* getSampleData(struct escriptDataC* data, int sampleNo)
112 {
113 if (data == (struct escriptDataC*)0) {
114 return NULL;
115 } else {
116 escript::Data* temp=(escript::Data*)(data->m_dataPtr);
117 if (temp->isEmpty()) {
118 return NULL;
119 } else {
120 return temp->getSampleData(sampleNo);
121 }
122 }
123 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26