escript  Revision_
Data.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2020 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Apache License, version 2.0
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014-2017 by Centre for Geoscience Computing (GeoComp)
14 * Development from 2019 by School of Earth and Environmental Sciences
15 **
16 *****************************************************************************/
17 
20 #ifndef __ESCRIPT_DATA_H__
21 #define __ESCRIPT_DATA_H__
22 
23 #include "system_dep.h"
24 #include "DataAbstract.h"
25 #include "DataException.h"
26 #include "DataTypes.h"
27 #include "EsysMPI.h"
28 #include "FunctionSpace.h"
29 #include "DataVectorOps.h"
30 #include <algorithm>
31 #include <string>
32 #include <sstream>
33 
34 #include <boost/python/object.hpp>
35 #include <boost/python/tuple.hpp>
36 #include <boost/math/special_functions/bessel.hpp>
37 
38 #ifndef ESCRIPT_MAX_DATA_RANK
39 #define ESCRIPT_MAX_DATA_RANK 4
40 #endif
41 
42 namespace escript {
43 
44 //
45 // Forward declaration for various implementations of Data.
46 class DataConstant;
47 class DataTagged;
48 class DataExpanded;
49 class DataLazy;
50 
65 
66  public:
67 
77  Data();
78 
84  Data(const Data& inData);
85 
92  Data(const Data& inData,
93  const FunctionSpace& what);
94 
98  Data(const DataTypes::RealVectorType& value,
99  const DataTypes::ShapeType& shape,
100  const FunctionSpace& what,
101  bool expanded);
102 
114  Data(DataTypes::real_t value,
115  const DataTypes::ShapeType& dataPointShape,
116  const FunctionSpace& what,
117  bool expanded);
118 
130  explicit
131  Data(DataTypes::cplx_t value,
132  const DataTypes::ShapeType& dataPointShape,
133  const FunctionSpace& what,
134  bool expanded);
135 
143  Data(const Data& inData,
144  const DataTypes::RegionType& region);
145 
146 
157  Data(const WrappedArray& w, const FunctionSpace& what,
158  bool expanded);
159 
160 
170  Data(const boost::python::object& value,
171  const Data& other);
172 
193  Data(boost::python::object value,
194  boost::python::object par1=boost::python::object(),
195  boost::python::object par2=boost::python::object(),
196  boost::python::object par3=boost::python::object());
197 
198 
199 
200 
201 
206  explicit Data(DataAbstract* underlyingdata);
207 
211  explicit Data(DataAbstract_ptr underlyingdata);
212 
217  ~Data();
218 
222  void
223  copy(const Data& other);
224 
228  Data
229  copySelf() const;
230 
231 
235  Data
236  delay();
237 
241  void
242  delaySelf();
243 
244 
254  void
255  setProtection();
256 
262  bool
263  isProtected() const;
264 
265 
270  const boost::python::object
271  getValueOfDataPointAsTuple(int dataPointNo);
272 
277  void
278  setValueOfDataPointToPyObject(int dataPointNo, const boost::python::object& py_object);
279 
284  void
285  setValueOfDataPointToArray(int dataPointNo, const boost::python::object&);
286 
291  void
292  setValueOfDataPoint(int dataPointNo, const DataTypes::real_t);
293 
294  void
295  setValueOfDataPointC(int dataPointNo, const DataTypes::cplx_t);
296 
297 
301  const boost::python::object
302  getValueOfGlobalDataPointAsTuple(int procNo, int dataPointNo);
303 
304 
308  void
309  setTupleForGlobalDataPoint(int id, int proc, boost::python::object);
310 
316  int
317  getTagNumber(int dpno);
318 
319 
324  std::string
325  toString() const;
326 
331  void
332  expand();
333 
340  void
341  tag();
342 
347  void
348  resolve();
349 
355  bool
356  hasNaN();
357 
361  void
362  replaceNaN(DataTypes::real_t value);
363 
367  void
368  replaceNaN(DataTypes::cplx_t value);
369 
373  void
374  replaceNaNPython(boost::python::object obj);
375 
376  bool
377  hasInf();
378 
379  void
380  replaceInf(DataTypes::real_t value);
381 
382  void
383  replaceInf(DataTypes::cplx_t value);
384 
385  void
386  replaceInfPython(boost::python::object obj);
387 
388 
396  void
397  requireWrite();
398 
404  bool
405  isExpanded() const;
406 
412  bool
413  actsExpanded() const;
414 
415 
420  bool
421  isTagged() const;
422 
427  bool
428  isConstant() const;
429 
433  bool
434  isLazy() const;
435 
439  bool
440  isReady() const;
441 
447  bool
448  isEmpty() const;
449 
454  bool
455  isComplex() const;
456 
461  inline
462  const FunctionSpace&
464  {
465  return m_data->getFunctionSpace();
466  }
467 
472  inline
475  {
476  // This is exposed to Python as [Data object].getX()
477  return m_data->getFunctionSpace().getX();
478  }
479 
484  inline
485 // const AbstractDomain&
487  getDomain() const
488  {
489  return getFunctionSpace().getDomain();
490  }
491 
492 
498  inline
499 // const AbstractDomain&
500  Domain_ptr
502  {
503  return getFunctionSpace().getDomainPython();
504  }
505 
510  inline
511  unsigned int
513  {
514  return m_data->getRank();
515  }
516 
521  inline
522  int
524  {
525  return getNumSamples() * getNumDataPointsPerSample();
526  }
531  inline
532  int
534  {
535  return m_data->getNumSamples();
536  }
537 
542  inline
543  int
545  {
546  return m_data->getNumDPPSample();
547  }
548 
554  inline
555  bool numSamplesEqual(int numDataPointsPerSample, int numSamples) const
556  {
557  return (isEmpty() ||
558  (numDataPointsPerSample==getNumDataPointsPerSample() && numSamples==getNumSamples()));
559  }
560 
566  inline
567  bool isDataPointShapeEqual(int rank, const int* dimensions) const
568  {
569  if (isEmpty())
570  return true;
571  const DataTypes::ShapeType givenShape(&dimensions[0],&dimensions[rank]);
572  return (getDataPointShape()==givenShape);
573  }
574 
579  int
580  getNoValues() const
581  {
582  return m_data->getNoValues();
583  }
584 
585 
590  void
591  dump(const std::string fileName) const;
592 
599  const boost::python::object
600  toListOfTuples(bool scalarastuple=true);
601 
602 
610  const DataTypes::real_t*
611  getSampleDataRO(DataTypes::RealVectorType::size_type sampleNo, DataTypes::real_t dummy=0) const;
612 
613  const DataTypes::cplx_t*
615 
616 
625  getSampleDataRW(DataTypes::RealVectorType::size_type sampleNo, DataTypes::real_t dummy=0);
626 
629 
630 
631 
638  const DataTypes::real_t*
639  getDataRO(DataTypes::real_t dummy=0) const;
640 
641  const DataTypes::cplx_t*
642  getDataRO(DataTypes::cplx_t dummy) const;
643 
644 
645 
652  inline
655  {
656  return m_data->getSampleDataByTag(tag, dummy);
657  }
658 
659  inline
662  {
663  return m_data->getSampleDataByTag(tag, dummy);
664  }
665 
666 
674  getDataPointRO(int sampleNo, int dataPointNo);
675 
683  getDataPointRW(int sampleNo, int dataPointNo);
684 
685 
686 
691  inline
693  getDataOffset(int sampleNo,
694  int dataPointNo)
695  {
696  return m_data->getPointOffset(sampleNo,dataPointNo);
697  }
698 
703  inline
704  const DataTypes::ShapeType&
706  {
707  return m_data->getShape();
708  }
709 
714  const boost::python::tuple
715  getShapeTuple() const;
716 
721  long
722  getShapeProduct() const;
723 
724 
730  int
731  getDataPointSize() const;
732 
738  getLength() const;
739 
744  bool
745  hasNoSamples() const
746  {
747  return m_data->getNumSamples()==0;
748  }
749 
758  void
759  setTaggedValueByName(std::string name,
760  const boost::python::object& value);
761 
771  void
772  setTaggedValue(int tagKey,
773  const boost::python::object& value);
774 
785  void
786  setTaggedValueFromCPP(int tagKey,
787  const DataTypes::ShapeType& pointshape,
788  const DataTypes::RealVectorType& value,
789  int dataOffset=0);
790 
791 
792  void
793  setTaggedValueFromCPP(int tagKey,
794  const DataTypes::ShapeType& pointshape,
795  const DataTypes::CplxVectorType& value,
796  int dataOffset=0);
797 
802  void
803  copyWithMask(const Data& other,
804  const Data& mask);
805 
815  void
816  setToZero();
817 
824  Data
825  interpolate(const FunctionSpace& functionspace) const;
826 
827  Data
828  interpolateFromTable3D(const WrappedArray& table, DataTypes::real_t Amin, DataTypes::real_t Astep,
829  DataTypes::real_t undef, Data& B, DataTypes::real_t Bmin, DataTypes::real_t Bstep, Data& C,
830  DataTypes::real_t Cmin, DataTypes::real_t Cstep, bool check_boundaries);
831 
832  Data
833  interpolateFromTable2D(const WrappedArray& table, DataTypes::real_t Amin, DataTypes::real_t Astep,
834  DataTypes::real_t undef, Data& B, DataTypes::real_t Bmin, DataTypes::real_t Bstep,bool check_boundaries);
835 
836  Data
837  interpolateFromTable1D(const WrappedArray& table, DataTypes::real_t Amin, DataTypes::real_t Astep,
838  DataTypes::real_t undef,bool check_boundaries);
839 
840 
841  Data
842  interpolateFromTable3DP(boost::python::object table, DataTypes::real_t Amin, DataTypes::real_t Astep,
843  Data& B, DataTypes::real_t Bmin, DataTypes::real_t Bstep, Data& C, DataTypes::real_t Cmin, DataTypes::real_t Cstep, DataTypes::real_t undef,bool check_boundaries);
844 
845 
846  Data
847  interpolateFromTable2DP(boost::python::object table, DataTypes::real_t Amin, DataTypes::real_t Astep,
848  Data& B, DataTypes::real_t Bmin, DataTypes::real_t Bstep, DataTypes::real_t undef,bool check_boundaries);
849 
850  Data
851  interpolateFromTable1DP(boost::python::object table, DataTypes::real_t Amin, DataTypes::real_t Astep,
852  DataTypes::real_t undef,bool check_boundaries);
853 
854  Data
855  nonuniforminterp(boost::python::object in, boost::python::object out, bool check_boundaries);
856 
857  Data
858  nonuniformslope(boost::python::object in, boost::python::object out, bool check_boundaries);
859 
866  Data
867  gradOn(const FunctionSpace& functionspace) const;
868 
869  Data
870  grad() const;
871 
876  boost::python::object
877  integrateToTuple_const() const;
878 
879 
884  boost::python::object
885  integrateToTuple();
886 
887 
888 
894  Data
895  oneOver() const;
901  Data
902  wherePositive() const;
903 
909  Data
910  whereNegative() const;
911 
917  Data
918  whereNonNegative() const;
919 
925  Data
926  whereNonPositive() const;
927 
933  Data
934  whereZero(DataTypes::real_t tol=0.0) const;
935 
941  Data
942  whereNonZero(DataTypes::real_t tol=0.0) const;
943 
956  Lsup();
957 
959  Lsup_const() const;
960 
961 
974  sup();
975 
977  sup_const() const;
978 
979 
992  inf();
993 
995  inf_const() const;
996 
997 
998 
1004  Data
1005  abs() const;
1006 
1012  Data
1013  phase() const;
1014 
1015 
1021  Data
1022  maxval() const;
1023 
1029  Data
1030  minval() const;
1031 
1039  const boost::python::tuple
1040  minGlobalDataPoint() const;
1041 
1049  const boost::python::tuple
1050  maxGlobalDataPoint() const;
1051 
1052 
1053 
1060  Data
1061  sign() const;
1062 
1068  Data
1069  symmetric() const;
1070 
1076  Data
1077  antisymmetric() const;
1078 
1079 
1085  Data
1086  hermitian() const;
1087 
1093  Data
1094  antihermitian() const;
1095 
1101  Data
1102  trace(int axis_offset) const;
1103 
1109  Data
1110  transpose(int axis_offset) const;
1111 
1118  Data
1119  eigenvalues() const;
1120 
1130  const boost::python::tuple
1131  eigenvalues_and_eigenvectors(const DataTypes::real_t tol=1.e-12) const;
1132 
1138  Data
1139  swapaxes(const int axis0, const int axis1) const;
1140 
1146  Data
1147  erf() const;
1148 
1149 
1155  Data
1156  conjugate() const;
1157 
1158  Data
1159  real() const;
1160 
1161  Data
1162  imag() const;
1163 
1169  Data
1170  sin() const;
1171 
1177  Data
1178  cos() const;
1179 
1185  Data
1186  bessel(int order, DataTypes::real_t (*besselfunc) (int,DataTypes::real_t) );
1187 
1188 
1194  Data
1195  besselFirstKind(int order);
1196 
1202  Data
1203  besselSecondKind(int order);
1204 
1205 
1211  Data
1212  tan() const;
1213 
1219  Data
1220  asin() const;
1221 
1227  Data
1228  acos() const;
1229 
1235  Data
1236  atan() const;
1237 
1243  Data
1244  sinh() const;
1245 
1251  Data
1252  cosh() const;
1253 
1259  Data
1260  tanh() const;
1261 
1267  Data
1268  asinh() const;
1269 
1275  Data
1276  acosh() const;
1277 
1283  Data
1284  atanh() const;
1285 
1291  Data
1292  log10() const;
1293 
1299  Data
1300  log() const;
1301 
1307  Data
1308  exp() const;
1309 
1315  Data
1316  sqrt() const;
1317 
1323  Data
1324  neg() const;
1325 
1332  Data
1333  pos() const;
1334 
1342  Data
1343  powD(const Data& right) const;
1344 
1352  Data
1353  powO(const boost::python::object& right) const;
1354 
1363  Data
1364  rpowO(const boost::python::object& left) const;
1365 
1372  Data& operator+=(const Data& right);
1373  Data& operator+=(const boost::python::object& right);
1374 
1375  Data& operator=(const Data& other);
1376 
1383  Data& operator-=(const Data& right);
1384  Data& operator-=(const boost::python::object& right);
1385 
1392  Data& operator*=(const Data& right);
1393  Data& operator*=(const boost::python::object& right);
1394 
1401  Data& operator/=(const Data& right);
1402  Data& operator/=(const boost::python::object& right);
1403 
1408  Data truedivD(const Data& right);
1409 
1414  Data truedivO(const boost::python::object& right);
1415 
1420  Data rtruedivO(const boost::python::object& left);
1421 
1426  boost::python::object __add__(const boost::python::object& right);
1427 
1428 
1433  boost::python::object __sub__(const boost::python::object& right);
1434 
1439  boost::python::object __rsub__(const boost::python::object& right);
1440 
1445  boost::python::object __mul__(const boost::python::object& right);
1446 
1451  boost::python::object __div__(const boost::python::object& right);
1452 
1457  boost::python::object __rdiv__(const boost::python::object& right);
1458 
1462  Data
1463  matrixInverse() const;
1464 
1469  bool
1470  probeInterpolation(const FunctionSpace& functionspace) const;
1471 
1487  Data
1488  getItem(const boost::python::object& key) const;
1489 
1501  void
1502  setItemD(const boost::python::object& key,
1503  const Data& value);
1504 
1505  void
1506  setItemO(const boost::python::object& key,
1507  const boost::python::object& value);
1508 
1509  // These following public methods should be treated as private.
1510 
1516  template <class UnaryFunction>
1517  inline
1518  void
1519  unaryOp2(UnaryFunction operation);
1520 
1528  Data
1529  getSlice(const DataTypes::RegionType& region) const;
1530 
1539  void
1540  setSlice(const Data& value,
1541  const DataTypes::RegionType& region);
1542 
1547  void
1548  print(void);
1549 
1556  int
1557  get_MPIRank(void) const;
1558 
1565  int
1566  get_MPISize(void) const;
1567 
1573  MPI_Comm
1574  get_MPIComm(void) const;
1575 
1581  DataAbstract*
1582  borrowData(void) const;
1583 
1585  borrowDataPtr(void) const;
1586 
1588  borrowReadyPtr(void) const;
1589 
1590 
1591 
1600  getDataAtOffsetRO(DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy);
1601 
1603  getDataAtOffsetRW(DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy);
1604 
1607 
1610 
1611 
1622  getExpandedVectorReference(DataTypes::real_t dummy=0);
1623 
1625  getExpandedVectorReference(DataTypes::cplx_t dummy);
1626 
1627 
1632  size_t
1633  getNumberOfTaggedValues() const;
1634 
1635  /*
1636  * \brief make the data complex
1637  */
1638  void complicate();
1639 
1640  protected:
1641 
1642  private:
1643  void init_from_data_and_fs(const Data& inData,
1644  const FunctionSpace& functionspace);
1645 
1646  template <typename S>
1647  void
1648  maskWorker(Data& other2, Data& mask2, S sentinel);
1649 
1650  template <class BinaryOp>
1652 #ifdef ESYS_MPI
1653  lazyAlgWorker(DataTypes::real_t init, MPI_Op mpiop_type);
1654 #else
1656 #endif
1657 
1659  LsupWorker() const;
1660 
1662  supWorker() const;
1663 
1665  infWorker() const;
1666 
1667  template<typename Scalar>
1668  boost::python::object
1670 
1671  void
1672  calc_minGlobalDataPoint(int& ProcNo, int& DataPointNo) const;
1673 
1674  void
1675  calc_maxGlobalDataPoint(int& ProcNo, int& DataPointNo) const;
1676 
1677  // For internal use in Data.cpp only!
1678  // other uses should call the main entry points and allow laziness
1679  Data
1680  minval_nonlazy() const;
1681 
1682  // For internal use in Data.cpp only!
1683  Data
1684  maxval_nonlazy() const;
1685 
1686 
1693  inline
1694  void
1695  operandCheck(const Data& right) const
1696  {
1697  return m_data->operandCheck(*(right.m_data.get()));
1698  }
1699 
1705  template <class BinaryFunction>
1706  inline
1708  reduction(BinaryFunction operation,
1709  DataTypes::real_t initial_value) const;
1710 
1718  template <class BinaryFunction>
1719  inline
1720  Data
1721  dp_algorithm(BinaryFunction operation,
1722  DataTypes::real_t initial_value) const;
1723 
1729  void
1730  typeMatchLeft(Data& right) const;
1731 
1737  void
1738  typeMatchRight(const Data& right);
1739 
1745  void
1746  initialise(const DataTypes::RealVectorType& value,
1747  const DataTypes::ShapeType& shape,
1748  const FunctionSpace& what,
1749  bool expanded);
1750 
1751  void
1752  initialise(const DataTypes::CplxVectorType& value,
1753  const DataTypes::ShapeType& shape,
1754  const FunctionSpace& what,
1755  bool expanded);
1756 
1757  void
1758  initialise(const WrappedArray& value,
1759  const FunctionSpace& what,
1760  bool expanded);
1761 
1762  void
1763  initialise(const DataTypes::real_t value,
1764  const DataTypes::ShapeType& shape,
1765  const FunctionSpace& what,
1766  bool expanded);
1767 
1768  void
1769  initialise(const DataTypes::cplx_t value,
1770  const DataTypes::ShapeType& shape,
1771  const FunctionSpace& what,
1772  bool expanded);
1773  //
1774  // flag to protect the data object against any update
1776  bool m_lazy;
1777 
1778  //
1779  // pointer to the actual data object
1780 // boost::shared_ptr<DataAbstract> m_data;
1782 
1783 // If possible please use getReadyPtr instead.
1784 // But see warning below.
1785  const DataReady*
1786  getReady() const
1787 {
1788  const DataReady* dr=dynamic_cast<const DataReady*>(m_data.get());
1789  ESYS_ASSERT(dr!=0, "error casting to DataReady.");
1790  return dr;
1791 }
1792 
1793  DataReady*
1795 {
1796  DataReady* dr=dynamic_cast<DataReady*>(m_data.get());
1797  ESYS_ASSERT(dr!=0, "error casting to DataReady.");
1798  return dr;
1799 }
1800 
1801 
1802 // Be wary of using this for local operations since it (temporarily) increases reference count.
1803 // If you are just using this to call a method on DataReady instead of DataAbstract consider using
1804 // getReady() instead
1807 {
1808  DataReady_ptr dr=REFCOUNTNS::dynamic_pointer_cast<DataReady>(m_data);
1809  ESYS_ASSERT(dr.get()!=0, "error casting to DataReady.");
1810  return dr;
1811 }
1812 
1814  getReadyPtr() const
1815 {
1816  const_DataReady_ptr dr=REFCOUNTNS::dynamic_pointer_cast<const DataReady>(m_data);
1817  ESYS_ASSERT(dr.get()!=0, "error casting to DataReady.");
1818  return dr;
1819 }
1820 
1821  // In the isShared() method below:
1822  // A problem would occur if m_data (the address pointed to) were being modified
1823  // while the call m_data->is_shared is being executed.
1824  //
1825  // Q: So why do I think this code can be thread safe/correct?
1826  // A: We need to make some assumptions.
1827  // 1. We assume it is acceptable to return true under some conditions when we aren't shared.
1828  // 2. We assume that no constructions or assignments which will share previously unshared
1829  // will occur while this call is executing. This is consistent with the way Data:: and C are written.
1830  //
1831  // This means that the only transition we need to consider, is when a previously shared object is
1832  // not shared anymore. ie. the other objects have been destroyed or a deep copy has been made.
1833  // In those cases the m_shared flag changes to false after m_data has completed changing.
1834  // For any threads executing before the flag switches they will assume the object is still shared.
1835  bool isShared() const
1836  {
1837 #ifdef SLOWSHARECHECK
1838  return m_data->isShared(); // single threadsafe check for this
1839 #else
1840  return !m_data.unique();
1841 #endif
1842  }
1843 
1845  {
1846  if (isLazy())
1847  {
1848  #ifdef _OPENMP
1849  if (omp_in_parallel())
1850  { // Yes this is throwing an exception out of an omp thread which is forbidden.
1851  throw DataException("Please do not call forceResolve() in a parallel region.");
1852  }
1853  #endif
1854  resolve();
1855  }
1856  }
1857 
1863  {
1864 #ifdef _OPENMP
1865  if (omp_in_parallel())
1866  {
1867  throw DataException("Programming error. Please do not run exclusiveWrite() in multi-threaded sections.");
1868  }
1869 #endif
1870  forceResolve();
1871  if (isShared())
1872  {
1873  DataAbstract* t=m_data->deepCopy();
1874  set_m_data(DataAbstract_ptr(t));
1875  }
1876 #ifdef EXWRITECHK
1877  m_data->exclusivewritecalled=true;
1878 #endif
1879  }
1880 
1885  {
1886  if (isLazy() || isShared())
1887  {
1888  std::ostringstream oss;
1889  oss << "Programming error. ExclusiveWrite required - please call requireWrite() isLazy=" << isLazy() << " isShared()=" << isShared();
1890  throw DataException(oss.str());
1891  }
1892  }
1893 
1900  void set_m_data(DataAbstract_ptr p);
1901 
1902 
1903  void TensorSelfUpdateBinaryOperation(const Data& right, escript::ES_optype operation);
1904 
1905  friend class DataAbstract; // To allow calls to updateShareStatus
1906  friend class TestDomain; // so its getX will work quickly
1907 #ifdef IKNOWWHATIMDOING
1908  friend Data applyBinaryCFunction(boost::python::object cfunc, boost::python::tuple shape, escript::Data& d, escript::Data& e);
1909 #endif
1910  template <typename S>
1911  friend Data condEvalWorker(escript::Data& mask, escript::Data& trueval, escript::Data& falseval, S sentinel);
1912  friend ESCRIPT_DLL_API Data randomData(const boost::python::tuple& shape, const FunctionSpace& what, long seed, const boost::python::tuple& filter);
1913 
1914 };
1915 
1916 
1917 #ifdef IKNOWWHATIMDOING
1918 Data
1919 applyBinaryCFunction(boost::python::object func, boost::python::tuple shape, escript::Data& d, escript::Data& e);
1920 #endif
1921 
1923 Data
1924 condEval(escript::Data& mask, escript::Data& trueval, escript::Data& falseval);
1925 
1926 
1927 
1932 Data randomData(const boost::python::tuple& shape,
1933  const FunctionSpace& what,
1934  long seed, const boost::python::tuple& filter);
1935 
1936 
1937 } // end namespace escript
1938 
1939 
1940 // No, this is not supposed to be at the top of the file
1941 // DataAbstact needs to be declared first, then DataReady needs to be fully declared
1942 // so that I can dynamic cast between them below.
1943 #include "DataReady.h"
1944 #include "DataLazy.h"
1945 #include "DataExpanded.h"
1946 #include "DataConstant.h"
1947 #include "DataTagged.h"
1948 
1949 namespace escript
1950 {
1951 
1952 
1953 
1954 inline
1957 {
1958  if (isLazy())
1959  {
1960  throw DataException("Error, attempt to acquire RW access to lazy data. Please call requireWrite() first.");
1961  }
1962 #ifdef EXWRITECHK
1963  if (!getReady()->exclusivewritecalled)
1964  {
1965  throw DataException("Error, call to Data::getSampleDataRW without a preceeding call to requireWrite/exclusiveWrite.");
1966  }
1967 #endif
1968  return getReady()->getSampleDataRW(sampleNo, dummy);
1969 }
1970 
1971 inline
1974 {
1975  if (isLazy())
1976  {
1977  throw DataException("Error, attempt to acquire RW access to lazy data. Please call requireWrite() first.");
1978  }
1979 #ifdef EXWRITECHK
1980  if (!getReady()->exclusivewritecalled)
1981  {
1982  throw DataException("Error, call to Data::getSampleDataRW without a preceeding call to requireWrite/exclusiveWrite.");
1983  }
1984 #endif
1985  return getReady()->getSampleDataRW(sampleNo, dummy);
1986 }
1987 
1988 
1989 inline
1990 const DataTypes::real_t*
1992 {
1993  DataLazy* l=dynamic_cast<DataLazy*>(m_data.get());
1994  if (l!=0)
1995  {
1996  size_t offset=0;
1997  const DataTypes::RealVectorType* res=l->resolveSample(sampleNo,offset);
1998  return &((*res)[offset]);
1999  }
2000  return getReady()->getSampleDataRO(sampleNo, dummy);
2001 }
2002 
2003 inline
2004 const DataTypes::cplx_t*
2006 {
2007  DataLazy* l=dynamic_cast<DataLazy*>(m_data.get());
2008  if (l!=0)
2009  {
2010  throw DataException("Programming error: complex lazy objects are not supported.");
2011  }
2012  return getReady()->getSampleDataRO(sampleNo, dummy);
2013 }
2014 
2015 
2016 inline
2017 const DataTypes::real_t*
2019 {
2020  if (isLazy())
2021  {
2022  throw DataException("Programmer error - getDataRO must not be called on Lazy Data.");
2023  }
2024  if (getNumSamples()==0)
2025  {
2026  return 0;
2027  }
2028  else
2029  {
2030  return &(getReady()->getTypedVectorRO(0)[0]);
2031  }
2032 }
2033 
2034 inline
2035 const DataTypes::cplx_t*
2037 {
2038  if (isLazy())
2039  {
2040  throw DataException("Programmer error - getDataRO must not be called on Lazy Data.");
2041  }
2042  if (getNumSamples()==0)
2043  {
2044  return 0;
2045  }
2046  else
2047  {
2048  return &(getReady()->getTypedVectorRO(dummy)[0]);
2049  }
2050 }
2051 
2052 
2057 {
2058  return pow(y,x);
2059 }
2060 
2067 Data operator+(const Data& left, const Data& right);
2068 
2075 Data operator-(const Data& left, const Data& right);
2076 
2083 Data operator*(const Data& left, const Data& right);
2084 
2091 Data operator/(const Data& left, const Data& right);
2092 
2100 Data operator+(const Data& left, const boost::python::object& right);
2101 
2109 Data operator-(const Data& left, const boost::python::object& right);
2110 
2118 Data operator*(const Data& left, const boost::python::object& right);
2119 
2127 Data operator/(const Data& left, const boost::python::object& right);
2128 
2136 Data operator+(const boost::python::object& left, const Data& right);
2137 
2145 Data operator-(const boost::python::object& left, const Data& right);
2146 
2154 Data operator*(const boost::python::object& left, const Data& right);
2155 
2163 Data operator/(const boost::python::object& left, const Data& right);
2164 
2165 
2166 
2172 std::ostream& operator<<(std::ostream& o, const Data& data);
2173 
2183 Data
2184 C_GeneralTensorProduct(Data& arg_0,
2185  Data& arg_1,
2186  int axis_offset=0,
2187  int transpose=0);
2188 
2194 inline
2195 Data
2196 Data::truedivD(const Data& right)
2197 {
2198  return *this / right;
2199 }
2200 
2206 inline
2207 Data
2208 Data::truedivO(const boost::python::object& right)
2209 {
2210  Data tmp(right, getFunctionSpace(), false);
2211  return truedivD(tmp);
2212 }
2213 
2219 inline
2220 Data
2221 Data::rtruedivO(const boost::python::object& left)
2222 {
2223  Data tmp(left, getFunctionSpace(), false);
2224  return tmp.truedivD(*this);
2225 }
2226 
2227 
2228 
2236 template <class BinaryFunction>
2237 inline
2239 Data::reduction(BinaryFunction operation, DataTypes::real_t initial_value) const
2240 {
2241  if (isExpanded()) {
2242  DataExpanded* leftC=dynamic_cast<DataExpanded*>(m_data.get());
2243  ESYS_ASSERT(leftC!=0, "Programming error - casting to DataExpanded.");
2244 
2245  DataExpanded& data=*leftC;
2246  int i,j;
2247  int numDPPSample=data.getNumDPPSample();
2248  int numSamples=data.getNumSamples();
2249  DataTypes::real_t global_current_value=initial_value;
2250  DataTypes::real_t local_current_value;
2251  const auto& vec=data.getTypedVectorRO(typename BinaryFunction::first_argument_type(0));
2252  const DataTypes::ShapeType& shape=data.getShape();
2253  // calculate the reduction operation value for each data point
2254  // reducing the result for each data-point into the current_value variables
2255  #pragma omp parallel private(local_current_value)
2256  {
2257  local_current_value=initial_value;
2258  #pragma omp for private(i,j) schedule(static)
2259  for (i=0;i<numSamples;i++) {
2260  for (j=0;j<numDPPSample;j++) {
2261  local_current_value=operation(local_current_value,escript::reductionOpVector(vec,shape,data.getPointOffset(i,j),operation,initial_value));
2262 
2263  }
2264  }
2265  #pragma omp critical
2266  global_current_value=operation(global_current_value,local_current_value);
2267  }
2268  return global_current_value;
2269  } else if (isTagged()) {
2270  DataTagged* leftC=dynamic_cast<DataTagged*>(m_data.get());
2271  ESYS_ASSERT(leftC!=0, "Programming error - casting to DataTagged.");
2272 
2273  DataTagged& data=*leftC;
2274  DataTypes::real_t current_value=initial_value;
2275 
2276  const auto& vec=data.getTypedVectorRO(typename BinaryFunction::first_argument_type(0));
2277  const DataTypes::ShapeType& shape=data.getShape();
2278  const DataTagged::DataMapType& lookup=data.getTagLookup();
2279  const std::list<int> used=data.getFunctionSpace().getListOfTagsSTL();
2280  for (std::list<int>::const_iterator i=used.begin();i!=used.end();++i)
2281  {
2282  int tag=*i;
2283  DataTagged::DataMapType::const_iterator it=lookup.find(tag);
2284  if ((tag==0) || (it==lookup.end())) // check for the default tag
2285  {
2286  current_value=operation(current_value,escript::reductionOpVector(vec,shape,data.getDefaultOffset(),operation,initial_value));
2287  }
2288  else
2289  {
2290  current_value=operation(current_value,escript::reductionOpVector(vec,shape,it->second,operation,initial_value));
2291  }
2292  }
2293  return current_value;
2294  } else if (isConstant()) {
2295  DataConstant* leftC=dynamic_cast<DataConstant*>(m_data.get());
2296  ESYS_ASSERT(leftC!=0, "Programming error - casting to DataConstant.");
2297  return escript::reductionOpVector(leftC->getTypedVectorRO(typename BinaryFunction::first_argument_type(0)),leftC->getShape(),0,operation,initial_value);
2298  } else if (isEmpty()) {
2299  throw DataException("Error - Operations (algorithm) not permitted on instances of DataEmpty.");
2300  } else if (isLazy()) {
2301  throw DataException("Error - Operations not permitted on instances of DataLazy.");
2302  } else {
2303  throw DataException("Error - Data encapsulates an unknown type.");
2304  }
2305 }
2306 
2315 template <class BinaryFunction>
2316 inline
2317 Data
2318 Data::dp_algorithm(BinaryFunction operation, DataTypes::real_t initial_value) const
2319 {
2320  if (isEmpty()) {
2321  throw DataException("Error - Operations (dp_algorithm) not permitted on instances of DataEmpty.");
2322  }
2323  else if (isExpanded()) {
2325  DataExpanded* dataE=dynamic_cast<DataExpanded*>(m_data.get());
2326  DataExpanded* resultE=dynamic_cast<DataExpanded*>(result.m_data.get());
2327  ESYS_ASSERT(dataE!=0, "Programming error - casting data to DataExpanded.");
2328  ESYS_ASSERT(resultE!=0, "Programming error - casting result to DataExpanded.");
2329 
2330 
2331 
2332  int i,j;
2333  int numSamples=dataE->getNumSamples();
2334  int numDPPSample=dataE->getNumDPPSample();
2335  // DataArrayView dataView=data.getPointDataView();
2336  // DataArrayView resultView=result.getPointDataView();
2337  const auto& dataVec=dataE->getTypedVectorRO(initial_value);
2338  const DataTypes::ShapeType& shape=dataE->getShape();
2339  auto& resultVec=resultE->getTypedVectorRW(initial_value);
2340  // perform the operation on each data-point and assign
2341  // this to the corresponding element in result
2342  #pragma omp parallel for private(i,j) schedule(static)
2343  for (i=0;i<numSamples;i++) {
2344  for (j=0;j<numDPPSample;j++) {
2345  resultVec[resultE->getPointOffset(i,j)] =
2346  escript::reductionOpVector(dataVec, shape, dataE->getPointOffset(i,j),operation,initial_value);
2347 
2348  }
2349  }
2350  //escript::dp_algorithm(*dataE,*resultE,operation,initial_value);
2351  return result;
2352  }
2353  else if (isTagged()) {
2354  DataTagged* dataT=dynamic_cast<DataTagged*>(m_data.get());
2355  ESYS_ASSERT(dataT!=0, "Programming error - casting data to DataTagged.");
2356  DataTypes::RealVectorType defval(1);
2357  defval[0]=0;
2358  DataTagged* resultT=new DataTagged(getFunctionSpace(), DataTypes::scalarShape, defval, dataT);
2359 
2360 
2361  const DataTypes::ShapeType& shape=dataT->getShape();
2362  const auto& vec=dataT->getTypedVectorRO(initial_value);
2363  const DataTagged::DataMapType& lookup=dataT->getTagLookup();
2364  for (DataTagged::DataMapType::const_iterator i=lookup.begin(); i!=lookup.end(); i++) {
2365  resultT->getDataByTagRW(i->first,0) =
2366  escript::reductionOpVector(vec,shape,dataT->getOffsetForTag(i->first),operation,initial_value);
2367  }
2368  resultT->getTypedVectorRW(initial_value)[resultT->getDefaultOffset()] = escript::reductionOpVector(dataT->getTypedVectorRO(initial_value),dataT->getShape(),dataT->getDefaultOffset(),operation,initial_value);
2369 
2370 
2371 
2372 
2373  //escript::dp_algorithm(*dataT,*resultT,operation,initial_value);
2374  return Data(resultT); // note: the Data object now owns the resultT pointer
2375  }
2376  else if (isConstant()) {
2378  DataConstant* dataC=dynamic_cast<DataConstant*>(m_data.get());
2379  DataConstant* resultC=dynamic_cast<DataConstant*>(result.m_data.get());
2380  ESYS_ASSERT(dataC!=0, "Programming error - casting data to DataConstant.");
2381  ESYS_ASSERT(resultC!=0, "Programming error - casting result to DataConstant.");
2382 
2383  DataConstant& data=*dataC;
2384  resultC->getTypedVectorRW(initial_value)[0] =
2385  escript::reductionOpVector(data.getTypedVectorRO(initial_value),data.getShape(),0,operation,initial_value);
2386 
2387  //escript::dp_algorithm(*dataC,*resultC,operation,initial_value);
2388  return result;
2389  } else if (isLazy()) {
2390  throw DataException("Error - Operations not permitted on instances of DataLazy.");
2391  } else {
2392  throw DataException("Error - Data encapsulates an unknown type.");
2393  }
2394 }
2395 
2396 
2404 Data
2405 C_TensorBinaryOperation(Data const &arg_0,
2406  Data const &arg_1,
2407  ES_optype operation);
2408 
2409 
2410 Data
2411 C_TensorUnaryOperation(Data const &arg_0,
2412  escript::ES_optype operation,
2413  DataTypes::real_t tol=0);
2414 
2415 } // namespace escript
2416 
2417 #endif // __ESCRIPT_DATA_H__
escript::Data::getReady
const DataReady * getReady() const
Definition: Data.h:1786
escript::Data::interpolateFromTable3DP
Data interpolateFromTable3DP(boost::python::object table, DataTypes::real_t Amin, DataTypes::real_t Astep, Data &B, DataTypes::real_t Bmin, DataTypes::real_t Bstep, Data &C, DataTypes::real_t Cmin, DataTypes::real_t Cstep, DataTypes::real_t undef, bool check_boundaries)
Definition: Data.cpp:4733
escript::Data::maskWorker
void maskWorker(Data &other2, Data &mask2, S sentinel)
Definition: Data.cpp:954
escript::Data::isReady
bool isReady() const
Return true if this data is ready.
Definition: Data.cpp:1153
escript::DataReady::getDataAtOffsetRO
DataTypes::RealVectorType::const_reference getDataAtOffsetRO(DataTypes::RealVectorType::size_type i) const
get a reference to the beginning of a data point
Definition: DataReady.h:233
ESCRIPT_DLL_API
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:30
escript::Data::getNumDataPointsPerSample
int getNumDataPointsPerSample() const
Return the number of data points per sample.
Definition: Data.h:544
escript::MINVAL
@ MINVAL
Definition: ES_optype.h:72
escript::Data::getSlice
Data getSlice(const DataTypes::RegionType &region) const
Return a Data object containing the specified slice of this Data object.
Definition: Data.cpp:3478
escript::Data::isComplex
bool isComplex() const
True if components of this data are stored as complex.
Definition: Data.cpp:1160
escript::FMin
Return the minimum value of the two given values.
Definition: ArrayOps.h:77
escript::Data::borrowData
DataAbstract * borrowData(void) const
return the object produced by the factory, which is a DataConstant or DataExpanded TODO Ownership of ...
Definition: Data.cpp:4617
escript::SIGN
@ SIGN
Definition: ES_optype.h:53
escript::Data::erf
Data erf() const
Return the error function erf of each data point of this Data object.
Definition: Data.cpp:2111
escript::Data::getSampleDataByTag
DataTypes::real_t * getSampleDataByTag(int tag, DataTypes::real_t dummy=0)
Return the sample data for the given tag. If an attempt is made to access data that isn't tagged an e...
Definition: Data.h:654
escript::Data::sign
Data sign() const
Return the sign of each data point of this Data object. -1 for negative values, zero for zero values,...
Definition: Data.cpp:2153
escript::Data::m_lazy
bool m_lazy
Definition: Data.h:1776
escript::DataTypes::shapeToString
std::string shapeToString(const DataTypes::ShapeType &shape)
Return the given shape as a string.
Definition: DataTypes.cpp:117
escript::Data::oneOver
Data oneOver() const
Returns 1./ Data object.
Definition: Data.cpp:1246
escript::DataTypes::real_t
double real_t
type of all real-valued scalars in escript
Definition: DataTypes.h:52
escript::WrappedArray::getEltC
DataTypes::cplx_t getEltC() const
Definition: WrappedArray.h:147
MPI_Op
int MPI_Op
Definition: EsysMPI.h:46
escript::AbstractContinuousDomain::setToIntegrals
virtual void setToIntegrals(std::vector< DataTypes::real_t > &integrals, const escript::Data &arg) const
copies the integrals of the function defined by arg into integrals. arg has to be defined on this....
Definition: AbstractContinuousDomain.cpp:123
escript::DataTagged::getTagLookup
const DataMapType & getTagLookup() const
getTagLookup
Definition: DataTagged.h:762
escript::Data::atanh
Data atanh() const
Return the atanh of each data point of this Data object.
Definition: Data.cpp:2132
escript::Data::infWorker
DataTypes::real_t infWorker() const
Definition: Data.cpp:2576
escript::CONJ
@ CONJ
Definition: ES_optype.h:79
escript::Data::getDataAtOffsetRO
DataTypes::CplxVectorType::const_reference getDataAtOffsetRO(DataTypes::CplxVectorType::size_type i, DataTypes::cplx_t dummy)
escript::Data::atan
Data atan() const
Return the atan of each data point of this Data object.
Definition: Data.cpp:2082
escript::LZ
@ LZ
Definition: ES_optype.h:61
escript::DataTypes::DataVectorAlt< real_t >::const_reference
const ElementType & const_reference
Definition: DataVectorAlt.h:52
escript::DataReady::getSampleDataRO
const DataTypes::real_t * getSampleDataRO(DataTypes::RealVectorType::size_type sampleNo, DataTypes::real_t dummy=0) const
Definition: DataReady.h:218
escript::Data::rtruedivO
Data rtruedivO(const boost::python::object &left)
Newer style division operator for python.
Definition: Data.h:2221
escript::Data::getDataAtOffsetRO
DataTypes::RealVectorType::const_reference getDataAtOffsetRO(DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy)
Return a pointer to the beginning of the datapoint at the specified offset. TODO Eventually these sho...
Definition: Data.cpp:4686
escript::Data::antihermitian
Data antihermitian() const
Return the anti-hermitian part of a matrix which is half the matrix minus its hermitian.
Definition: Data.cpp:2804
escript::Data::setToZero
void setToZero()
set all values to zero
Definition: Data.cpp:815
escript::Data::cos
Data cos() const
Return the cos of each data point of this Data object.
Definition: Data.cpp:2053
escript::DataTagged::addTag
void addTag(int tagKey)
addTag - does not modify the default value for this object. ** Not unit tested **
Definition: DataTagged.cpp:685
escript::Data::Lsup
DataTypes::real_t Lsup()
Return the maximum absolute value of this Data object.
Definition: Data.cpp:2211
FunctionSpaceFactory.h
escript::Data::grad
Data grad() const
Definition: Data.cpp:1350
escript::COSH
@ COSH
Definition: ES_optype.h:45
escript::Data::requireWrite
void requireWrite()
Ensures data is ready for write access. This means that the data will be resolved if lazy and will be...
Definition: Data.cpp:1239
escript::DataLazy::resolveSample
const DataTypes::RealVectorType * resolveSample(int sampleNo, size_t &roffset) const
Compute the value of the expression for the given sample.
Definition: DataLazy.cpp:2336
escript::WrappedArray::getElt
DataTypes::real_t getElt() const
Definition: WrappedArray.h:89
escript::Data::setValueOfDataPoint
void setValueOfDataPoint(int dataPointNo, const DataTypes::real_t)
sets the values of a data-point on this process
Definition: Data.cpp:1655
escript::Data::print
void print(void)
print the data values to stdout. Used for debugging
Definition: Data.cpp:5383
escript::FMax
Return the maximum value of the two given values.
Definition: ArrayOps.h:62
escript::DataReady::getVectorRO
virtual const DataTypes::RealVectorType & getVectorRO() const =0
escript::DataConstant::getTypedVectorRO
virtual const DataTypes::RealVectorType & getTypedVectorRO(DataTypes::real_t dummy) const
Definition: DataConstant.cpp:872
escript::DataTagged::getDataByTagRW
DataTypes::RealVectorType::reference getDataByTagRW(int tag, DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0)
getDataByTag
Definition: DataTagged.cpp:1017
escript::Data::replaceNaN
void replaceNaN(DataTypes::real_t value)
replaces all NaN values with value
Definition: Data.cpp:2396
escript::Data::whereNonNegative
Data whereNonNegative() const
Return a Data with a 1 for +ive or 0 values and a 0 for -ive values.
Definition: Data.cpp:1275
escript::Data::tan
Data tan() const
Return the tan of each data point of this Data object.
Definition: Data.cpp:2060
escript::antihermitian
void antihermitian(const DataTypes::CplxVectorType &in, const DataTypes::ShapeType &inShape, typename DataTypes::CplxVectorType::size_type inOffset, DataTypes::CplxVectorType &ev, const DataTypes::ShapeType &evShape, typename DataTypes::CplxVectorType::size_type evOffset)
computes a antihermitian matrix from your square matrix A: (A - adjoint(A)) / 2
Definition: DataVectorOps.cpp:963
escript::Data::tag
void tag()
If possible convert this Data to DataTagged. This will only allow Constant data to be converted to ta...
Definition: Data.cpp:1204
MAKELAZYBIN
#define MAKELAZYBIN(R, X)
Definition: Data.cpp:97
escript::Data::getLength
DataTypes::RealVectorType::size_type getLength() const
Return the number of doubles stored for this Data.
Definition: Data.cpp:1367
escript::DataTagged::getDefaultOffset
DataTypes::RealVectorType::size_type getDefaultOffset() const
Returns the offset in the structure which stores the default value.
Definition: DataTagged.h:724
escript::binaryOpDataEEC
void binaryOpDataEEC(DataExpanded &result, const DataExpanded &left, const DataConstant &right, escript::ES_optype operation)
Definition: BinaryDataReadyOps.cpp:752
escript::Data::integrateToTuple
boost::python::object integrateToTuple()
Calculate the integral over the function space domain as a python tuple.
Definition: Data.cpp:1784
escript::binaryOpDataEEE
void binaryOpDataEEE(DataExpanded &result, const DataExpanded &left, const DataExpanded &right, escript::ES_optype operation)
Definition: BinaryDataReadyOps.cpp:834
escript::Data::borrowDataPtr
DataAbstract_ptr borrowDataPtr(void) const
Definition: Data.cpp:4624
escript::Data::getDomain
const_Domain_ptr getDomain() const
Return the domain.
Definition: Data.h:487
escript::DataAbstract::getPtr
DataAbstract_ptr getPtr()
Return shared pointer managing this object.
Definition: DataAbstract.cpp:39
escript::Data::sinh
Data sinh() const
Return the sinh of each data point of this Data object.
Definition: Data.cpp:2089
escript::Data::abs
Data abs() const
Return the absolute value of each data point of this Data object.
Definition: Data.cpp:2161
escript::Data::setTaggedValueByName
void setTaggedValueByName(std::string name, const boost::python::object &value)
Assign the given value to the tag assocciated with name. Implicitly converts this object to type Data...
Definition: Data.cpp:3573
escript::vectorHasNaN
bool vectorHasNaN(const DataTypes::RealVectorType &in, DataTypes::RealVectorType::size_type inOffset, size_t count)
returns true if the vector contains NaN
Definition: DataVectorOps.h:1473
escript::Data::hasNoSamples
bool hasNoSamples() const
Return true if this object contains no samples. This is not the same as isEmpty()
Definition: Data.h:745
escript::SQRT
@ SQRT
Definition: ES_optype.h:58
escript::Data::getSampleDataRO
const DataTypes::real_t * getSampleDataRO(DataTypes::RealVectorType::size_type sampleNo, DataTypes::real_t dummy=0) const
Return the sample data for the given sample no. Please do not use this unless you NEED to access samp...
Definition: Data.h:1991
escript::Data::getItem
Data getItem(const boost::python::object &key) const
Returns a slice from this Data object.
Definition: Data.cpp:3464
escript::Data::getNoValues
int getNoValues() const
Return the number of values in the shape for this object.
Definition: Data.h:580
escript::DataExpanded::getTypedVectorRW
virtual DataTypes::RealVectorType & getTypedVectorRW(DataTypes::real_t dummy)
These versions use the type system rather than method name to determine return type.
Definition: DataExpanded.cpp:1526
escript::IMAG
@ IMAG
Definition: ES_optype.h:78
escript::DataAbstract_ptr
boost::shared_ptr< DataAbstract > DataAbstract_ptr
Definition: DataAbstract.h:52
escript::SWAP
@ SWAP
Definition: ES_optype.h:71
escript::EXP
@ EXP
Definition: ES_optype.h:57
escript::Data::integrateWorker
boost::python::object integrateWorker() const
escript::DataConstant
DataConstant stores a single data point which represents the entire function space.
Definition: DataConstant.h:38
escript::eigenvalues
void eigenvalues(const DataTypes::RealVectorType &in, const DataTypes::ShapeType &inShape, typename DataTypes::RealVectorType::size_type inOffset, DataTypes::RealVectorType &ev, const DataTypes::ShapeType &evShape, typename DataTypes::RealVectorType::size_type evOffset)
solves a local eigenvalue problem
Definition: DataVectorOps.h:639
escript::NSYM
@ NSYM
Definition: ES_optype.h:67
escript::Data::swapaxes
Data swapaxes(const int axis0, const int axis1) const
swaps the components axis0 and axis1
Definition: Data.cpp:2661
escript::Data::m_protected
bool m_protected
Definition: Data.h:1775
escript::Data::getDataPointShape
const DataTypes::ShapeType & getDataPointShape() const
Return a reference to the data point shape.
Definition: Data.h:705
escript::DataTagged::getDefaultValueRW
DataTypes::RealVectorType::reference getDefaultValueRW(DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0)
getDefaultValue
Definition: DataTagged.h:731
escript::Data::init_from_data_and_fs
void init_from_data_and_fs(const Data &inData, const FunctionSpace &functionspace)
Definition: Data.cpp:430
escript::Data::interpolate
Data interpolate(const FunctionSpace &functionspace) const
Interpolates this onto the given functionspace and returns the result as a Data object.
Definition: Data.cpp:1311
escript::WrappedArray
Definition: WrappedArray.h:33
escript::Data::get_MPIRank
int get_MPIRank(void) const
return the MPI rank number of the local data MPI_COMM_WORLD is assumed and the result of MPI_Comm_siz...
Definition: Data.cpp:5447
escript::Data::exp
Data exp() const
Return the exponential function of each data point of this Data object.
Definition: Data.cpp:2187
escript::DataTypes::DataVectorAlt::size_type
DataTypes::vec_size_type size_type
Definition: DataVectorAlt.h:50
escript::WrappedArray::isComplex
bool isComplex() const
Definition: WrappedArray.h:71
escript::Data::__mul__
boost::python::object __mul__(const boost::python::object &right)
wrapper for python multiply operation
Definition: Data.cpp:5981
escript::symmetric
void symmetric(const VEC &in, const DataTypes::ShapeType &inShape, typename VEC::size_type inOffset, VEC &ev, const DataTypes::ShapeType &evShape, typename VEC::size_type evOffset)
computes a symmetric matrix from your square matrix A: (A + transpose(A)) / 2
Definition: DataVectorOps.h:103
escript::Data::getNumberOfTaggedValues
size_t getNumberOfTaggedValues() const
For tagged Data returns the number of tags with values. For non-tagged data will return 0 (even Data ...
Definition: Data.cpp:5855
escript::Data::minval_nonlazy
Data minval_nonlazy() const
Definition: Data.cpp:2621
escript::Data::sup_const
DataTypes::real_t sup_const() const
Definition: Data.cpp:2246
escript::Data::setTaggedValueFromCPP
void setTaggedValueFromCPP(int tagKey, const DataTypes::ShapeType &pointshape, const DataTypes::RealVectorType &value, int dataOffset=0)
Assign the given value to the tag. Implicitly converts this object to type DataTagged if it is consta...
Definition: Data.cpp:3630
escript::DataTypes::DataVectorAlt< real_t >
escript::Data::interpolateFromTable2DP
Data interpolateFromTable2DP(boost::python::object table, DataTypes::real_t Amin, DataTypes::real_t Astep, Data &B, DataTypes::real_t Bmin, DataTypes::real_t Bstep, DataTypes::real_t undef, bool check_boundaries)
Definition: Data.cpp:4743
escript::C_TensorUnaryOperation
Data C_TensorUnaryOperation(Data const &arg_0, escript::ES_optype operation, DataTypes::real_t tol=0)
Definition: Data.cpp:6075
escript::NHER
@ NHER
Definition: ES_optype.h:76
escript::Data::isTagged
bool isTagged() const
Return true if this Data is tagged.
Definition: Data.cpp:1125
escript::binaryOpDataEET
void binaryOpDataEET(DataExpanded &result, const DataExpanded &left, const DataTagged &right, escript::ES_optype operation)
Definition: BinaryDataReadyOps.cpp:327
escript::Data::getSampleDataRO
const DataTypes::cplx_t * getSampleDataRO(DataTypes::CplxVectorType::size_type sampleNo, DataTypes::cplx_t dummy) const
escript::Data::besselSecondKind
Data besselSecondKind(int order)
Return the Bessel function of the second kind for each data point of this Data object.
Definition: Data.cpp:1864
MPI_SUM
#define MPI_SUM
Definition: EsysMPI.h:54
escript::SINH
@ SINH
Definition: ES_optype.h:44
escript::operator-
Data operator-(const Data &left, const Data &right)
Operator- Takes two Data objects.
Definition: Data.cpp:3355
escript::transpose
void transpose(const VEC &in, const DataTypes::ShapeType &inShape, typename VEC::size_type inOffset, VEC &ev, const DataTypes::ShapeType &evShape, typename VEC::size_type evOffset, int axis_offset)
Transpose each data point of this Data object around the given axis.
Definition: DataVectorOps.h:343
escript::Data::gradOn
Data gradOn(const FunctionSpace &functionspace) const
Calculates the gradient of the data at the data points of functionspace. If functionspace is not pres...
Definition: Data.cpp:1323
escript::TRANS
@ TRANS
Definition: ES_optype.h:69
escript::DataTagged::getDataByTagRO
DataTypes::RealVectorType::const_reference getDataByTagRO(int tag, DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0) const
Definition: DataTagged.cpp:1006
escript::Data::LsupWorker
DataTypes::real_t LsupWorker() const
Definition: Data.cpp:2476
escript::Data::phase
Data phase() const
Return the phase/arg/angular-part of complex values.
Definition: Data.cpp:2023
escript::Data::getDataAtOffsetRW
DataTypes::RealVectorType::reference getDataAtOffsetRW(DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy)
Definition: Data.cpp:4678
escript::Data::sup
DataTypes::real_t sup()
Return the maximum value of this Data object.
Definition: Data.cpp:2260
escript::TestDomain
(Testing use only) Provides a domain to wrap a collection of values.
Definition: TestDomain.h:43
escript::const_DataReady_ptr
boost::shared_ptr< const DataReady > const_DataReady_ptr
Definition: DataAbstract.h:60
escript::ATANH
@ ATANH
Definition: ES_optype.h:50
escript::Data::isConstant
bool isConstant() const
Return true if this Data is constant.
Definition: Data.cpp:1139
ESCRIPT_MAX_DATA_RANK
#define ESCRIPT_MAX_DATA_RANK
Definition: Data.h:39
escript::Domain_ptr
boost::shared_ptr< AbstractDomain > Domain_ptr
Definition: AbstractDomain.h:41
escript::LOG
@ LOG
Definition: ES_optype.h:52
DataLazy.h
escript::Data::initialise
void initialise(const DataTypes::RealVectorType &value, const DataTypes::ShapeType &shape, const FunctionSpace &what, bool expanded)
Construct a Data object of the appropriate type.
Definition: Data.cpp:638
escript::Data::bessel
Data bessel(int order, DataTypes::real_t(*besselfunc)(int, DataTypes::real_t))
Bessel worker function.
Definition: Data.cpp:1871
escript::Data::randomData
friend Data randomData(const boost::python::tuple &shape, const FunctionSpace &what, long seed, const boost::python::tuple &filter)
Create a new Expanded Data object filled with pseudo-random data.
escript::binOpFnPtr
int(* binOpFnPtr)(double *, const double *, const double *, int, int, int)
Definition: Dodgy.h:31
escript::Data::interpolateFromTable1D
Data interpolateFromTable1D(const WrappedArray &table, DataTypes::real_t Amin, DataTypes::real_t Astep, DataTypes::real_t undef, bool check_boundaries)
Definition: Data.cpp:4761
escript::Data::TensorSelfUpdateBinaryOperation
void TensorSelfUpdateBinaryOperation(const Data &right, escript::ES_optype operation)
Definition: Data.cpp:6527
escript::DataReady::getDataAtOffsetRWC
DataTypes::CplxVectorType::reference getDataAtOffsetRWC(DataTypes::CplxVectorType::size_type i)
Definition: DataReady.h:255
escript::Data::getDataPointSize
int getDataPointSize() const
Return the size of the data point. It is the product of the data point shape dimensions.
Definition: Data.cpp:1360
escript::Data::__add__
boost::python::object __add__(const boost::python::object &right)
wrapper for python add operation
Definition: Data.cpp:5908
escript::SUB
@ SUB
Definition: ES_optype.h:34
escript::binOpFnPtrFromVoidPtr
binOpFnPtr binOpFnPtrFromVoidPtr(void *v)
Definition: Dodgy.cpp:23
escript::Data::Data
Data()
Default constructor. Creates a DataEmpty object.
Definition: Data.cpp:246
escript::Data::interpolateFromTable1DP
Data interpolateFromTable1DP(boost::python::object table, DataTypes::real_t Amin, DataTypes::real_t Astep, DataTypes::real_t undef, bool check_boundaries)
Definition: Data.cpp:4752
escript::FunctionSpace
Definition: FunctionSpace.h:36
escript::Data::truedivO
Data truedivO(const boost::python::object &right)
Newer style division operator for python.
Definition: Data.h:2208
escript::Data::getDomainPython
Domain_ptr getDomainPython() const
Return the domain. TODO: For internal use only. This should be removed.
Definition: Data.h:501
escript::DataReady::hasInf
virtual bool hasInf() const =0
Return true if data contains Inf or -Inf.
escript::Data::tanh
Data tanh() const
Return the tanh of each data point of this Data object.
Definition: Data.cpp:2103
escript::ACOS
@ ACOS
Definition: ES_optype.h:42
escript::FunctionSpace::getListOfTagsSTL
std::list< int > getListOfTagsSTL() const
Returns an stl list of the tags used in this function space.
Definition: FunctionSpace.cpp:335
escript::binaryOpDataTCT
void binaryOpDataTCT(DataTagged &result, const DataConstant &left, const DataTagged &right, escript::ES_optype operation)
Definition: BinaryDataReadyOps.cpp:191
escript::makePromote
DataLazy_ptr makePromote(DataLazy_ptr p)
Definition: DataLazy.cpp:115
escript::DataReady
Definition: DataReady.h:37
escript::Data::get_MPIComm
MPI_Comm get_MPIComm(void) const
return the MPI rank number of the local data MPI_COMM_WORLD is assumed and returned.
Definition: Data.cpp:5459
escript::Data::getFunctionSpace
const FunctionSpace & getFunctionSpace() const
Return the function space.
Definition: Data.h:463
escript::Data::complicate
void complicate()
Definition: Data.cpp:6053
escript::tensor_unary_array_operation
void tensor_unary_array_operation(const size_t size, const T1 *arg1, T2 *argRes, escript::ES_optype operation, DataTypes::real_t tol=0)
Definition: ArrayOps.h:760
escript::Data::delaySelf
void delaySelf()
convert the current data into lazy data.
Definition: Data.cpp:797
escript::DataTagged::getVectorRO
const DataTypes::RealVectorType & getVectorRO() const
Definition: DataTagged.cpp:1650
escript::AbsMax
Return the absolute maximum value of the two given values.
Definition: ArrayOps.h:93
escript::DataTagged::DataMapType
std::map< int, int > DataMapType
Definition: DataTagged.h:58
escript::FunctionSpace::getDomain
const_Domain_ptr getDomain() const
Returns the function space domain.
Definition: FunctionSpace.cpp:103
MPI_INT
#define MPI_INT
Definition: EsysMPI.h:48
escript::Data::condEvalWorker
friend Data condEvalWorker(escript::Data &mask, escript::Data &trueval, escript::Data &falseval, S sentinel)
escript::TANH
@ TANH
Definition: ES_optype.h:46
escript::Data::whereZero
Data whereZero(DataTypes::real_t tol=0.0) const
Return a Data with a 1 for 0 values and a 0 for +ive or -ive values.
Definition: Data.cpp:1297
escript::Data::getSampleDataRW
DataTypes::cplx_t * getSampleDataRW(DataTypes::RealVectorType::size_type sampleNo, DataTypes::cplx_t dummy)
MPI_MAX
#define MPI_MAX
Definition: EsysMPI.h:56
MAKELAZYOPOFF
#define MAKELAZYOPOFF(X, Y)
Definition: Data.cpp:71
escript::C_GeneralTensorProduct
Data C_GeneralTensorProduct(Data &arg_0, Data &arg_1, int axis_offset=0, int transpose=0)
Compute a tensor product of two Data objects.
Definition: Data.cpp:3686
escript::PHS
@ PHS
Definition: ES_optype.h:84
escript::DataReady::replaceInf
virtual void replaceInf(DataTypes::real_t value)=0
replaces all (+/-)Inf values with value
escript::ERF
@ ERF
Definition: ES_optype.h:47
escript::Data::getNumSamples
int getNumSamples() const
Return the number of samples.
Definition: Data.h:533
escript::NEG
@ NEG
Definition: ES_optype.h:55
paso::util::copy
void copy(dim_t N, double *out, const double *in)
out = in
Definition: PasoUtil.h:88
escript::Data::powD
Data powD(const Data &right) const
Return the given power of each data point of this Data object.
Definition: Data.cpp:3333
escript::WrappedArray::getRank
unsigned int getRank() const
Definition: WrappedArray.h:77
escript::GZ
@ GZ
Definition: ES_optype.h:60
escript::DataTagged
Simulates a full dataset accessible via sampleNo and dataPointNo.
Definition: DataTagged.h:46
escript::binaryOpDataTTT
void binaryOpDataTTT(DataTagged &result, const DataTagged &left, const DataTagged &right, escript::ES_optype operation)
Definition: BinaryDataReadyOps.cpp:672
escript::DataAbstract::getNumDPPSample
int getNumDPPSample() const
Return the number of data points per sample.
Definition: DataAbstract.h:612
escript::operator+
Data operator+(const Data &left, const Data &right)
Operator+ Takes two Data objects.
Definition: Data.cpp:3345
escript::Data
Data represents a collection of datapoints.
Definition: Data.h:64
escript::Data::getDataOffset
DataTypes::RealVectorType::size_type getDataOffset(int sampleNo, int dataPointNo)
Return the offset for the given sample and point within the sample.
Definition: Data.h:693
escript::DataReady::getDataAtOffsetROC
DataTypes::CplxVectorType::const_reference getDataAtOffsetROC(DataTypes::CplxVectorType::size_type i) const
Definition: DataReady.h:248
escript::DataException
Definition: DataException.h:28
escript::Data::toString
std::string toString() const
Write the data as a string. For large amounts of data, a summary is printed.
Definition: Data.cpp:4639
paso::nz
static dim_t nz
Definition: SparseMatrix_saveHB.cpp:37
escript::Data::whereNonPositive
Data whereNonPositive() const
Return a Data with a 1 for -ive or 0 values and a 0 for +ive values.
Definition: Data.cpp:1286
escript::Data::operator=
Data & operator=(const Data &other)
Definition: Data.cpp:3198
escript::Data::forceResolve
void forceResolve()
Definition: Data.h:1844
escript::Data::resolve
void resolve()
If this data is lazy, then convert it to ready data. What type of ready data depends on the expressio...
Definition: Data.cpp:1230
escript::hermitian
void hermitian(const DataTypes::CplxVectorType &in, const DataTypes::ShapeType &inShape, DataTypes::CplxVectorType::size_type inOffset, DataTypes::CplxVectorType &ev, const DataTypes::ShapeType &evShape, DataTypes::CplxVectorType::size_type evOffset)
computes an hermitian matrix from your square matrix A: (A + adjoint(A)) / 2
Definition: DataVectorOps.cpp:916
escript::Data::checkExclusiveWrite
void checkExclusiveWrite()
checks if caller can have exclusive write to the object
Definition: Data.h:1884
escript::FunctionSpace::getX
escript::Data getX() const
Returns the spatial locations of the data points.
Definition: FunctionSpace.cpp:229
BinaryDataReadyOps.h
Describes binary operations performed on instances of DataAbstract.
escript::DataConstant::getTypedVectorRW
virtual DataTypes::RealVectorType & getTypedVectorRW(DataTypes::real_t dummy)
These versions use the type system rather than method name to determine return type.
Definition: DataConstant.cpp:865
escript::DataTypes::ShapeType
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:44
DataExpanded.h
escript::Data::powO
Data powO(const boost::python::object &right) const
Return the given power of each data point of this boost python object.
Definition: Data.cpp:3326
escript::Data::getShapeTuple
const boost::python::tuple getShapeTuple() const
Return the data point shape as a tuple of integers.
Definition: Data.cpp:724
MAKELAZYBIN2
#define MAKELAZYBIN2(L, R, X)
Definition: Data.cpp:105
escript::Data::getReady
DataReady * getReady()
Definition: Data.h:1794
escript::Data::typeMatchLeft
void typeMatchLeft(Data &right) const
Convert the data type of the RHS to match this.
Definition: Data.cpp:3525
escript::DataTypes
Contains the types to represent Shapes, Regions, RegionLoop ranges and vectors of data as well as the...
Definition: DataTypes.cpp:88
escript::ABS
@ ABS
Definition: ES_optype.h:54
escript::Data::symmetric
Data symmetric() const
Return the symmetric part of a matrix which is half the matrix plus its transpose.
Definition: Data.cpp:2718
EscriptParams.h
escript::DataTypes::fillComplexFromReal
void fillComplexFromReal(const RealVectorType &r, CplxVectorType &c)
copy data from a real vector to a complex vector The complex vector will be resized as needed and any...
escript::DataExpanded::getPointOffset
virtual DataTypes::RealVectorType::size_type getPointOffset(int sampleNo, int dataPointNo) const
Return the offset for the given given data point. This returns the offset in bytes for the given poin...
Definition: DataExpanded.cpp:622
escript::DataAbstract::getPointOffset
virtual DataTypes::RealVectorType::size_type getPointOffset(int sampleNo, int dataPointNo) const =0
Return the offset for the given sample. This returns the offset for the given point into the containe...
escript::matrix_matrix_product
void matrix_matrix_product(const int SL, const int SM, const int SR, const LEFT *A, const RIGHT *B, RES *C, int transpose)
Definition: ArrayOps.h:567
escript::DataEmpty
Implements the DataAbstract interface for an empty Data object.
Definition: DataEmpty.h:34
escript::DataReady::getSampleDataRW
DataTypes::real_t * getSampleDataRW(DataTypes::RealVectorType::size_type sampleNo, DataTypes::real_t dummy=0)
Return the sample data for the given sample number.
Definition: DataReady.h:204
escript::Data::getSampleDataRW
DataTypes::real_t * getSampleDataRW(DataTypes::RealVectorType::size_type sampleNo, DataTypes::real_t dummy=0)
Return the sample data for the given sample no. Please do not use this unless you NEED to access samp...
Definition: Data.h:1956
escript::Data::operandCheck
void operandCheck(const Data &right) const
Check *this and the right operand are compatible. Throws an exception if they aren't.
Definition: Data.h:1695
escript::Data::toListOfTuples
const boost::python::object toListOfTuples(bool scalarastuple=true)
returns the values of the object as a list of tuples (one for each datapoint).
Definition: Data.cpp:1378
escript::Data::replaceInf
void replaceInf(DataTypes::real_t value)
Definition: Data.cpp:2441
escript::DataReady::resolve
DataReady_ptr resolve()
Return a data object with all points resolved.
Definition: DataReady.cpp:30
escript::Data::real
Data real() const
Definition: Data.cpp:1984
escript::DataTypes::RegionType
std::vector< std::pair< int, int > > RegionType
Definition: DataTypes.h:45
DataAbstract.h
escript::Data::sin
Data sin() const
Return the sin of each data point of this Data object.
Definition: Data.cpp:2046
escript::REAL
@ REAL
Definition: ES_optype.h:77
escript::DataTypes::noValues
int noValues(const ShapeType &shape)
Calculate the number of values in a datapoint with the given shape.
Definition: DataTypes.cpp:91
escript::Data::maxval
Data maxval() const
Return the maximum value of each data point of this Data object.
Definition: Data.cpp:2643
escript::Data::getReadyPtr
const_DataReady_ptr getReadyPtr() const
Definition: Data.h:1814
escript::DataAbstract::getShape
const DataTypes::ShapeType & getShape() const
Return the shape information for the point data.
Definition: DataAbstract.h:642
escript::Data::besselFirstKind
Data besselFirstKind(int order)
Return the Bessel function of the first kind for each data point of this Data object.
Definition: Data.cpp:1857
escript::DataTypes::DataVectorAlt::copyFromArray
void copyFromArray(const WrappedArray &value, size_type copies)
Populates the vector with the data from value. This method currently throws an exception if the speci...
Definition: DataVectorAlt.h:482
escript::Data::acosh
Data acosh() const
Return the acosh of each data point of this Data object.
Definition: Data.cpp:2125
escript::DataAbstract::getNumSamples
int getNumSamples() const
Return the number of samples.
Definition: DataAbstract.h:623
escript::binaryOpDataECE
void binaryOpDataECE(DataExpanded &result, const DataConstant &left, const DataExpanded &right, escript::ES_optype operation)
Definition: BinaryDataReadyOps.cpp:271
escript::ACOSH
@ ACOSH
Definition: ES_optype.h:49
escript::Data::cosh
Data cosh() const
Return the cosh of each data point of this Data object.
Definition: Data.cpp:2096
escript::MUL
@ MUL
Definition: ES_optype.h:35
escript::DataTagged::getTypedVectorRW
virtual DataTypes::RealVectorType & getTypedVectorRW(DataTypes::real_t dummy)
These versions use the type system rather than method name to determine return type.
Definition: DataTagged.cpp:1669
escript::Data::getDataAtOffsetRW
DataTypes::CplxVectorType::reference getDataAtOffsetRW(DataTypes::CplxVectorType::size_type i, DataTypes::cplx_t dummy)
escript::Data::getDataRO
const DataTypes::real_t * getDataRO(DataTypes::real_t dummy=0) const
Return a pointer to the beginning of the underlying data.
Definition: Data.h:2018
escript::Data::eigenvalues_and_eigenvectors
const boost::python::tuple eigenvalues_and_eigenvectors(const DataTypes::real_t tol=1.e-12) const
Return the eigenvalues and corresponding eigenvcetors of the symmetric part at each data point of thi...
Definition: Data.cpp:2950
escript::DataTagged::getTypedVectorRO
virtual const DataTypes::RealVectorType & getTypedVectorRO(DataTypes::real_t dummy) const
Definition: DataTagged.cpp:1676
escript::WrappedArray::convertArray
void convertArray() const
Definition: WrappedArray.cpp:531
escript::Data::trace
Data trace(int axis_offset) const
Return the trace of a matrix.
Definition: Data.cpp:2844
escript::Data::setTaggedValue
void setTaggedValue(int tagKey, const boost::python::object &value)
Assign the given value to the tag. Implicitly converts this object to type DataTagged if it is consta...
Definition: Data.cpp:3590
escript::Data::minGlobalDataPoint
const boost::python::tuple minGlobalDataPoint() const
Definition: Data.cpp:2976
escript::Data::typeMatchRight
void typeMatchRight(const Data &right)
Convert the data type of this to match the RHS.
Definition: Data.cpp:3545
Dodgy.h
escript::ADD
@ ADD
Definition: ES_optype.h:33
escript::GEZ
@ GEZ
Definition: ES_optype.h:62
escript::Data::copySelf
Data copySelf() const
Return a pointer to a deep copy of this object.
Definition: Data.cpp:770
escript::Data::isDataPointShapeEqual
bool isDataPointShapeEqual(int rank, const int *dimensions) const
Returns true if the shape matches the vector (dimensions[0],..., dimensions[rank-1])....
Definition: Data.h:567
escript::Data::set_m_data
void set_m_data(DataAbstract_ptr p)
Modify the data abstract hosted by this Data object For internal use only. Passing a pointer to null ...
Definition: Data.cpp:609
escript::DataExpanded
Give a short description of what DataExpanded does.
Definition: DataExpanded.h:44
escript::Data::isEmpty
bool isEmpty() const
Definition: Data.cpp:1132
escript::Data::getDataPointRO
DataTypes::RealVectorType::const_reference getDataPointRO(int sampleNo, int dataPointNo)
Return a reference into the DataVector which points to the specified data point.
Definition: Data.cpp:4709
escript::Data::replaceInfPython
void replaceInfPython(boost::python::object obj)
Definition: Data.cpp:2461
escript::Data::getNumDataPoints
int getNumDataPoints() const
Return the number of data points.
Definition: Data.h:523
escript::TRACE
@ TRACE
Definition: ES_optype.h:70
escript::LEZ
@ LEZ
Definition: ES_optype.h:63
escript::DIV
@ DIV
Definition: ES_optype.h:36
escript::binaryOpDataTTC
void binaryOpDataTTC(DataTagged &result, const DataTagged &left, const DataConstant &right, escript::ES_optype operation)
Definition: BinaryDataReadyOps.cpp:520
escript::Data::dump
void dump(const std::string fileName) const
dumps the object into a netCDF file
Definition: Data.cpp:5413
escript::Data::numSamplesEqual
bool numSamplesEqual(int numDataPointsPerSample, int numSamples) const
Returns true if the number of data points per sample and the number of samples match the respective a...
Definition: Data.h:555
escript::Data::calc_maxGlobalDataPoint
void calc_maxGlobalDataPoint(int &ProcNo, int &DataPointNo) const
Definition: Data.cpp:3089
escript::escriptParams
EscriptParams escriptParams
Definition: EscriptParams.cpp:29
escript::Data::dp_algorithm
Data dp_algorithm(BinaryFunction operation, DataTypes::real_t initial_value) const
Reduce each data-point in this Data object using the given operation. Return a Data object with the s...
Definition: Data.h:2318
escript::Data::getValueOfGlobalDataPointAsTuple
const boost::python::object getValueOfGlobalDataPointAsTuple(int procNo, int dataPointNo)
Return a data point across all processors as a python tuple.
Definition: Data.cpp:1699
escript::DataTagged::getPointOffset
virtual DataTypes::RealVectorType::size_type getPointOffset(int sampleNo, int dataPointNo) const
getPointOffset
Definition: DataTagged.cpp:982
DataConstant.h
escript::Data::isShared
bool isShared() const
Definition: Data.h:1835
WrappedArray.h
escript::DataExpanded::getTypedVectorRO
virtual const DataTypes::RealVectorType & getTypedVectorRO(DataTypes::real_t dummy) const
Definition: DataExpanded.cpp:1532
escript::Data::setItemD
void setItemD(const boost::python::object &key, const Data &value)
Copies slice from value into this Data object.
Definition: Data.cpp:3494
escript::Data::integrateToTuple_const
boost::python::object integrateToTuple_const() const
Calculate the integral over the function space domain as a python tuple.
Definition: Data.cpp:1770
escript::binaryOpDataETE
void binaryOpDataETE(DataExpanded &result, const DataTagged &left, const DataExpanded &right, escript::ES_optype operation)
Definition: BinaryDataReadyOps.cpp:383
escript::operator*
Data operator*(const AbstractSystemMatrix &left, const Data &right)
Definition: AbstractSystemMatrix.cpp:60
escript::Data::getReadyPtr
DataReady_ptr getReadyPtr()
Definition: Data.h:1806
escript::Data::maxGlobalDataPoint
const boost::python::tuple maxGlobalDataPoint() const
Definition: Data.cpp:3079
escript::swapaxes
void swapaxes(const VEC &in, const DataTypes::ShapeType &inShape, typename VEC::size_type inOffset, VEC &ev, const DataTypes::ShapeType &evShape, typename VEC::size_type evOffset, int axis0, int axis1)
swaps the components axis0 and axis1.
Definition: DataVectorOps.h:488
escript::Data::copyWithMask
void copyWithMask(const Data &other, const Data &mask)
Copy other Data object into this Data object where mask is positive.
Definition: Data.cpp:851
escript::RECIP
@ RECIP
Definition: ES_optype.h:59
escript::ES_optype
ES_optype
Definition: ES_optype.h:30
escript::Data::__rsub__
boost::python::object __rsub__(const boost::python::object &right)
wrapper for python reverse subtract operation
Definition: Data.cpp:5956
escript::Data::transpose
Data transpose(int axis_offset) const
Transpose each data point of this Data object around the given axis.
Definition: Data.cpp:2899
escript::matrixInverseError
void matrixInverseError(int err)
throws an appropriate exception based on failure of matrix_inverse.
Definition: DataVectorOps.cpp:186
V
#define V(_K_, _I_)
Definition: ShapeFunctions.cpp:121
escript::C_TensorBinaryOperation
Data C_TensorBinaryOperation(Data const &arg_0, Data const &arg_1, ES_optype operation)
Compute a tensor operation with two Data objects.
Definition: Data.cpp:6351
escript::Data::delay
Data delay()
produce a delayed evaluation version of this Data.
Definition: Data.cpp:786
escript::FunctionSpaceException
Definition: FunctionSpaceException.h:29
MAKELAZYOP2
#define MAKELAZYOP2(X, Y, Z)
Definition: Data.cpp:79
MPI_DOUBLE
#define MPI_DOUBLE
Definition: EsysMPI.h:49
escript::DataTagged::getDefaultValueRO
DataTypes::RealVectorType::const_reference getDefaultValueRO(DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0) const
Definition: DataTagged.h:738
escript::Data::hermitian
Data hermitian() const
Return the hermitian part of a matrix which is half the matrix plus its adjoint.
Definition: Data.cpp:2777
escript::Data::operator*=
Data & operator*=(const Data &right)
Overloaded operator *=.
Definition: Data.cpp:3233
MPI_MIN
#define MPI_MIN
Definition: EsysMPI.h:55
escript::conjugate
T1 conjugate(const T2 i)
Definition: ArrayOps.h:734
escript::Data::supWorker
DataTypes::real_t supWorker() const
Definition: Data.cpp:2533
escript::Data::whereNegative
Data whereNegative() const
Return a Data with a 1 for -ive values and a 0 for +ive or 0 values.
Definition: Data.cpp:1264
escript::Data::minval
Data minval() const
Return the minimum value of each data point of this Data object.
Definition: Data.cpp:2652
escript::Data::interpolateFromTable2D
Data interpolateFromTable2D(const WrappedArray &table, DataTypes::real_t Amin, DataTypes::real_t Astep, DataTypes::real_t undef, Data &B, DataTypes::real_t Bmin, DataTypes::real_t Bstep, bool check_boundaries)
Definition: Data.cpp:4889
AbstractContinuousDomain.h
escript::operator/
Data operator/(const Data &left, const Data &right)
Operator/ Takes two Data objects.
Definition: Data.cpp:3374
escript::Data::getValueOfDataPointAsTuple
const boost::python::object getValueOfDataPointAsTuple(int dataPointNo)
Return the value of a data point as a python tuple.
Definition: Data.cpp:1520
escript::Data::getXFromFunctionSpace
escript::Data getXFromFunctionSpace() const
Returns the spatial locations of the data points.
Definition: Data.h:474
escript::Data::log
Data log() const
Return the natural log of each data point of this Data object.
Definition: Data.cpp:2146
escript::Data::truedivD
Data truedivD(const Data &right)
Newer style division operator for python.
Definition: Data.h:2196
escript::Data::rpowO
Data rpowO(const boost::python::object &left) const
Return the given power of each data point of this boost python object.
Definition: Data.cpp:3319
escript::Data::__div__
boost::python::object __div__(const boost::python::object &right)
wrapper for python divide operation
Definition: Data.cpp:6005
escript::Data::borrowReadyPtr
DataReady_ptr borrowReadyPtr(void) const
Definition: Data.cpp:4631
M_PI
#define M_PI
Definition: ArrayOps.h:36
escript::DataReady::setSlice
virtual void setSlice(const DataAbstract *value, const DataTypes::RegionType &region)=0
Copy the specified region from the given object.
FunctionSpaceException.h
escript
Definition: AbstractContinuousDomain.cpp:23
escript::Data::matrixInverse
Data matrixInverse() const
return inverse of matricies.
Definition: Data.cpp:3291
escript::Data::inf
DataTypes::real_t inf()
Return the minimum value of this Data object.
Definition: Data.cpp:2299
escript::Data::wherePositive
Data wherePositive() const
Return a Data with a 1 for +ive values and a 0 for 0 or -ive values.
Definition: Data.cpp:1253
escript::Data::isExpanded
bool isExpanded() const
Return true if this Data is expanded.
Definition: Data.cpp:1111
escript::PROD
@ PROD
Definition: ES_optype.h:68
escript::DataReady::getVectorRW
virtual DataTypes::RealVectorType & getVectorRW()=0
Provide access to underlying storage. Internal use only!
escript::Data::hasInf
bool hasInf()
Definition: Data.cpp:2430
escript::DataTypes::getRelIndex
vec_size_type getRelIndex(const DataTypes::ShapeType &shape, vec_size_type i)
Compute the offset (in 1D vector) of a given subscript with a shape.
Definition: DataTypes.h:240
escript::Data::inf_const
DataTypes::real_t inf_const() const
Definition: Data.cpp:2285
escript::LOG10
@ LOG10
Definition: ES_optype.h:51
escript::Data::nonuniformslope
Data nonuniformslope(boost::python::object in, boost::python::object out, bool check_boundaries)
Definition: Data.cpp:5304
DataTypes.h
escript::Data::getTagNumber
int getTagNumber(int dpno)
Return the tag number associated with the given data-point.
Definition: Data.cpp:3669
escript::Data::__sub__
boost::python::object __sub__(const boost::python::object &right)
wrapper for python subtract operation
Definition: Data.cpp:5932
escript::Data::operator/=
Data & operator/=(const Data &right)
Overloaded operator /=.
Definition: Data.cpp:3260
escript::Data::antisymmetric
Data antisymmetric() const
Return the antisymmetric part of a matrix which is half the matrix minus its transpose.
Definition: Data.cpp:2741
escript::Data::Lsup_const
DataTypes::real_t Lsup_const() const
Definition: Data.cpp:2201
escript::DataAbstract
Definition: DataAbstract.h:63
escript::SYM
@ SYM
Definition: ES_optype.h:66
MAKELAZYOP
#define MAKELAZYOP(X)
Definition: Data.cpp:63
escript::always_real
bool always_real(escript::ES_optype operation)
Definition: ArrayOps.cpp:66
escript::EscriptParams::getTooManyLines
int getTooManyLines() const
Definition: EscriptParams.h:47
escript::Data::exclusiveWrite
void exclusiveWrite()
if another object is sharing out member data make a copy to work with instead. This code should only ...
Definition: Data.h:1862
escript::DataTagged::getOffsetForTag
DataTypes::RealVectorType::size_type getOffsetForTag(int tag) const
getOffsetForTag
Definition: DataTagged.cpp:995
DataVectorOps.h
Describes binary operations performed on DataVector.
escript::DataReady::getTypedVectorRW
virtual DataTypes::RealVectorType & getTypedVectorRW(DataTypes::real_t dummy)=0
These versions use the type system rather than method name to determine return type.
escript::supports_cplx
bool supports_cplx(escript::ES_optype operation)
Definition: ArrayOps.cpp:26
escript::FunctionSpace::getTypeCode
int getTypeCode() const
Returns the function space type code.
Definition: FunctionSpace.cpp:95
CHECK_DO_CRES
#define CHECK_DO_CRES
Definition: Data.cpp:113
escript::Data::asinh
Data asinh() const
Return the asinh of each data point of this Data object.
Definition: Data.cpp:2118
escript::Data::setSlice
void setSlice(const Data &value, const DataTypes::RegionType &region)
Copy the specified slice from the given value into this Data object.
Definition: Data.cpp:3510
escript::SIN
@ SIN
Definition: ES_optype.h:38
escript::FunctionSpace::getDim
int getDim() const
Return the number of spatial dimensions of the underlying domain.
Definition: FunctionSpace.h:183
AUTOLAZYON
#define AUTOLAZYON
Definition: Data.cpp:62
escript::EZ
@ EZ
Definition: ES_optype.h:65
escript::FunctionSpace::toString
std::string toString() const
Returns a text description of the function space.
Definition: FunctionSpace.cpp:118
escript::Data::isLazy
bool isLazy() const
Return true if this Data is lazy.
Definition: Data.cpp:1146
escript::function
FunctionSpace function(const AbstractDomain &domain)
Return a function FunctionSpace.
Definition: FunctionSpaceFactory.cpp:43
escript::Data::~Data
~Data()
Destructor.
Definition: Data.cpp:601
escript::Data::whereNonZero
Data whereNonZero(DataTypes::real_t tol=0.0) const
Return a Data with a 0 for 0 values and a 1 for +ive or -ive values.
Definition: Data.cpp:1304
escript::Data::getShapeProduct
long getShapeProduct() const
Returns the product of the data point shapes.
Definition: Data.cpp:745
escript::Data::setTupleForGlobalDataPoint
void setTupleForGlobalDataPoint(int id, int proc, boost::python::object)
Set the value of a global data point.
Definition: Data.cpp:1567
escript::DataAbstract::deepCopy
virtual DataAbstract * deepCopy() const =0
Return a deep copy of the current object.
DataTagged.h
escript::Data::setValueOfDataPointToArray
void setValueOfDataPointToArray(int dataPointNo, const boost::python::object &)
sets the values of a data-point from a array-like object on this process
Definition: Data.cpp:1612
escript::binaryOpDataCCC
void binaryOpDataCCC(DataConstant &result, const DataConstant &left, const DataConstant &right, escript::ES_optype operation)
Definition: BinaryDataReadyOps.cpp:66
escript::Data::setValueOfDataPointC
void setValueOfDataPointC(int dataPointNo, const DataTypes::cplx_t)
Definition: Data.cpp:1676
escript::Data::setItemO
void setItemO(const boost::python::object &key, const boost::python::object &value)
Definition: Data.cpp:3486
escript::condEval
Data condEval(escript::Data &mask, escript::Data &trueval, escript::Data &falseval)
Definition: Data.cpp:5644
MPI_Comm
int MPI_Comm
Definition: EsysMPI.h:44
escript::Data::log10
Data log10() const
Return the log to base 10 of each data point of this Data object.
Definition: Data.cpp:2139
escript::DataTagged::addTaggedValue
void addTaggedValue(int tagKey, const DataTypes::ShapeType &pointshape, const DataTypes::RealVectorType &value, int dataOffset=0)
addTaggedValue
Definition: DataTagged.cpp:608
escript::Data::pos
Data pos() const
Return the identity of each data point of this Data object. Simply returns this object unmodified.
Definition: Data.cpp:2175
escript::DataTypes::DataVectorAlt< real_t >::reference
ElementType & reference
Definition: DataVectorAlt.h:51
escript::Data::__rdiv__
boost::python::object __rdiv__(const boost::python::object &right)
wrapper for python reverse divide operation
Definition: Data.cpp:6029
escript::reductionOpVector
DataTypes::real_t reductionOpVector(const DataTypes::RealVectorType &left, const DataTypes::ShapeType &leftShape, DataTypes::RealVectorType::size_type offset, BinaryFunction operation, DataTypes::real_t initial_value)
Perform the given data point reduction operation on the data point specified by the given offset into...
Definition: DataVectorOps.h:1397
escript::Data::replaceNaNPython
void replaceNaNPython(boost::python::object obj)
replaces all NaN values with value
Definition: Data.cpp:2416
escript::Data::imag
Data imag() const
Definition: Data.cpp:2003
escript::Data::hasNaN
bool hasNaN()
returns return true if data contains NaN.
Definition: Data.cpp:2385
Data.h
escript::Data::actsExpanded
bool actsExpanded() const
Return true if this Data is expanded or resolves to expanded. That is, if it has a separate value for...
Definition: Data.cpp:1118
escript::makeNaN
DataTypes::real_t makeNaN()
returns a NaN.
Definition: ArrayOps.h:145
DataReady.h
escript::Data::operator+=
Data & operator+=(const Data &right)
Overloaded operator +=.
Definition: Data.cpp:3170
escript::Data::copy
void copy(const Data &other)
Make this object a deep copy of "other".
Definition: Data.cpp:777
escript::antisymmetric
void antisymmetric(const VEC &in, const DataTypes::ShapeType &inShape, typename VEC::size_type inOffset, VEC &ev, const DataTypes::ShapeType &evShape, typename VEC::size_type evOffset)
computes a antisymmetric matrix from your square matrix A: (A - transpose(A)) / 2
Definition: DataVectorOps.h:152
escript::POW
@ POW
Definition: ES_optype.h:37
S
#define S(_J_, _I_)
Definition: ShapeFunctions.cpp:122
escript::DataLazy::resolveTypedSample
const DataTypes::CplxVectorType * resolveTypedSample(int sampleNo, size_t &roffset, DataTypes::cplx_t dummy) const
Definition: DataLazy.cpp:2389
escript::DataConstant::getPointOffset
virtual DataTypes::RealVectorType::size_type getPointOffset(int sampleNo, int dataPointNo) const
Return the offset for the given sample. This is a somewhat artificial notion but returns the offset i...
Definition: DataConstant.cpp:354
escript::Data::neg
Data neg() const
Return the negation of each data point of this Data object.
Definition: Data.cpp:2168
escript::DataAbstract::getFunctionSpace
const FunctionSpace & getFunctionSpace() const
Return the function space associated with this Data object.
Definition: DataAbstract.h:635
escript::Data::nonuniforminterp
Data nonuniforminterp(boost::python::object in, boost::python::object out, bool check_boundaries)
Definition: Data.cpp:5228
escript::Data::getSampleDataByTag
DataTypes::cplx_t * getSampleDataByTag(int tag, DataTypes::cplx_t dummy)
Definition: Data.h:661
escript::Data::getExpandedVectorReference
DataTypes::RealVectorType & getExpandedVectorReference(DataTypes::real_t dummy=0)
Ensures that the Data is expanded and returns its underlying vector Does not check for exclusive writ...
Definition: Data.cpp:5837
escript::DataAbstract::getSlice
virtual DataAbstract * getSlice(const DataTypes::RegionType &region) const =0
Return the given slice from this object.
escript::Data::lazyAlgWorker
DataTypes::real_t lazyAlgWorker(DataTypes::real_t init)
system_dep.h
escript::TAN
@ TAN
Definition: ES_optype.h:40
escript::Data::reduction
DataTypes::real_t reduction(BinaryFunction operation, DataTypes::real_t initial_value) const
Perform the specified reduction algorithm on every element of every data point in this Data object ac...
Definition: Data.h:2239
escript::Data::calc_minGlobalDataPoint
void calc_minGlobalDataPoint(int &ProcNo, int &DataPointNo) const
Definition: Data.cpp:2993
escript::Data::setValueOfDataPointToPyObject
void setValueOfDataPointToPyObject(int dataPointNo, const boost::python::object &py_object)
sets the values of a data-point from a python object on this process
Definition: Data.cpp:1559
escript::DataTypes::cplx_t
std::complex< real_t > cplx_t
complex data type
Definition: DataTypes.h:55
escript::Data::m_data
DataAbstract_ptr m_data
Definition: Data.h:1781
escript::DataReady::getDataAtOffsetRW
DataTypes::RealVectorType::reference getDataAtOffsetRW(DataTypes::RealVectorType::size_type i)
Definition: DataReady.h:240
escript::Data::acos
Data acos() const
Return the acos of each data point of this Data object.
Definition: Data.cpp:2074
escript::tensor_unary_array_operation_real
void tensor_unary_array_operation_real(const size_t size, const T *arg1, DataTypes::real_t *argRes, escript::ES_optype operation, DataTypes::real_t tol=0)
Definition: ArrayOps.h:682
escript::Data::probeInterpolation
bool probeInterpolation(const FunctionSpace &functionspace) const
Returns true if this can be interpolated to functionspace.
Definition: Data.cpp:1317
escript::Data::maxval_nonlazy
Data maxval_nonlazy() const
Definition: Data.cpp:2632
escript::Scalar
Data Scalar(double value, const FunctionSpace &what, bool expanded)
A collection of factory functions for creating Data objects which contain data points of various shap...
Definition: DataFactory.cpp:49
escript::Data::expand
void expand()
Whatever the current Data type make this into a DataExpanded.
Definition: Data.cpp:1180
escript::DataReady_ptr
boost::shared_ptr< DataReady > DataReady_ptr
Definition: DataAbstract.h:57
escript::const_Domain_ptr
boost::shared_ptr< const AbstractDomain > const_Domain_ptr
Definition: AbstractDomain.h:44
escript::WrappedArray::getShape
const DataTypes::ShapeType & getShape() const
Definition: WrappedArray.h:83
DataEmpty.h
ESYS_ASSERT
#define ESYS_ASSERT(a, b)
EsysAssert is a MACRO that will throw an exception if the boolean condition specified is false.
Definition: Assert.h:79
escript::randomData
Data randomData(const boost::python::tuple &shape, const FunctionSpace &what, long seed, const boost::python::tuple &filter)
Create a new Expanded Data object filled with pseudo-random data.
Definition: Data.cpp:5868
escript::Data::conjugate
Data conjugate() const
For complex values return the conjugate values. For non-complex data return a copy.
Definition: Data.cpp:1964
escript::DataLazy_ptr
boost::shared_ptr< DataLazy > DataLazy_ptr
Definition: DataLazy.h:43
escript::Data::unaryOp2
void unaryOp2(UnaryFunction operation)
Perform the given unary operation on every element of every data point in this Data object.
EsysMPI.h
escript::Data::getDataPointRW
DataTypes::RealVectorType::reference getDataPointRW(int sampleNo, int dataPointNo)
Return a reference into the DataVector which points to the specified data point.
Definition: Data.cpp:4725
escript::Data::setProtection
void setProtection()
switches on update protection
Definition: Data.cpp:1166
escript::DataReady::getTypedVectorRO
virtual const DataTypes::RealVectorType & getTypedVectorRO(DataTypes::real_t dummy) const =0
escript::Data::asin
Data asin() const
Return the asin of each data point of this Data object.
Definition: Data.cpp:2067
escript::Data::operator-=
Data & operator-=(const Data &right)
Overloaded operator -=.
Definition: Data.cpp:3206
escript::ASIN
@ ASIN
Definition: ES_optype.h:41
escript::Data::interpolateFromTable3D
Data interpolateFromTable3D(const WrappedArray &table, DataTypes::real_t Amin, DataTypes::real_t Astep, DataTypes::real_t undef, Data &B, DataTypes::real_t Bmin, DataTypes::real_t Bstep, Data &C, DataTypes::real_t Cmin, DataTypes::real_t Cstep, bool check_boundaries)
Definition: Data.cpp:5045
escript::AbstractContinuousDomain
AbstractContinuousDomain, base class for continuous domains.
Definition: AbstractContinuousDomain.h:47
escript::Data::sqrt
Data sqrt() const
Return the square root of each data point of this Data object.
Definition: Data.cpp:2194
escript::trace
void trace(const VEC &in, const DataTypes::ShapeType &inShape, typename VEC::size_type inOffset, VEC &ev, const DataTypes::ShapeType &evShape, typename VEC::size_type evOffset, int axis_offset)
computes the trace of a matrix
Definition: DataVectorOps.h:242
escript::rpow
DataTypes::real_t rpow(DataTypes::real_t x, DataTypes::real_t y)
Definition: Data.h:2056
escript::Data::isProtected
bool isProtected() const
Returns true, if the data object is protected against update.
Definition: Data.cpp:1172
MAKELAZYBINSELF
#define MAKELAZYBINSELF(R, X)
Definition: Data.cpp:87
escript::COS
@ COS
Definition: ES_optype.h:39
escript::ASINH
@ ASINH
Definition: ES_optype.h:48
DataException.h
escript::Data::get_MPISize
int get_MPISize(void) const
return the MPI rank number of the local data MPI_COMM_WORLD is assumed and the result of MPI_Comm_ran...
Definition: Data.cpp:5435
escript::Data::eigenvalues
Data eigenvalues() const
Return the eigenvalues of the symmetric part at each data point of this Data object in increasing val...
Definition: Data.cpp:2923
escript::FunctionSpace::probeInterpolation
bool probeInterpolation(const FunctionSpace &other) const
Definition: FunctionSpace.h:203
escript::ATAN
@ ATAN
Definition: ES_optype.h:43
escript::DataTypes::getSliceRegion
DataTypes::RegionType getSliceRegion(const DataTypes::ShapeType &shape, const bp::object &key)
Definition: DataTypes.cpp:137
escript::MAXVAL
@ MAXVAL
Definition: ES_optype.h:73
escript::FunctionSpace::getTagFromDataPointNo
int getTagFromDataPointNo(DataTypes::dim_t dataPointNo) const
Returns the tag associated with the given data-point number.
Definition: FunctionSpace.cpp:150
escript::DataTypes::scalarShape
static const ShapeType scalarShape
Use this instead of creating empty shape objects for scalars.
Definition: DataTypes.h:48
THROWONCOMPLEX
#define THROWONCOMPLEX
Definition: Data.cpp:55
FunctionSpace.h
escript::NEZ
@ NEZ
Definition: ES_optype.h:64
escript::HER
@ HER
Definition: ES_optype.h:75
escript::operator<<
std::ostream & operator<<(std::ostream &o, const Data &data)
Output operator.
Definition: Data.cpp:3679
escript::eigenvalues_and_eigenvectors
void eigenvalues_and_eigenvectors(const DataTypes::RealVectorType &in, const DataTypes::ShapeType &inShape, DataTypes::RealVectorType::size_type inOffset, DataTypes::RealVectorType &ev, const DataTypes::ShapeType &evShape, DataTypes::RealVectorType::size_type evOffset, DataTypes::RealVectorType &V, const DataTypes::ShapeType &VShape, DataTypes::RealVectorType::size_type VOffset, const double tol=1.e-13)
solves a local eigenvalue problem
Definition: DataVectorOps.h:750
escript::DataReady::hasNaN
virtual bool hasNaN() const =0
return true if data contains NaN.
escript::DataReady::replaceNaN
virtual void replaceNaN(DataTypes::real_t value)=0
replaces all NaN values with value
escript::Data::getDataPointRank
unsigned int getDataPointRank() const
Return the rank of the point data.
Definition: Data.h:512
escript::DataLazy
Wraps an expression tree of other DataObjects. The data will be evaluated when required.
Definition: DataLazy.h:49