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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/esys2/escript/src/Data/DataC.cpp revision 97 by jgs, Tue Dec 14 05:39:33 2004 UTC trunk/escript/src/DataC.cpp revision 969 by ksteube, Tue Feb 13 23:02:23 2007 UTC
# Line 1  Line 1 
1  // $Id$  // $Id$
2  /*  /*
3   ******************************************************************************   ************************************************************
4   *                                                                            *   *          Copyright 2006 by ACcESS MNRF                   *
5   *       COPYRIGHT  ACcESS 2004 -  All Rights Reserved                        *   *                                                          *
6   *                                                                            *   *              http://www.access.edu.au                    *
7   * This software is the property of ACcESS. No part of this code              *   *       Primary Business: Queensland, Australia            *
8   * may be copied in any form or by any means without the expressed written    *   *  Licensed under the Open Software License version 3.0    *
9   * consent of ACcESS.  Copying, use or modification of this software          *   *     http://www.opensource.org/licenses/osl-3.0.php       *
10   * by any unauthorised person is illegal unless that person has a software    *   *                                                          *
11   * license agreement with ACcESS.                                             *   ************************************************************
  *                                                                            *  
  ******************************************************************************  
12  */  */
13    
14  extern "C" {  extern "C" {
15  #include "escript/Data/DataC.h"  #include "DataC.h"
16  }  }
17    
18  #include "escript/Data/Data.h"  #include "Data.h"
19  #include "escript/Data/DataArrayView.h"  #include "DataArrayView.h"
20    
21  int getFunctionSpaceType(struct escriptDataC* data)  int getFunctionSpaceType(struct escriptDataC* data)
22  {  {
# Line 53  int numSamplesEqual(struct escriptDataC* Line 51  int numSamplesEqual(struct escriptDataC*
51          return true;          return true;
52       } else {       } else {
53          int result=(numDataPointsPerSample==temp->getNumDataPointsPerSample());          int result=(numDataPointsPerSample==temp->getNumDataPointsPerSample());
54        printf("ksteube NumDataPointsPerSample=%d NumSamples=%d\n", temp->getNumDataPointsPerSample(), temp->getNumSamples());
55          result=result && (numSamples==temp->getNumSamples());          result=result && (numSamples==temp->getNumSamples());
56          return result;          return result;
57       }       }
# Line 69  int getDataPointRank(struct escriptDataC Line 68  int getDataPointRank(struct escriptDataC
68    }    }
69  }  }
70    
71  int* getDataPointShape(struct escriptDataC* data)  int getDataPointShape(struct escriptDataC* data,int i)
72  {  {
73    escript::Data* temp=(escript::Data*)(data->m_dataPtr);    if (data == (struct escriptDataC*)0) {
74    const escript::DataArrayView::ShapeType view=temp->getDataPointShape();         return 0;
75    return (int*) &(view[0]);    } 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  }  }
86    
87  int getDataPointSize(struct escriptDataC* data)  int getDataPointSize(struct escriptDataC* data)

Legend:
Removed from v.97  
changed lines
  Added in v.969

  ViewVC Help
Powered by ViewVC 1.1.26