escript  Revision_
DataTagged.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2018 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 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16 
17 
18 #ifndef __ESCRIPT_DATATAGGED_H__
19 #define __ESCRIPT_DATATAGGED_H__
20 
21 #include "system_dep.h"
22 
23 #include "DataReady.h"
24 #include "DataTypes.h"
25 
26 #include <map>
27 #include <vector>
28 
29 namespace escript {
30 
31 class DataConstant;
32 
44 class ESCRIPT_DLL_API DataTagged : public DataReady
45 {
46  typedef DataReady parent;
47  public:
48 
49  //
50  // Types for the lists of tags and values.
51  typedef std::vector<int> TagListType;
52  typedef std::vector<DataTypes::RealVectorType::ElementType> FloatBatchType;
53  typedef std::vector<DataTypes::CplxVectorType::ElementType> CplxBatchType;
54 
55  //
56  // Map from a tag to an offset into the data array.
57  typedef std::map<int, int> DataMapType;
58 
71  explicit DataTagged(const FunctionSpace& what,
72  const DataTypes::ShapeType &shape,
73  const int tags[],
74  const DataTypes::RealVectorType& data);
75 
76 
77  explicit DataTagged(const FunctionSpace& what,
78  const DataTypes::ShapeType &shape,
79  const int tags[],
80  const DataTypes::CplxVectorType& data);
81 
82 
95  explicit DataTagged(const FunctionSpace& what,
96  const DataTypes::ShapeType &shape,
97  const TagListType& tags,
98  const DataTypes::RealVectorType& data);
99 
100  explicit DataTagged(const FunctionSpace& what,
101  const DataTypes::ShapeType &shape,
102  const TagListType& tags,
103  const DataTypes::CplxVectorType& data);
104 
105 
112  DataTagged(const DataTagged& other);
113 
121  explicit DataTagged(const DataConstant& other);
122 
133  explicit DataTagged(const FunctionSpace& what,
134  const DataTypes::ShapeType& shape,
135  const DataTypes::RealVectorType& defaultvalue,
136  const DataTagged* tagsource=0);
137 
138  explicit DataTagged(const FunctionSpace& what,
139  const DataTypes::ShapeType& shape,
140  const DataTypes::CplxVectorType& defaultvalue,
141  const DataTagged* tagsource=0);
142 
143 
148  inline virtual
149  ~DataTagged() {};
150 
151  bool
152  isTagged() const
153  {
154  return true;
155  };
156 
160  bool
161  hasNaN() const;
162 
166  void
167  replaceNaN(DataTypes::real_t value);
168 
172  void
173  replaceNaN(DataTypes::cplx_t value);
174 
179  virtual bool
180  hasInf() const;
181 
186  virtual void
187  replaceInf(DataTypes::real_t value);
188 
193  virtual void
194  replaceInf(DataTypes::cplx_t value);
195 
196 
200  virtual
201  DataAbstract*
202  deepCopy() const;
203 
204 
210  virtual
211  DataAbstract*
212  zeroedCopy() const;
213 
214 
227  virtual
229  getSampleDataByTag(int tag, DataTypes::real_t dummy=0);
230 
231  virtual
233  getSampleDataByTag(int tag, DataTypes::cplx_t dummy);
234 
235 
243  virtual
244  std::string
245  toString() const;
250  virtual
251  void
252  dump(const std::string fileName) const;
253 
259  virtual int
260  matrixInverse(DataAbstract* out) const;
261 
266  virtual
267  void
268  setToZero();
269 
276  virtual
277  int
278  getTagNumber(int dpno);
279 
292  virtual
294  getPointOffset(int sampleNo,
295  int dataPointNo) const;
296 
314  void
315  addTaggedValues(const TagListType& tagKeys,
316  const FloatBatchType& values,
317  const ShapeType& vShape);
318 
319 
336  void
337  addTaggedValues(const TagListType& tagKeys,
338  const DataTypes::RealVectorType& values,
339  const ShapeType& vShape);
340 
341 
342 
343 
356  void
357  addTaggedValue(int tagKey,
358  const DataTypes::ShapeType& pointshape,
359  const DataTypes::RealVectorType& value,
360  int dataOffset=0);
361 
362  void
363  addTaggedValue(int tagKey,
364  const DataTypes::ShapeType& pointshape,
365  const DataTypes::CplxVectorType& value,
366  int dataOffset=0);
367 
368 
379  void
380  addTag(int tagKey);
381 
394  void
395  setTaggedValue(int tagKey,
396  const DataTypes::ShapeType& pointshape,
397  const DataTypes::RealVectorType& value,
398  int dataOffset=0);
399 
400  void
401  setTaggedValue(int tagKey,
402  const DataTypes::ShapeType& pointshape,
403  const DataTypes::CplxVectorType& value,
404  int dataOffset=0);
405 
406 
418  getDataByTagRW(int tag, DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0);
419 
421  getDataByTagRO(int tag, DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0) const;
422 
423 
425  getDataByTagRW(int tag, DataTypes::CplxVectorType::size_type i, DataTypes::cplx_t dummy);
426 
428  getDataByTagRO(int tag, DataTypes::CplxVectorType::size_type i, DataTypes::cplx_t dummy) const;
429 
440  getOffsetForTag(int tag) const;
441 
442 
449  getVectorRW();
450 
452  getVectorRO() const;
453 
454 
456  getVectorRWC();
457 
459  getVectorROC() const;
460 
461 
463  getTypedVectorRW(DataTypes::real_t dummy);
464 
465  virtual const DataTypes::RealVectorType&
466  getTypedVectorRO(DataTypes::real_t dummy) const;
467 
469  getTypedVectorRW(DataTypes::cplx_t dummy);
470 
471  virtual const DataTypes::CplxVectorType&
472  getTypedVectorRO(DataTypes::cplx_t dummy) const;
473 
474 
475 
476 
477 
486  const DataMapType&
487  getTagLookup() const;
488 
500  bool
501  isCurrentTag(int tag) const;
502 
513  getDefaultValueRW(DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0);
514 
516  getDefaultValueRO(DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0) const;
517 
519  getDefaultValueRW(DataTypes::CplxVectorType::size_type i, DataTypes::cplx_t dummy);
520 
522  getDefaultValueRO(DataTypes::CplxVectorType::size_type i, DataTypes::cplx_t dummy) const;
523 
524 
525 
526 
535  virtual
537  getLength() const;
538 
549  virtual
550  DataAbstract*
551  getSlice(const DataTypes::RegionType& region) const;
552 
564  DataTagged(const DataTagged& other,
565  const DataTypes::RegionType& region);
566 
577  virtual
578  void
579  setSlice(const DataAbstract* other,
580  const DataTypes::RegionType& region);
581 
582 
590  virtual void
591  symmetric(DataAbstract* ev);
592 
600  virtual void
602 
610  virtual void
611  hermitian(DataAbstract* ev);
612 
620  virtual void
622 
630  virtual void
631  trace(DataAbstract* ev, int axis_offset);
632 
641  virtual void
642  swapaxes(DataAbstract* ev, int axis0, int axis1);
643 
651  virtual void
652  transpose(DataAbstract* ev, int axis_offset);
653 
661  virtual void
663 
675  virtual void
676  eigenvalues_and_eigenvectors(DataAbstract* ev,DataAbstract* V,const double tol=1.e-13);
677 
678 
683  getDefaultOffset() const;
684 
688  size_t
689  getTagCount() const;
690 
691  void
692  complicate();
693 
694  protected:
695 
696  private:
697 
698  //
699  // The offset lookup table
700  DataMapType m_offsetLookup;
701 
702  //
703  // the offset to the default value
704  static const int m_defaultValueOffset = 0;
705 
706  // the actual data
707  DataTypes::RealVectorType m_data_r;
708  DataTypes::CplxVectorType m_data_c;
709 
710 
711 };
712 
713 inline
714 bool
716 {
717  DataMapType::const_iterator pos(m_offsetLookup.find(tag));
718  return (pos!=m_offsetLookup.end());
719 }
720 
721 inline
724 {
725  return m_defaultValueOffset;
726 }
727 
728 inline
731 {
732  return getVectorRW()[i]; // getVectorRW has exclusive write checks
733 }
734 
735 inline
738 {
739  return getVectorRO()[i];
740 }
741 
742 inline
745 {
746  return getVectorRWC()[i]; // getVectorRW has exclusive write checks
747 }
748 
749 inline
752 {
753  return getVectorROC()[i];
754 }
755 
756 
757 
758 
759 inline
762 {
763  return m_offsetLookup;
764 }
765 
766 inline
768 DataTagged::getLength() const
769 {
770  return std::max(m_data_c.size(), m_data_r.size());
771 }
772 
773 } // end of namespace
774 
775 #endif // __ESCRIPT_DATATAGGED_H__
776 
escript::DataTypes::maxRank
static const int maxRank
The maximum number of dimensions a datapoint can have.
Definition: DataTypes.h:68
escript::DataTagged::getLength
virtual DataTypes::RealVectorType::size_type getLength() const
getLength
Definition: DataTagged.h:779
CHECK_FOR_EX_WRITE
#define CHECK_FOR_EX_WRITE
Definition: DataTagged.cpp:38
MPI_Status
int MPI_Status
Definition: EsysMPI.h:43
ESCRIPT_DLL_API
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:28
escript::FunctionSpace::getTagFromSampleNo
int getTagFromSampleNo(DataTypes::dim_t sampleNo) const
Returns the tag associated with the given sample number.
Definition: FunctionSpace.cpp:142
escript::DataTypes::real_t
double real_t
type of all real-valued scalars in escript
Definition: DataTypes.h:73
escript::DataTagged::getTagLookup
const DataMapType & getTagLookup() const
getTagLookup
Definition: DataTagged.h:772
escript::DataTagged::swapaxes
virtual void swapaxes(DataAbstract *ev, int axis0, int axis1)
swaps components axis0 and axis1
Definition: DataTagged.cpp:1246
escript::DataTagged::addTag
void addTag(int tagKey)
addTag - does not modify the default value for this object. ** Not unit tested **
Definition: DataTagged.cpp:683
escript::DataTagged::setToZero
virtual void setToZero()
sets all values to zero
Definition: DataTagged.cpp:1389
escript::DataTypes::copySlice
void copySlice(VEC &left, const ShapeType &leftShape, typename VEC::size_type leftOffset, const VEC &other, const ShapeType &otherShape, typename VEC::size_type otherOffset, const RegionLoopRangeType &region)
Copy a data slice specified by the given region and offset from the "other" vector into the "left" ve...
Definition: DataVector.h:172
escript::DataTagged::complicate
void complicate()
Definition: DataTagged.cpp:1699
escript::DataTagged::eigenvalues
virtual void eigenvalues(DataAbstract *ev)
solves the eigenvalue problem this*V=ev*V for the eigenvalues ev
Definition: DataTagged.cpp:1281
escript::DataConstant::getTypedVectorRO
virtual const DataTypes::RealVectorType & getTypedVectorRO(DataTypes::real_t dummy) const
Definition: DataConstant.cpp:870
escript::DataTagged::getDataByTagRW
DataTypes::RealVectorType::reference getDataByTagRW(int tag, DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0)
getDataByTag
Definition: DataTagged.cpp:1015
escript::DataTagged::getVectorRW
DataTypes::RealVectorType & getVectorRW()
Return a reference to the underlying DataVector.
Definition: DataTagged.cpp:1641
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:961
escript::DataTagged::trace
virtual void trace(DataAbstract *ev, int axis_offset)
Computes the trace of a matrix.
Definition: DataTagged.cpp:1176
escript::DataTagged::getDefaultOffset
DataTypes::RealVectorType::size_type getDefaultOffset() const
Returns the offset in the structure which stores the default value.
Definition: DataTagged.h:734
escript::DataTypes::DataVectorAlt< real_t >::const_reference
const typedef ElementType & const_reference
Definition: DataVectorAlt.h:86
escript::DataTypes::checkShape
bool checkShape(const ShapeType &s1, const ShapeType &s2)
Test if two shapes are equal.
Definition: DataTypes.h:327
escript::DataConstant
DataConstant stores a single data point which represents the entire function space.
Definition: DataConstant.h:48
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:637
escript::DataTagged::getDefaultValueRW
DataTypes::RealVectorType::reference getDefaultValueRW(DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0)
getDefaultValue
Definition: DataTagged.h:741
escript::DataTypes::DataVectorAlt::resize
void resize(const size_type newSize, const value_type newVal=0.0, const size_type newBlockSize=1)
Resize the DataVectorAlt to the given length "newSize". All current data is lost. All elements in the...
Definition: DataVectorAlt.h:313
escript::DataTypes::DataVectorAlt< cplx_t >::size_type
DataTypes::vec_size_type size_type
Definition: DataVectorAlt.h:84
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:101
escript::DataTypes::DataVectorAlt< real_t >
escript::DataTagged::m_defaultValueOffset
static const int m_defaultValueOffset
Definition: DataTagged.h:715
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:341
escript::DataTagged::getDataByTagRO
DataTypes::RealVectorType::const_reference getDataByTagRO(int tag, DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0) const
Definition: DataTagged.cpp:1004
escript::DataAbstract::getRank
unsigned int getRank() const
Return the rank information for the point data.
Definition: DataAbstract.h:663
escript::DataTagged::m_data_c
DataTypes::CplxVectorType m_data_c
Definition: DataTagged.h:719
escript::FunctionSpace
Definition: FunctionSpace.h:45
escript::DataTypes::getSliceRegionLoopRange
DataTypes::RegionLoopRangeType getSliceRegionLoopRange(const DataTypes::RegionType &region)
Modify region to copy from in order to deal with the case where one range in the region contains iden...
Definition: DataTypes.cpp:186
escript::FunctionSpace::canTag
bool canTag() const
Returns true if this function space support tags.
Definition: FunctionSpace.cpp:303
escript::DataTagged::getVectorRO
const DataTypes::RealVectorType & getVectorRO() const
Definition: DataTagged.cpp:1648
escript::DataTagged::DataMapType
std::map< int, int > DataMapType
Definition: DataTagged.h:68
MPI_INT
#define MPI_INT
Definition: EsysMPI.h:44
system_dep.h
escript::DataTagged::hasInf
virtual bool hasInf() const
Return true if data contains Inf or -Inf.
Definition: DataTagged.cpp:841
escript::LapackInverseHelper
Definition: LapackInverseHelper.h:37
escript::DataTagged
Simulates a full dataset accessible via sampleNo and dataPointNo.
Definition: DataTagged.h:55
escript::DataAbstract::getNumDPPSample
int getNumDPPSample() const
Return the number of data points per sample.
Definition: DataAbstract.h:622
MPI_COMM_WORLD
#define MPI_COMM_WORLD
Definition: EsysMPI.h:46
escript::DataException
Definition: DataException.h:37
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:914
escript::DataTypes::ShapeType
std::vector< int > ShapeType
The shape of a single datapoint.
Definition: DataTypes.h:65
escript::JMPI
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:70
escript::DataTypes
Contains the types to represent Shapes, Regions, RegionLoop ranges and vectors of data as well as the...
Definition: DataTypes.cpp:85
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::DataTypes::copySliceFrom
void copySliceFrom(VEC &left, const ShapeType &leftShape, typename VEC::size_type leftOffset, const VEC &other, const ShapeType &otherShape, typename VEC::size_type otherOffset, const RegionLoopRangeType &region)
Copy data into a slice specified by the given region and offset in the left vector from the other vec...
Definition: DataVector.h:279
escript::DataTagged::setSlice
virtual void setSlice(const DataAbstract *other, const DataTypes::RegionType &region)
setSlice
Definition: DataTagged.cpp:391
escript::DataTagged::transpose
virtual void transpose(DataAbstract *ev, int axis_offset)
Transpose each data point of this Data object around the given axis.
Definition: DataTagged.cpp:1211
escript::DataTypes::RegionType
std::vector< std::pair< int, int > > RegionType
Definition: DataTypes.h:66
escript::DataTypes::noValues
int noValues(const ShapeType &shape)
Calculate the number of values in a datapoint with the given shape.
Definition: DataTypes.cpp:89
escript::DataAbstract::getShape
const DataTypes::ShapeType & getShape() const
Return the shape information for the point data.
Definition: DataAbstract.h:652
escript::DataTypes::getResultSliceShape
DataTypes::ShapeType getResultSliceShape(const RegionType &region)
Determine the shape of the specified slice region.
Definition: DataTypes.cpp:171
escript::DataTagged::getVectorRWC
DataTypes::CplxVectorType & getVectorRWC()
Definition: DataTagged.cpp:1654
escript::DataAbstract::getNumSamples
int getNumSamples() const
Return the number of samples.
Definition: DataAbstract.h:633
escript::DataTagged::setTaggedValue
void setTaggedValue(int tagKey, const DataTypes::ShapeType &pointshape, const DataTypes::RealVectorType &value, int dataOffset=0)
setTaggedValue
Definition: DataTagged.cpp:495
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:1667
escript::DataTagged::m_data_r
DataTypes::RealVectorType m_data_r
Definition: DataTagged.h:718
escript::DataTagged::getTypedVectorRO
virtual const DataTypes::RealVectorType & getTypedVectorRO(DataTypes::real_t dummy) const
Definition: DataTagged.cpp:1674
escript::DataTagged::deepCopy
virtual DataAbstract * deepCopy() const
Return a deep copy of the current object.
Definition: DataTagged.cpp:304
escript::DataTagged::addTaggedValues
void addTaggedValues(const TagListType &tagKeys, const FloatBatchType &values, const ShapeType &vShape)
addTaggedValues
Definition: DataTagged.cpp:552
escript::matrix_inverse
int matrix_inverse(const DataTypes::RealVectorType &in, const DataTypes::ShapeType &inShape, DataTypes::RealVectorType::size_type inOffset, DataTypes::RealVectorType &out, const DataTypes::ShapeType &outShape, DataTypes::RealVectorType::size_type outOffset, int count, LapackInverseHelper &helper)
computes the inverses of square (up to 3x3) matricies
Definition: DataVectorOps.cpp:205
escript::DataTagged::getTagCount
size_t getTagCount() const
Return the number of tags which have been given values (+the default)
Definition: DataTagged.cpp:1693
escript::DataTagged::getPointOffset
virtual DataTypes::RealVectorType::size_type getPointOffset(int sampleNo, int dataPointNo) const
getPointOffset
Definition: DataTagged.cpp:980
DataConstant.h
escript::DataTagged::zeroedCopy
virtual DataAbstract * zeroedCopy() const
Return an object with the same type, domain (and tags if appropriate) as this, but all values are zer...
Definition: DataTagged.cpp:311
escript::DataAbstract::m_iscompl
bool m_iscompl
Definition: DataAbstract.h:574
escript::DataTagged::matrixInverse
virtual int matrixInverse(DataAbstract *out) const
invert square matricies
Definition: DataTagged.cpp:1355
escript::DataTagged::antihermitian
virtual void antihermitian(DataAbstract *ev)
Computes an antihermitian matrix (A - A*) / 2.
Definition: DataTagged.cpp:1150
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:486
escript::DataTagged::antisymmetric
virtual void antisymmetric(DataAbstract *ev)
Computes a antisymmetric matrix (A - AT) / 2.
Definition: DataTagged.cpp:1087
escript::DataTypes::RegionLoopRangeType
std::vector< std::pair< int, int > > RegionLoopRangeType
Definition: DataTypes.h:67
V
#define V(_K_, _I_)
Definition: ShapeFunctions.cpp:133
escript::DataTagged::getSlice
virtual DataAbstract * getSlice(const DataTypes::RegionType &region) const
getSlice
Definition: DataTagged.cpp:332
escript::DataTagged::getDefaultValueRO
DataTypes::RealVectorType::const_reference getDefaultValueRO(DataTypes::RealVectorType::size_type i, DataTypes::real_t dummy=0) const
Definition: DataTagged.h:748
escript::FunctionSpace::borrowListOfTagsInUse
const int * borrowListOfTagsInUse() const
Definition: FunctionSpace.cpp:280
escript::DataTagged::getVectorROC
const DataTypes::CplxVectorType & getVectorROC() const
Definition: DataTagged.cpp:1661
escript::DataTagged::replaceInf
virtual void replaceInf(DataTypes::real_t value)
replaces all (+/-)Inf values with value
Definition: DataTagged.cpp:876
escript
Definition: AbstractContinuousDomain.cpp:22
escript::DataTypes::DataVectorAlt::size
size_type size() const
Return the number of elements in this DataVectorAlt.
Definition: DataVectorAlt.h:237
escript::DataTypes::pointToString
std::string pointToString(const RealVectorType &data, const ShapeType &shape, int offset, const std::string &prefix)
Display a single value (with the specified shape) from the data.
DataTypes.h
escript::DataAbstract
Definition: DataAbstract.h:72
escript::DataTagged::symmetric
virtual void symmetric(DataAbstract *ev)
Computes a symmetric matrix (A + AT) / 2.
Definition: DataTagged.cpp:1050
escript::DataTagged::getOffsetForTag
DataTypes::RealVectorType::size_type getOffsetForTag(int tag) const
getOffsetForTag
Definition: DataTagged.cpp:993
escript::DataTagged::isCurrentTag
bool isCurrentTag(int tag) const
isCurrentTag
Definition: DataTagged.h:726
DataVectorOps.h
Describes binary operations performed on DataVector.
escript::DataTypes::createShapeErrorMessage
std::string createShapeErrorMessage(const std::string &messagePrefix, const DataTypes::ShapeType &other, const DataTypes::ShapeType &thisShape)
Produce a string containing two shapes.
Definition: DataTypes.cpp:204
escript::FunctionSpace::getTypeCode
int getTypeCode() const
Returns the function space type code.
Definition: FunctionSpace.cpp:93
escript::DataTagged::m_offsetLookup
DataMapType m_offsetLookup
Definition: DataTagged.h:711
DataTagged.h
escript::DataTagged::eigenvalues_and_eigenvectors
virtual void eigenvalues_and_eigenvectors(DataAbstract *ev, DataAbstract *V, const double tol=1.e-13)
solves the eigenvalue problem this*V=ev*V for the eigenvalues ev and eigenvectors V
Definition: DataTagged.cpp:1317
escript::DataAbstract::isComplex
bool isComplex() const
true if the components of datapoints are complex
Definition: DataAbstract.cpp:68
escript::DataTagged::addTaggedValue
void addTaggedValue(int tagKey, const DataTypes::ShapeType &pointshape, const DataTypes::RealVectorType &value, int dataOffset=0)
addTaggedValue
Definition: DataTagged.cpp:606
escript::DataAbstract::getNoValues
unsigned int getNoValues() const
Return the number of values in the shape for this object.
Definition: DataAbstract.h:674
escript::DataTypes::DataVectorAlt< real_t >::reference
ElementType & reference
Definition: DataVectorAlt.h:85
Data.h
DataReady.h
escript::DataTagged::FloatBatchType
std::vector< DataTypes::RealVectorType::ElementType > FloatBatchType
Definition: DataTagged.h:63
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:150
escript::DataAbstract::getFunctionSpace
const FunctionSpace & getFunctionSpace() const
Return the function space associated with this Data object.
Definition: DataAbstract.h:645
escript::DataTypes::cplx_t
std::complex< real_t > cplx_t
complex data type
Definition: DataTypes.h:76
escript::DataTagged::getTagNumber
virtual int getTagNumber(int dpno)
Return the tag number associated with the given data-point number according to the associated functio...
Definition: DataTagged.cpp:465
escript::DataTagged::getSampleDataByTag
virtual DataTypes::real_t * getSampleDataByTag(int tag, DataTypes::real_t dummy=0)
getSampleDataByTag
Definition: DataTagged.cpp:729
escript::DataAbstract::ShapeType
DataTypes::ShapeType ShapeType
Definition: DataAbstract.h:77
escript::DataTagged::toString
virtual std::string toString() const
Write the data as a string. Writes out each tag, including the default, and the data-point which is a...
Definition: DataTagged.cpp:926
escript::DataTagged::dump
virtual void dump(const std::string fileName) const
dumps the object into a netCDF file
Definition: DataTagged.cpp:1545
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:240
escript::DataTagged::DataTagged
DataTagged(const FunctionSpace &what, const DataTypes::ShapeType &shape, const int tags[], const DataTypes::RealVectorType &data)
Alternative Constructor for DataTagged.
Definition: DataTagged.cpp:49
DataException.h
escript::DataTagged::hermitian
virtual void hermitian(DataAbstract *ev)
Computes an hermitian matrix (A + A*) / 2.
Definition: DataTagged.cpp:1122
escript::FunctionSpace::getNumberOfTagsInUse
int getNumberOfTagsInUse() const
Returns the number of tags in use.
Definition: FunctionSpace.cpp:275
escript::DataTagged::TagListType
std::vector< int > TagListType
Definition: DataTagged.h:62
escript::DataTagged::hasNaN
bool hasNaN() const
Return true if any one of the datapoints contains a NaN.
Definition: DataTagged.cpp:758
escript::DataTagged::replaceNaN
void replaceNaN(DataTypes::real_t value)
replaces all NaN values with value
Definition: DataTagged.cpp:793
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:748