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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 969 - (hide annotations)
Tue Feb 13 23:02:23 2007 UTC (12 years, 7 months ago) by ksteube
File size: 3586 byte(s)
Parallelization using MPI for solution of implicit problems.

Parallelization for explicit problems has already been accomplished in
the main SVN branch.

This is incomplete and is not ready for use.


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 ksteube 969 printf("ksteube NumDataPointsPerSample=%d NumSamples=%d\n", temp->getNumDataPointsPerSample(), temp->getNumSamples());
55 jgs 82 result=result && (numSamples==temp->getNumSamples());
56     return result;
57     }
58     }
59     }
60    
61     int getDataPointRank(struct escriptDataC* data)
62     {
63 jgs 102 if (data == (struct escriptDataC*)0) {
64     return 0;
65     } else {
66     escript::Data* temp=(escript::Data*)(data->m_dataPtr);
67     return temp->getDataPointRank();
68     }
69 jgs 82 }
70    
71 jgs 113 int getDataPointShape(struct escriptDataC* data,int i)
72 jgs 82 {
73 jgs 113 if (data == (struct escriptDataC*)0) {
74     return 0;
75     } else {
76     escript::Data* temp=(escript::Data*)(data->m_dataPtr);
77     int rank = temp->getDataPointRank();
78     if (i<0 || i>=rank) {
79     return 1;
80     } else {
81     const escript::DataArrayView::ShapeType view=temp->getDataPointShape();
82     return view[i];
83     }
84     }
85 jgs 82 }
86    
87     int getDataPointSize(struct escriptDataC* data)
88     {
89     escript::Data* temp=(escript::Data*)(data->m_dataPtr);
90     return temp->getDataPointSize();
91     }
92    
93     int getLength(struct escriptDataC* data)
94     {
95     escript::Data* temp=(escript::Data*)(data->m_dataPtr);
96     return temp->getLength();
97     }
98    
99     int isExpanded(struct escriptDataC* data)
100     {
101     if (data == (struct escriptDataC*)0) {
102     return false;
103     } else {
104     escript::Data* temp=(escript::Data*)(data->m_dataPtr);
105     if (temp->isEmpty()) {
106     return false;
107     } else {
108     return temp->isExpanded();
109     }
110     }
111     }
112    
113     int isEmpty(escriptDataC* data)
114     {
115     if (data == (struct escriptDataC*)0) {
116     return true;
117     } else {
118     escript::Data* temp=(escript::Data*)(data->m_dataPtr);
119     return temp->isEmpty();
120     }
121     }
122    
123    
124     double* getSampleData(struct escriptDataC* data, int sampleNo)
125     {
126     if (data == (struct escriptDataC*)0) {
127     return NULL;
128     } else {
129     escript::Data* temp=(escript::Data*)(data->m_dataPtr);
130     if (temp->isEmpty()) {
131     return NULL;
132     } else {
133     return temp->getSampleData(sampleNo);
134     }
135     }
136     }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26