Go to the documentation of this file.
20 #ifndef __ESCRIPT_DATA_H__
21 #define __ESCRIPT_DATA_H__
34 #include <boost/python/object.hpp>
35 #include <boost/python/tuple.hpp>
36 #include <boost/math/special_functions/bessel.hpp>
38 #ifndef ESCRIPT_MAX_DATA_RANK
39 #define ESCRIPT_MAX_DATA_RANK 4
170 Data(
const boost::python::object& value,
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());
270 const boost::python::object
271 getValueOfDataPointAsTuple(
int dataPointNo);
278 setValueOfDataPointToPyObject(
int dataPointNo,
const boost::python::object& py_object);
285 setValueOfDataPointToArray(
int dataPointNo,
const boost::python::object&);
301 const boost::python::object
302 getValueOfGlobalDataPointAsTuple(
int procNo,
int dataPointNo);
309 setTupleForGlobalDataPoint(
int id,
int proc, boost::python::object);
317 getTagNumber(
int dpno);
374 replaceNaNPython(boost::python::object obj);
386 replaceInfPython(boost::python::object obj);
413 actsExpanded()
const;
465 return m_data->getFunctionSpace();
489 return getFunctionSpace().getDomain();
503 return getFunctionSpace().getDomainPython();
514 return m_data->getRank();
525 return getNumSamples() * getNumDataPointsPerSample();
535 return m_data->getNumSamples();
546 return m_data->getNumDPPSample();
558 (numDataPointsPerSample==getNumDataPointsPerSample() && numSamples==getNumSamples()));
572 return (getDataPointShape()==givenShape);
582 return m_data->getNoValues();
591 dump(
const std::string fileName)
const;
599 const boost::python::object
600 toListOfTuples(
bool scalarastuple=
true);
656 return m_data->getSampleDataByTag(tag, dummy);
663 return m_data->getSampleDataByTag(tag, dummy);
674 getDataPointRO(
int sampleNo,
int dataPointNo);
683 getDataPointRW(
int sampleNo,
int dataPointNo);
696 return m_data->getPointOffset(sampleNo,dataPointNo);
707 return m_data->getShape();
714 const boost::python::tuple
715 getShapeTuple()
const;
722 getShapeProduct()
const;
731 getDataPointSize()
const;
747 return m_data->getNumSamples()==0;
759 setTaggedValueByName(std::string name,
760 const boost::python::object& value);
772 setTaggedValue(
int tagKey,
773 const boost::python::object& value);
786 setTaggedValueFromCPP(
int tagKey,
793 setTaggedValueFromCPP(
int tagKey,
803 copyWithMask(
const Data& other,
855 nonuniforminterp(boost::python::object in, boost::python::object out,
bool check_boundaries);
858 nonuniformslope(boost::python::object in, boost::python::object out,
bool check_boundaries);
876 boost::python::object
877 integrateToTuple_const()
const;
884 boost::python::object
902 wherePositive()
const;
910 whereNegative()
const;
918 whereNonNegative()
const;
926 whereNonPositive()
const;
1039 const boost::python::tuple
1040 minGlobalDataPoint()
const;
1049 const boost::python::tuple
1050 maxGlobalDataPoint()
const;
1102 trace(
int axis_offset)
const;
1130 const boost::python::tuple
1139 swapaxes(
const int axis0,
const int axis1)
const;
1195 besselFirstKind(
int order);
1203 besselSecondKind(
int order);
1343 powD(
const Data& right)
const;
1353 powO(
const boost::python::object& right)
const;
1364 rpowO(
const boost::python::object& left)
const;
1372 Data& operator+=(
const Data& right);
1373 Data& operator+=(
const boost::python::object& right);
1375 Data& operator=(
const Data& other);
1383 Data& operator-=(
const Data& right);
1384 Data& operator-=(
const boost::python::object& right);
1392 Data& operator*=(
const Data& right);
1393 Data& operator*=(
const boost::python::object& right);
1401 Data& operator/=(
const Data& right);
1402 Data& operator/=(
const boost::python::object& right);
1414 Data truedivO(
const boost::python::object& right);
1420 Data rtruedivO(
const boost::python::object& left);
1426 boost::python::object __add__(
const boost::python::object& right);
1433 boost::python::object __sub__(
const boost::python::object& right);
1439 boost::python::object __rsub__(
const boost::python::object& right);
1445 boost::python::object __mul__(
const boost::python::object& right);
1451 boost::python::object __div__(
const boost::python::object& right);
1457 boost::python::object __rdiv__(
const boost::python::object& right);
1463 matrixInverse()
const;
1470 probeInterpolation(
const FunctionSpace& functionspace)
const;
1488 getItem(
const boost::python::object& key)
const;
1502 setItemD(
const boost::python::object& key,
1506 setItemO(
const boost::python::object& key,
1507 const boost::python::object& value);
1516 template <
class UnaryFunction>
1540 setSlice(
const Data& value,
1557 get_MPIRank(
void)
const;
1566 get_MPISize(
void)
const;
1574 get_MPIComm(
void)
const;
1582 borrowData(
void)
const;
1585 borrowDataPtr(
void)
const;
1588 borrowReadyPtr(
void)
const;
1633 getNumberOfTaggedValues()
const;
1643 void init_from_data_and_fs(
const Data& inData,
1646 template <
typename S>
1648 maskWorker(
Data& other2,
Data& mask2,
S sentinel);
1650 template <
class BinaryOp>
1667 template<
typename Scalar>
1668 boost::python::object
1672 calc_minGlobalDataPoint(
int& ProcNo,
int& DataPointNo)
const;
1675 calc_maxGlobalDataPoint(
int& ProcNo,
int& DataPointNo)
const;
1680 minval_nonlazy()
const;
1684 maxval_nonlazy()
const;
1697 return m_data->operandCheck(*(right.
m_data.get()));
1705 template <
class BinaryFunction>
1708 reduction(BinaryFunction operation,
1718 template <
class BinaryFunction>
1721 dp_algorithm(BinaryFunction operation,
1730 typeMatchLeft(
Data& right)
const;
1738 typeMatchRight(
const Data& right);
1789 ESYS_ASSERT(dr!=0,
"error casting to DataReady.");
1797 ESYS_ASSERT(dr!=0,
"error casting to DataReady.");
1808 DataReady_ptr dr=REFCOUNTNS::dynamic_pointer_cast<DataReady>(m_data);
1809 ESYS_ASSERT(dr.get()!=0,
"error casting to DataReady.");
1817 ESYS_ASSERT(dr.get()!=0,
"error casting to DataReady.");
1837 #ifdef SLOWSHARECHECK
1838 return m_data->isShared();
1840 return !m_data.unique();
1849 if (omp_in_parallel())
1851 throw DataException(
"Please do not call forceResolve() in a parallel region.");
1865 if (omp_in_parallel())
1867 throw DataException(
"Programming error. Please do not run exclusiveWrite() in multi-threaded sections.");
1877 m_data->exclusivewritecalled=
true;
1886 if (isLazy() || isShared())
1888 std::ostringstream oss;
1889 oss <<
"Programming error. ExclusiveWrite required - please call requireWrite() isLazy=" << isLazy() <<
" isShared()=" << isShared();
1907 #ifdef IKNOWWHATIMDOING
1910 template <
typename S>
1917 #ifdef IKNOWWHATIMDOING
1934 long seed,
const boost::python::tuple& filter);
1960 throw DataException(
"Error, attempt to acquire RW access to lazy data. Please call requireWrite() first.");
1963 if (!
getReady()->exclusivewritecalled)
1965 throw DataException(
"Error, call to Data::getSampleDataRW without a preceeding call to requireWrite/exclusiveWrite.");
1977 throw DataException(
"Error, attempt to acquire RW access to lazy data. Please call requireWrite() first.");
1980 if (!
getReady()->exclusivewritecalled)
1982 throw DataException(
"Error, call to Data::getSampleDataRW without a preceeding call to requireWrite/exclusiveWrite.");
1998 return &((*res)[offset]);
2010 throw DataException(
"Programming error: complex lazy objects are not supported.");
2022 throw DataException(
"Programmer error - getDataRO must not be called on Lazy Data.");
2040 throw DataException(
"Programmer error - getDataRO must not be called on Lazy Data.");
2067 Data
operator+(
const Data& left,
const Data& right);
2075 Data
operator-(
const Data& left,
const Data& right);
2083 Data
operator*(
const Data& left,
const Data& right);
2091 Data
operator/(
const Data& left,
const Data& right);
2100 Data
operator+(
const Data& left,
const boost::python::object& right);
2109 Data
operator-(
const Data& left,
const boost::python::object& right);
2118 Data
operator*(
const Data& left,
const boost::python::object& right);
2127 Data
operator/(
const Data& left,
const boost::python::object& right);
2136 Data
operator+(
const boost::python::object& left,
const Data& right);
2145 Data
operator-(
const boost::python::object& left,
const Data& right);
2154 Data
operator*(
const boost::python::object& left,
const Data& right);
2163 Data
operator/(
const boost::python::object& left,
const Data& right);
2172 std::ostream&
operator<<(std::ostream& o,
const Data& data);
2198 return *
this / right;
2236 template <
class BinaryFunction>
2243 ESYS_ASSERT(leftC!=0,
"Programming error - casting to DataExpanded.");
2251 const auto& vec=data.
getTypedVectorRO(
typename BinaryFunction::first_argument_type(0));
2255 #pragma omp parallel private(local_current_value)
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++) {
2265 #pragma omp critical
2266 global_current_value=operation(global_current_value,local_current_value);
2268 return global_current_value;
2271 ESYS_ASSERT(leftC!=0,
"Programming error - casting to DataTagged.");
2276 const auto& vec=data.
getTypedVectorRO(
typename BinaryFunction::first_argument_type(0));
2280 for (std::list<int>::const_iterator i=used.begin();i!=used.end();++i)
2283 DataTagged::DataMapType::const_iterator it=lookup.find(
tag);
2284 if ((
tag==0) || (it==lookup.end()))
2293 return current_value;
2296 ESYS_ASSERT(leftC!=0,
"Programming error - casting to DataConstant.");
2299 throw DataException(
"Error - Operations (algorithm) not permitted on instances of DataEmpty.");
2301 throw DataException(
"Error - Operations not permitted on instances of DataLazy.");
2303 throw DataException(
"Error - Data encapsulates an unknown type.");
2315 template <
class BinaryFunction>
2321 throw DataException(
"Error - Operations (dp_algorithm) not permitted on instances of DataEmpty.");
2327 ESYS_ASSERT(dataE!=0,
"Programming error - casting data to DataExpanded.");
2328 ESYS_ASSERT(resultE!=0,
"Programming error - casting result to DataExpanded.");
2342 #pragma omp parallel for private(i,j) schedule(static)
2343 for (i=0;i<numSamples;i++) {
2344 for (j=0;j<numDPPSample;j++) {
2355 ESYS_ASSERT(dataT!=0,
"Programming error - casting data to DataTagged.");
2364 for (DataTagged::DataMapType::const_iterator i=lookup.begin(); i!=lookup.end(); i++) {
2374 return Data(resultT);
2380 ESYS_ASSERT(dataC!=0,
"Programming error - casting data to DataConstant.");
2381 ESYS_ASSERT(resultC!=0,
"Programming error - casting result to DataConstant.");
2390 throw DataException(
"Error - Operations not permitted on instances of DataLazy.");
2392 throw DataException(
"Error - Data encapsulates an unknown type.");
2417 #endif // __ESCRIPT_DATA_H__
const DataReady * getReady() const
Definition: Data.h:1786
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
void maskWorker(Data &other2, Data &mask2, S sentinel)
Definition: Data.cpp:954
bool isReady() const
Return true if this data is ready.
Definition: Data.cpp:1153
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
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:30
int getNumDataPointsPerSample() const
Return the number of data points per sample.
Definition: Data.h:544
@ MINVAL
Definition: ES_optype.h:72
Data getSlice(const DataTypes::RegionType ®ion) const
Return a Data object containing the specified slice of this Data object.
Definition: Data.cpp:3478
bool isComplex() const
True if components of this data are stored as complex.
Definition: Data.cpp:1160
Return the minimum value of the two given values.
Definition: ArrayOps.h:77
DataAbstract * borrowData(void) const
return the object produced by the factory, which is a DataConstant or DataExpanded TODO Ownership of ...
Definition: Data.cpp:4617
@ SIGN
Definition: ES_optype.h:53
Data erf() const
Return the error function erf of each data point of this Data object.
Definition: Data.cpp:2111
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
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
bool m_lazy
Definition: Data.h:1776
std::string shapeToString(const DataTypes::ShapeType &shape)
Return the given shape as a string.
Definition: DataTypes.cpp:117
Data oneOver() const
Returns 1./ Data object.
Definition: Data.cpp:1246
double real_t
type of all real-valued scalars in escript
Definition: DataTypes.h:52
DataTypes::cplx_t getEltC() const
Definition: WrappedArray.h:147
int MPI_Op
Definition: EsysMPI.h:46
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
const DataMapType & getTagLookup() const
getTagLookup
Definition: DataTagged.h:762
Data atanh() const
Return the atanh of each data point of this Data object.
Definition: Data.cpp:2132
DataTypes::real_t infWorker() const
Definition: Data.cpp:2576
@ CONJ
Definition: ES_optype.h:79
DataTypes::CplxVectorType::const_reference getDataAtOffsetRO(DataTypes::CplxVectorType::size_type i, DataTypes::cplx_t dummy)
Data atan() const
Return the atan of each data point of this Data object.
Definition: Data.cpp:2082
@ LZ
Definition: ES_optype.h:61
const ElementType & const_reference
Definition: DataVectorAlt.h:52
const DataTypes::real_t * getSampleDataRO(DataTypes::RealVectorType::size_type sampleNo, DataTypes::real_t dummy=0) const
Definition: DataReady.h:218
Data rtruedivO(const boost::python::object &left)
Newer style division operator for python.
Definition: Data.h:2221
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
Data antihermitian() const
Return the anti-hermitian part of a matrix which is half the matrix minus its hermitian.
Definition: Data.cpp:2804
void setToZero()
set all values to zero
Definition: Data.cpp:815
Data cos() const
Return the cos of each data point of this Data object.
Definition: Data.cpp:2053
void addTag(int tagKey)
addTag - does not modify the default value for this object. ** Not unit tested **
Definition: DataTagged.cpp:685
DataTypes::real_t Lsup()
Return the maximum absolute value of this Data object.
Definition: Data.cpp:2211
Data grad() const
Definition: Data.cpp:1350
@ COSH
Definition: ES_optype.h:45
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
const DataTypes::RealVectorType * resolveSample(int sampleNo, size_t &roffset) const
Compute the value of the expression for the given sample.
Definition: DataLazy.cpp:2336
DataTypes::real_t getElt() const
Definition: WrappedArray.h:89
void setValueOfDataPoint(int dataPointNo, const DataTypes::real_t)
sets the values of a data-point on this process
Definition: Data.cpp:1655
void print(void)
print the data values to stdout. Used for debugging
Definition: Data.cpp:5383
Return the maximum value of the two given values.
Definition: ArrayOps.h:62
virtual const DataTypes::RealVectorType & getVectorRO() const =0
virtual const DataTypes::RealVectorType & getTypedVectorRO(DataTypes::real_t dummy) const
Definition: DataConstant.cpp:872
DataTypes::RealVectorType::reference getDataByTagRW(int tag, DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0)
getDataByTag
Definition: DataTagged.cpp:1017
void replaceNaN(DataTypes::real_t value)
replaces all NaN values with value
Definition: Data.cpp:2396
Data whereNonNegative() const
Return a Data with a 1 for +ive or 0 values and a 0 for -ive values.
Definition: Data.cpp:1275
Data tan() const
Return the tan of each data point of this Data object.
Definition: Data.cpp:2060
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
void tag()
If possible convert this Data to DataTagged. This will only allow Constant data to be converted to ta...
Definition: Data.cpp:1204
#define MAKELAZYBIN(R, X)
Definition: Data.cpp:97
DataTypes::RealVectorType::size_type getLength() const
Return the number of doubles stored for this Data.
Definition: Data.cpp:1367
DataTypes::RealVectorType::size_type getDefaultOffset() const
Returns the offset in the structure which stores the default value.
Definition: DataTagged.h:724
void binaryOpDataEEC(DataExpanded &result, const DataExpanded &left, const DataConstant &right, escript::ES_optype operation)
Definition: BinaryDataReadyOps.cpp:752
boost::python::object integrateToTuple()
Calculate the integral over the function space domain as a python tuple.
Definition: Data.cpp:1784
void binaryOpDataEEE(DataExpanded &result, const DataExpanded &left, const DataExpanded &right, escript::ES_optype operation)
Definition: BinaryDataReadyOps.cpp:834
DataAbstract_ptr borrowDataPtr(void) const
Definition: Data.cpp:4624
const_Domain_ptr getDomain() const
Return the domain.
Definition: Data.h:487
DataAbstract_ptr getPtr()
Return shared pointer managing this object.
Definition: DataAbstract.cpp:39
Data sinh() const
Return the sinh of each data point of this Data object.
Definition: Data.cpp:2089
Data abs() const
Return the absolute value of each data point of this Data object.
Definition: Data.cpp:2161
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
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
bool hasNoSamples() const
Return true if this object contains no samples. This is not the same as isEmpty()
Definition: Data.h:745
@ SQRT
Definition: ES_optype.h:58
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
Data getItem(const boost::python::object &key) const
Returns a slice from this Data object.
Definition: Data.cpp:3464
int getNoValues() const
Return the number of values in the shape for this object.
Definition: Data.h:580
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
@ IMAG
Definition: ES_optype.h:78
boost::shared_ptr< DataAbstract > DataAbstract_ptr
Definition: DataAbstract.h:52
@ SWAP
Definition: ES_optype.h:71
@ EXP
Definition: ES_optype.h:57
boost::python::object integrateWorker() const
DataConstant stores a single data point which represents the entire function space.
Definition: DataConstant.h:38
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
@ NSYM
Definition: ES_optype.h:67
Data swapaxes(const int axis0, const int axis1) const
swaps the components axis0 and axis1
Definition: Data.cpp:2661
bool m_protected
Definition: Data.h:1775
const DataTypes::ShapeType & getDataPointShape() const
Return a reference to the data point shape.
Definition: Data.h:705
DataTypes::RealVectorType::reference getDefaultValueRW(DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0)
getDefaultValue
Definition: DataTagged.h:731
void init_from_data_and_fs(const Data &inData, const FunctionSpace &functionspace)
Definition: Data.cpp:430
Data interpolate(const FunctionSpace &functionspace) const
Interpolates this onto the given functionspace and returns the result as a Data object.
Definition: Data.cpp:1311
Definition: WrappedArray.h:33
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
Data exp() const
Return the exponential function of each data point of this Data object.
Definition: Data.cpp:2187
DataTypes::vec_size_type size_type
Definition: DataVectorAlt.h:50
bool isComplex() const
Definition: WrappedArray.h:71
boost::python::object __mul__(const boost::python::object &right)
wrapper for python multiply operation
Definition: Data.cpp:5981
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
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
Data minval_nonlazy() const
Definition: Data.cpp:2621
DataTypes::real_t sup_const() const
Definition: Data.cpp:2246
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
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
Data C_TensorUnaryOperation(Data const &arg_0, escript::ES_optype operation, DataTypes::real_t tol=0)
Definition: Data.cpp:6075
@ NHER
Definition: ES_optype.h:76
bool isTagged() const
Return true if this Data is tagged.
Definition: Data.cpp:1125
void binaryOpDataEET(DataExpanded &result, const DataExpanded &left, const DataTagged &right, escript::ES_optype operation)
Definition: BinaryDataReadyOps.cpp:327
const DataTypes::cplx_t * getSampleDataRO(DataTypes::CplxVectorType::size_type sampleNo, DataTypes::cplx_t dummy) const
Data besselSecondKind(int order)
Return the Bessel function of the second kind for each data point of this Data object.
Definition: Data.cpp:1864
#define MPI_SUM
Definition: EsysMPI.h:54
@ SINH
Definition: ES_optype.h:44
Data operator-(const Data &left, const Data &right)
Operator- Takes two Data objects.
Definition: Data.cpp:3355
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
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
@ TRANS
Definition: ES_optype.h:69
DataTypes::RealVectorType::const_reference getDataByTagRO(int tag, DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0) const
Definition: DataTagged.cpp:1006
DataTypes::real_t LsupWorker() const
Definition: Data.cpp:2476
Data phase() const
Return the phase/arg/angular-part of complex values.
Definition: Data.cpp:2023
DataTypes::RealVectorType::reference getDataAtOffsetRW(DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy)
Definition: Data.cpp:4678
DataTypes::real_t sup()
Return the maximum value of this Data object.
Definition: Data.cpp:2260
(Testing use only) Provides a domain to wrap a collection of values.
Definition: TestDomain.h:43
boost::shared_ptr< const DataReady > const_DataReady_ptr
Definition: DataAbstract.h:60
@ ATANH
Definition: ES_optype.h:50
bool isConstant() const
Return true if this Data is constant.
Definition: Data.cpp:1139
#define ESCRIPT_MAX_DATA_RANK
Definition: Data.h:39
boost::shared_ptr< AbstractDomain > Domain_ptr
Definition: AbstractDomain.h:41
@ LOG
Definition: ES_optype.h:52
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
Data bessel(int order, DataTypes::real_t(*besselfunc)(int, DataTypes::real_t))
Bessel worker function.
Definition: Data.cpp:1871
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.
int(* binOpFnPtr)(double *, const double *, const double *, int, int, int)
Definition: Dodgy.h:31
Data interpolateFromTable1D(const WrappedArray &table, DataTypes::real_t Amin, DataTypes::real_t Astep, DataTypes::real_t undef, bool check_boundaries)
Definition: Data.cpp:4761
void TensorSelfUpdateBinaryOperation(const Data &right, escript::ES_optype operation)
Definition: Data.cpp:6527
DataTypes::CplxVectorType::reference getDataAtOffsetRWC(DataTypes::CplxVectorType::size_type i)
Definition: DataReady.h:255
int getDataPointSize() const
Return the size of the data point. It is the product of the data point shape dimensions.
Definition: Data.cpp:1360
boost::python::object __add__(const boost::python::object &right)
wrapper for python add operation
Definition: Data.cpp:5908
@ SUB
Definition: ES_optype.h:34
binOpFnPtr binOpFnPtrFromVoidPtr(void *v)
Definition: Dodgy.cpp:23
Data()
Default constructor. Creates a DataEmpty object.
Definition: Data.cpp:246
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
Definition: FunctionSpace.h:36
Data truedivO(const boost::python::object &right)
Newer style division operator for python.
Definition: Data.h:2208
Domain_ptr getDomainPython() const
Return the domain. TODO: For internal use only. This should be removed.
Definition: Data.h:501
virtual bool hasInf() const =0
Return true if data contains Inf or -Inf.
Data tanh() const
Return the tanh of each data point of this Data object.
Definition: Data.cpp:2103
@ ACOS
Definition: ES_optype.h:42
std::list< int > getListOfTagsSTL() const
Returns an stl list of the tags used in this function space.
Definition: FunctionSpace.cpp:335
void binaryOpDataTCT(DataTagged &result, const DataConstant &left, const DataTagged &right, escript::ES_optype operation)
Definition: BinaryDataReadyOps.cpp:191
DataLazy_ptr makePromote(DataLazy_ptr p)
Definition: DataLazy.cpp:115
Definition: DataReady.h:37
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
const FunctionSpace & getFunctionSpace() const
Return the function space.
Definition: Data.h:463
void complicate()
Definition: Data.cpp:6053
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
void delaySelf()
convert the current data into lazy data.
Definition: Data.cpp:797
const DataTypes::RealVectorType & getVectorRO() const
Definition: DataTagged.cpp:1650
Return the absolute maximum value of the two given values.
Definition: ArrayOps.h:93
std::map< int, int > DataMapType
Definition: DataTagged.h:58
const_Domain_ptr getDomain() const
Returns the function space domain.
Definition: FunctionSpace.cpp:103
#define MPI_INT
Definition: EsysMPI.h:48
friend Data condEvalWorker(escript::Data &mask, escript::Data &trueval, escript::Data &falseval, S sentinel)
@ TANH
Definition: ES_optype.h:46
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
DataTypes::cplx_t * getSampleDataRW(DataTypes::RealVectorType::size_type sampleNo, DataTypes::cplx_t dummy)
#define MPI_MAX
Definition: EsysMPI.h:56
#define MAKELAZYOPOFF(X, Y)
Definition: Data.cpp:71
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
@ PHS
Definition: ES_optype.h:84
virtual void replaceInf(DataTypes::real_t value)=0
replaces all (+/-)Inf values with value
@ ERF
Definition: ES_optype.h:47
int getNumSamples() const
Return the number of samples.
Definition: Data.h:533
@ NEG
Definition: ES_optype.h:55
void copy(dim_t N, double *out, const double *in)
out = in
Definition: PasoUtil.h:88
Data powD(const Data &right) const
Return the given power of each data point of this Data object.
Definition: Data.cpp:3333
unsigned int getRank() const
Definition: WrappedArray.h:77
@ GZ
Definition: ES_optype.h:60
Simulates a full dataset accessible via sampleNo and dataPointNo.
Definition: DataTagged.h:46
void binaryOpDataTTT(DataTagged &result, const DataTagged &left, const DataTagged &right, escript::ES_optype operation)
Definition: BinaryDataReadyOps.cpp:672
int getNumDPPSample() const
Return the number of data points per sample.
Definition: DataAbstract.h:612
Data operator+(const Data &left, const Data &right)
Operator+ Takes two Data objects.
Definition: Data.cpp:3345
Data represents a collection of datapoints.
Definition: Data.h:64
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
DataTypes::CplxVectorType::const_reference getDataAtOffsetROC(DataTypes::CplxVectorType::size_type i) const
Definition: DataReady.h:248
Definition: DataException.h:28
std::string toString() const
Write the data as a string. For large amounts of data, a summary is printed.
Definition: Data.cpp:4639
static dim_t nz
Definition: SparseMatrix_saveHB.cpp:37
Data whereNonPositive() const
Return a Data with a 1 for -ive or 0 values and a 0 for +ive values.
Definition: Data.cpp:1286
Data & operator=(const Data &other)
Definition: Data.cpp:3198
void forceResolve()
Definition: Data.h:1844
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
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
void checkExclusiveWrite()
checks if caller can have exclusive write to the object
Definition: Data.h:1884
escript::Data getX() const
Returns the spatial locations of the data points.
Definition: FunctionSpace.cpp:229
Describes binary operations performed on instances of DataAbstract.
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
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:44
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
const boost::python::tuple getShapeTuple() const
Return the data point shape as a tuple of integers.
Definition: Data.cpp:724
#define MAKELAZYBIN2(L, R, X)
Definition: Data.cpp:105
DataReady * getReady()
Definition: Data.h:1794
void typeMatchLeft(Data &right) const
Convert the data type of the RHS to match this.
Definition: Data.cpp:3525
Contains the types to represent Shapes, Regions, RegionLoop ranges and vectors of data as well as the...
Definition: DataTypes.cpp:88
@ ABS
Definition: ES_optype.h:54
Data symmetric() const
Return the symmetric part of a matrix which is half the matrix plus its transpose.
Definition: Data.cpp:2718
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...
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
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...
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
Implements the DataAbstract interface for an empty Data object.
Definition: DataEmpty.h:34
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
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
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
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
void replaceInf(DataTypes::real_t value)
Definition: Data.cpp:2441
DataReady_ptr resolve()
Return a data object with all points resolved.
Definition: DataReady.cpp:30
Data real() const
Definition: Data.cpp:1984
std::vector< std::pair< int, int > > RegionType
Definition: DataTypes.h:45
Data sin() const
Return the sin of each data point of this Data object.
Definition: Data.cpp:2046
@ REAL
Definition: ES_optype.h:77
int noValues(const ShapeType &shape)
Calculate the number of values in a datapoint with the given shape.
Definition: DataTypes.cpp:91
Data maxval() const
Return the maximum value of each data point of this Data object.
Definition: Data.cpp:2643
const_DataReady_ptr getReadyPtr() const
Definition: Data.h:1814
const DataTypes::ShapeType & getShape() const
Return the shape information for the point data.
Definition: DataAbstract.h:642
Data besselFirstKind(int order)
Return the Bessel function of the first kind for each data point of this Data object.
Definition: Data.cpp:1857
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
Data acosh() const
Return the acosh of each data point of this Data object.
Definition: Data.cpp:2125
int getNumSamples() const
Return the number of samples.
Definition: DataAbstract.h:623
void binaryOpDataECE(DataExpanded &result, const DataConstant &left, const DataExpanded &right, escript::ES_optype operation)
Definition: BinaryDataReadyOps.cpp:271
@ ACOSH
Definition: ES_optype.h:49
Data cosh() const
Return the cosh of each data point of this Data object.
Definition: Data.cpp:2096
@ MUL
Definition: ES_optype.h:35
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
DataTypes::CplxVectorType::reference getDataAtOffsetRW(DataTypes::CplxVectorType::size_type i, DataTypes::cplx_t dummy)
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
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
virtual const DataTypes::RealVectorType & getTypedVectorRO(DataTypes::real_t dummy) const
Definition: DataTagged.cpp:1676
void convertArray() const
Definition: WrappedArray.cpp:531
Data trace(int axis_offset) const
Return the trace of a matrix.
Definition: Data.cpp:2844
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
const boost::python::tuple minGlobalDataPoint() const
Definition: Data.cpp:2976
void typeMatchRight(const Data &right)
Convert the data type of this to match the RHS.
Definition: Data.cpp:3545
@ ADD
Definition: ES_optype.h:33
@ GEZ
Definition: ES_optype.h:62
Data copySelf() const
Return a pointer to a deep copy of this object.
Definition: Data.cpp:770
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
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
Give a short description of what DataExpanded does.
Definition: DataExpanded.h:44
bool isEmpty() const
Definition: Data.cpp:1132
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
void replaceInfPython(boost::python::object obj)
Definition: Data.cpp:2461
int getNumDataPoints() const
Return the number of data points.
Definition: Data.h:523
@ TRACE
Definition: ES_optype.h:70
@ LEZ
Definition: ES_optype.h:63
@ DIV
Definition: ES_optype.h:36
void binaryOpDataTTC(DataTagged &result, const DataTagged &left, const DataConstant &right, escript::ES_optype operation)
Definition: BinaryDataReadyOps.cpp:520
void dump(const std::string fileName) const
dumps the object into a netCDF file
Definition: Data.cpp:5413
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
void calc_maxGlobalDataPoint(int &ProcNo, int &DataPointNo) const
Definition: Data.cpp:3089
EscriptParams escriptParams
Definition: EscriptParams.cpp:29
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
const boost::python::object getValueOfGlobalDataPointAsTuple(int procNo, int dataPointNo)
Return a data point across all processors as a python tuple.
Definition: Data.cpp:1699
virtual DataTypes::RealVectorType::size_type getPointOffset(int sampleNo, int dataPointNo) const
getPointOffset
Definition: DataTagged.cpp:982
bool isShared() const
Definition: Data.h:1835
virtual const DataTypes::RealVectorType & getTypedVectorRO(DataTypes::real_t dummy) const
Definition: DataExpanded.cpp:1532
void setItemD(const boost::python::object &key, const Data &value)
Copies slice from value into this Data object.
Definition: Data.cpp:3494
boost::python::object integrateToTuple_const() const
Calculate the integral over the function space domain as a python tuple.
Definition: Data.cpp:1770
void binaryOpDataETE(DataExpanded &result, const DataTagged &left, const DataExpanded &right, escript::ES_optype operation)
Definition: BinaryDataReadyOps.cpp:383
Data operator*(const AbstractSystemMatrix &left, const Data &right)
Definition: AbstractSystemMatrix.cpp:60
DataReady_ptr getReadyPtr()
Definition: Data.h:1806
const boost::python::tuple maxGlobalDataPoint() const
Definition: Data.cpp:3079
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
void copyWithMask(const Data &other, const Data &mask)
Copy other Data object into this Data object where mask is positive.
Definition: Data.cpp:851
@ RECIP
Definition: ES_optype.h:59
ES_optype
Definition: ES_optype.h:30
boost::python::object __rsub__(const boost::python::object &right)
wrapper for python reverse subtract operation
Definition: Data.cpp:5956
Data transpose(int axis_offset) const
Transpose each data point of this Data object around the given axis.
Definition: Data.cpp:2899
void matrixInverseError(int err)
throws an appropriate exception based on failure of matrix_inverse.
Definition: DataVectorOps.cpp:186
#define V(_K_, _I_)
Definition: ShapeFunctions.cpp:121
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
Data delay()
produce a delayed evaluation version of this Data.
Definition: Data.cpp:786
Definition: FunctionSpaceException.h:29
#define MAKELAZYOP2(X, Y, Z)
Definition: Data.cpp:79
#define MPI_DOUBLE
Definition: EsysMPI.h:49
DataTypes::RealVectorType::const_reference getDefaultValueRO(DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0) const
Definition: DataTagged.h:738
Data hermitian() const
Return the hermitian part of a matrix which is half the matrix plus its adjoint.
Definition: Data.cpp:2777
Data & operator*=(const Data &right)
Overloaded operator *=.
Definition: Data.cpp:3233
#define MPI_MIN
Definition: EsysMPI.h:55
T1 conjugate(const T2 i)
Definition: ArrayOps.h:734
DataTypes::real_t supWorker() const
Definition: Data.cpp:2533
Data whereNegative() const
Return a Data with a 1 for -ive values and a 0 for +ive or 0 values.
Definition: Data.cpp:1264
Data minval() const
Return the minimum value of each data point of this Data object.
Definition: Data.cpp:2652
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
Data operator/(const Data &left, const Data &right)
Operator/ Takes two Data objects.
Definition: Data.cpp:3374
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() const
Returns the spatial locations of the data points.
Definition: Data.h:474
Data log() const
Return the natural log of each data point of this Data object.
Definition: Data.cpp:2146
Data truedivD(const Data &right)
Newer style division operator for python.
Definition: Data.h:2196
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
boost::python::object __div__(const boost::python::object &right)
wrapper for python divide operation
Definition: Data.cpp:6005
DataReady_ptr borrowReadyPtr(void) const
Definition: Data.cpp:4631
#define M_PI
Definition: ArrayOps.h:36
virtual void setSlice(const DataAbstract *value, const DataTypes::RegionType ®ion)=0
Copy the specified region from the given object.
Definition: AbstractContinuousDomain.cpp:23
Data matrixInverse() const
return inverse of matricies.
Definition: Data.cpp:3291
DataTypes::real_t inf()
Return the minimum value of this Data object.
Definition: Data.cpp:2299
Data wherePositive() const
Return a Data with a 1 for +ive values and a 0 for 0 or -ive values.
Definition: Data.cpp:1253
bool isExpanded() const
Return true if this Data is expanded.
Definition: Data.cpp:1111
@ PROD
Definition: ES_optype.h:68
virtual DataTypes::RealVectorType & getVectorRW()=0
Provide access to underlying storage. Internal use only!
bool hasInf()
Definition: Data.cpp:2430
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
DataTypes::real_t inf_const() const
Definition: Data.cpp:2285
@ LOG10
Definition: ES_optype.h:51
Data nonuniformslope(boost::python::object in, boost::python::object out, bool check_boundaries)
Definition: Data.cpp:5304
int getTagNumber(int dpno)
Return the tag number associated with the given data-point.
Definition: Data.cpp:3669
boost::python::object __sub__(const boost::python::object &right)
wrapper for python subtract operation
Definition: Data.cpp:5932
Data & operator/=(const Data &right)
Overloaded operator /=.
Definition: Data.cpp:3260
Data antisymmetric() const
Return the antisymmetric part of a matrix which is half the matrix minus its transpose.
Definition: Data.cpp:2741
DataTypes::real_t Lsup_const() const
Definition: Data.cpp:2201
Definition: DataAbstract.h:63
@ SYM
Definition: ES_optype.h:66
#define MAKELAZYOP(X)
Definition: Data.cpp:63
bool always_real(escript::ES_optype operation)
Definition: ArrayOps.cpp:66
int getTooManyLines() const
Definition: EscriptParams.h:47
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
DataTypes::RealVectorType::size_type getOffsetForTag(int tag) const
getOffsetForTag
Definition: DataTagged.cpp:995
Describes binary operations performed on DataVector.
virtual DataTypes::RealVectorType & getTypedVectorRW(DataTypes::real_t dummy)=0
These versions use the type system rather than method name to determine return type.
bool supports_cplx(escript::ES_optype operation)
Definition: ArrayOps.cpp:26
int getTypeCode() const
Returns the function space type code.
Definition: FunctionSpace.cpp:95
#define CHECK_DO_CRES
Definition: Data.cpp:113
Data asinh() const
Return the asinh of each data point of this Data object.
Definition: Data.cpp:2118
void setSlice(const Data &value, const DataTypes::RegionType ®ion)
Copy the specified slice from the given value into this Data object.
Definition: Data.cpp:3510
@ SIN
Definition: ES_optype.h:38
int getDim() const
Return the number of spatial dimensions of the underlying domain.
Definition: FunctionSpace.h:183
#define AUTOLAZYON
Definition: Data.cpp:62
@ EZ
Definition: ES_optype.h:65
std::string toString() const
Returns a text description of the function space.
Definition: FunctionSpace.cpp:118
bool isLazy() const
Return true if this Data is lazy.
Definition: Data.cpp:1146
FunctionSpace function(const AbstractDomain &domain)
Return a function FunctionSpace.
Definition: FunctionSpaceFactory.cpp:43
~Data()
Destructor.
Definition: Data.cpp:601
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
long getShapeProduct() const
Returns the product of the data point shapes.
Definition: Data.cpp:745
void setTupleForGlobalDataPoint(int id, int proc, boost::python::object)
Set the value of a global data point.
Definition: Data.cpp:1567
virtual DataAbstract * deepCopy() const =0
Return a deep copy of the current object.
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
void binaryOpDataCCC(DataConstant &result, const DataConstant &left, const DataConstant &right, escript::ES_optype operation)
Definition: BinaryDataReadyOps.cpp:66
void setValueOfDataPointC(int dataPointNo, const DataTypes::cplx_t)
Definition: Data.cpp:1676
void setItemO(const boost::python::object &key, const boost::python::object &value)
Definition: Data.cpp:3486
Data condEval(escript::Data &mask, escript::Data &trueval, escript::Data &falseval)
Definition: Data.cpp:5644
int MPI_Comm
Definition: EsysMPI.h:44
Data log10() const
Return the log to base 10 of each data point of this Data object.
Definition: Data.cpp:2139
void addTaggedValue(int tagKey, const DataTypes::ShapeType &pointshape, const DataTypes::RealVectorType &value, int dataOffset=0)
addTaggedValue
Definition: DataTagged.cpp:608
Data pos() const
Return the identity of each data point of this Data object. Simply returns this object unmodified.
Definition: Data.cpp:2175
ElementType & reference
Definition: DataVectorAlt.h:51
boost::python::object __rdiv__(const boost::python::object &right)
wrapper for python reverse divide operation
Definition: Data.cpp:6029
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
void replaceNaNPython(boost::python::object obj)
replaces all NaN values with value
Definition: Data.cpp:2416
Data imag() const
Definition: Data.cpp:2003
bool hasNaN()
returns return true if data contains NaN.
Definition: Data.cpp:2385
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
DataTypes::real_t makeNaN()
returns a NaN.
Definition: ArrayOps.h:145
Data & operator+=(const Data &right)
Overloaded operator +=.
Definition: Data.cpp:3170
void copy(const Data &other)
Make this object a deep copy of "other".
Definition: Data.cpp:777
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
@ POW
Definition: ES_optype.h:37
#define S(_J_, _I_)
Definition: ShapeFunctions.cpp:122
const DataTypes::CplxVectorType * resolveTypedSample(int sampleNo, size_t &roffset, DataTypes::cplx_t dummy) const
Definition: DataLazy.cpp:2389
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
Data neg() const
Return the negation of each data point of this Data object.
Definition: Data.cpp:2168
const FunctionSpace & getFunctionSpace() const
Return the function space associated with this Data object.
Definition: DataAbstract.h:635
Data nonuniforminterp(boost::python::object in, boost::python::object out, bool check_boundaries)
Definition: Data.cpp:5228
DataTypes::cplx_t * getSampleDataByTag(int tag, DataTypes::cplx_t dummy)
Definition: Data.h:661
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
virtual DataAbstract * getSlice(const DataTypes::RegionType ®ion) const =0
Return the given slice from this object.
DataTypes::real_t lazyAlgWorker(DataTypes::real_t init)
@ TAN
Definition: ES_optype.h:40
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
void calc_minGlobalDataPoint(int &ProcNo, int &DataPointNo) const
Definition: Data.cpp:2993
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
std::complex< real_t > cplx_t
complex data type
Definition: DataTypes.h:55
DataAbstract_ptr m_data
Definition: Data.h:1781
DataTypes::RealVectorType::reference getDataAtOffsetRW(DataTypes::RealVectorType::size_type i)
Definition: DataReady.h:240
Data acos() const
Return the acos of each data point of this Data object.
Definition: Data.cpp:2074
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
bool probeInterpolation(const FunctionSpace &functionspace) const
Returns true if this can be interpolated to functionspace.
Definition: Data.cpp:1317
Data maxval_nonlazy() const
Definition: Data.cpp:2632
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
void expand()
Whatever the current Data type make this into a DataExpanded.
Definition: Data.cpp:1180
boost::shared_ptr< DataReady > DataReady_ptr
Definition: DataAbstract.h:57
boost::shared_ptr< const AbstractDomain > const_Domain_ptr
Definition: AbstractDomain.h:44
const DataTypes::ShapeType & getShape() const
Definition: WrappedArray.h:83
#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
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
Data conjugate() const
For complex values return the conjugate values. For non-complex data return a copy.
Definition: Data.cpp:1964
boost::shared_ptr< DataLazy > DataLazy_ptr
Definition: DataLazy.h:43
void unaryOp2(UnaryFunction operation)
Perform the given unary operation on every element of every data point in this Data object.
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
void setProtection()
switches on update protection
Definition: Data.cpp:1166
virtual const DataTypes::RealVectorType & getTypedVectorRO(DataTypes::real_t dummy) const =0
Data asin() const
Return the asin of each data point of this Data object.
Definition: Data.cpp:2067
Data & operator-=(const Data &right)
Overloaded operator -=.
Definition: Data.cpp:3206
@ ASIN
Definition: ES_optype.h:41
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
AbstractContinuousDomain, base class for continuous domains.
Definition: AbstractContinuousDomain.h:47
Data sqrt() const
Return the square root of each data point of this Data object.
Definition: Data.cpp:2194
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
DataTypes::real_t rpow(DataTypes::real_t x, DataTypes::real_t y)
Definition: Data.h:2056
bool isProtected() const
Returns true, if the data object is protected against update.
Definition: Data.cpp:1172
#define MAKELAZYBINSELF(R, X)
Definition: Data.cpp:87
@ COS
Definition: ES_optype.h:39
@ ASINH
Definition: ES_optype.h:48
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
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
bool probeInterpolation(const FunctionSpace &other) const
Definition: FunctionSpace.h:203
@ ATAN
Definition: ES_optype.h:43
DataTypes::RegionType getSliceRegion(const DataTypes::ShapeType &shape, const bp::object &key)
Definition: DataTypes.cpp:137
@ MAXVAL
Definition: ES_optype.h:73
int getTagFromDataPointNo(DataTypes::dim_t dataPointNo) const
Returns the tag associated with the given data-point number.
Definition: FunctionSpace.cpp:150
static const ShapeType scalarShape
Use this instead of creating empty shape objects for scalars.
Definition: DataTypes.h:48
#define THROWONCOMPLEX
Definition: Data.cpp:55
@ NEZ
Definition: ES_optype.h:64
@ HER
Definition: ES_optype.h:75
std::ostream & operator<<(std::ostream &o, const Data &data)
Output operator.
Definition: Data.cpp:3679
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
virtual bool hasNaN() const =0
return true if data contains NaN.
virtual void replaceNaN(DataTypes::real_t value)=0
replaces all NaN values with value
unsigned int getDataPointRank() const
Return the rank of the point data.
Definition: Data.h:512
Wraps an expression tree of other DataObjects. The data will be evaluated when required.
Definition: DataLazy.h:49