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

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

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

trunk/esys2/escript/src/Data/Data.cpp revision 151 by jgs, Thu Sep 22 01:55:00 2005 UTC trunk/escript/src/Data/Data.cpp revision 436 by gross, Thu Jan 19 22:36:36 2006 UTC
# Line 25  Line 25 
25  #include <functional>  #include <functional>
26  #include <math.h>  #include <math.h>
27    
28    #include <boost/python/dict.hpp>
29  #include <boost/python/str.hpp>  #include <boost/python/str.hpp>
30  #include <boost/python/extract.hpp>  #include <boost/python/extract.hpp>
31  #include <boost/python/long.hpp>  #include <boost/python/long.hpp>
32    #include <boost/python/tuple.hpp>
33    
34  #include "escript/Data/DataException.h"  #include "escript/Data/DataException.h"
35  #include "escript/Data/DataExpanded.h"  #include "escript/Data/DataExpanded.h"
# Line 879  Data::integrate() const Line 881  Data::integrate() const
881      }      }
882    }    }
883    if (rank==2) {    if (rank==2) {
884      bp_array.resize(shape[0],shape[1]);         bp_array.resize(shape[0],shape[1]);
885      for (int i=0; i<shape[0]; i++) {         for (int i=0; i<shape[0]; i++) {
886        for (int j=0; j<shape[1]; j++) {           for (int j=0; j<shape[1]; j++) {
887          index = i + shape[0] * j;             index = i + shape[0] * j;
888          bp_array[i,j] = integrals[index];             bp_array[make_tuple(i,j)] = integrals[index];
889        }           }
890      }         }
891    }    }
892    if (rank==3) {    if (rank==3) {
893      bp_array.resize(shape[0],shape[1],shape[2]);      bp_array.resize(shape[0],shape[1],shape[2]);
# Line 893  Data::integrate() const Line 895  Data::integrate() const
895        for (int j=0; j<shape[1]; j++) {        for (int j=0; j<shape[1]; j++) {
896          for (int k=0; k<shape[2]; k++) {          for (int k=0; k<shape[2]; k++) {
897            index = i + shape[0] * ( j + shape[1] * k );            index = i + shape[0] * ( j + shape[1] * k );
898            bp_array[i,j,k] = integrals[index];            bp_array[make_tuple(i,j,k)] = integrals[index];
899          }          }
900        }        }
901      }      }
# Line 905  Data::integrate() const Line 907  Data::integrate() const
907          for (int k=0; k<shape[2]; k++) {          for (int k=0; k<shape[2]; k++) {
908            for (int l=0; l<shape[3]; l++) {            for (int l=0; l<shape[3]; l++) {
909              index = i + shape[0] * ( j + shape[1] * ( k + shape[2] * l ) );              index = i + shape[0] * ( j + shape[1] * ( k + shape[2] * l ) );
910              bp_array[i,j,k,l] = integrals[index];              bp_array[make_tuple(i,j,k,l)] = integrals[index];
911            }            }
912          }          }
913        }        }
# Line 1026  Data::atanh() const Line 1028  Data::atanh() const
1028  }  }
1029    
1030  Data  Data
1031  Data::log() const  Data::log10() const
1032  {  {
1033  #if defined DOPROF  #if defined DOPROF
1034    profData->unary++;    profData->unary++;
# Line 1035  Data::log() const Line 1037  Data::log() const
1037  }  }
1038    
1039  Data  Data
1040  Data::ln() const  Data::log() const
1041  {  {
1042  #if defined DOPROF  #if defined DOPROF
1043    profData->unary++;    profData->unary++;
# Line 1173  Data::minval() const Line 1175  Data::minval() const
1175  }  }
1176    
1177  Data  Data
 Data::length() const  
 {  
 #if defined DOPROF  
   profData->reduction2++;  
 #endif  
   Length len_func;  
   return dp_algorithm(len_func,0);  
 }  
   
 Data  
1178  Data::trace() const  Data::trace() const
1179  {  {
1180  #if defined DOPROF  #if defined DOPROF
# Line 1263  Data::calc_mindp(int& SampleNo, Line 1255  Data::calc_mindp(int& SampleNo,
1255  void  void
1256  Data::saveDX(std::string fileName) const  Data::saveDX(std::string fileName) const
1257  {  {
1258    getDomain().saveDX(fileName,*this);    boost::python::dict args;
1259      args["data"]=boost::python::object(this);
1260      getDomain().saveDX(fileName,args);
1261    return;    return;
1262  }  }
1263    
1264  void  void
1265  Data::saveVTK(std::string fileName) const  Data::saveVTK(std::string fileName) const
1266  {  {
1267    getDomain().saveVTK(fileName,*this);    boost::python::dict args;
1268      args["data"]=boost::python::object(this);
1269      getDomain().saveVTK(fileName,args);
1270    return;    return;
1271  }  }
1272    

Legend:
Removed from v.151  
changed lines
  Added in v.436

  ViewVC Help
Powered by ViewVC 1.1.26