/[escript]/trunk/escriptcore/src/DataEmpty.cpp
ViewVC logotype

Contents of /trunk/escriptcore/src/DataEmpty.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6469 - (show annotations)
Tue Jan 17 07:45:36 2017 UTC (2 years, 3 months ago) by jfenwick
File size: 4174 byte(s)
Add zeroed copy

1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2016 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 #include "DataEmpty.h"
18 #include "DataException.h"
19
20
21 namespace {
22
23 inline
24 void
25 throwStandardException(const std::string& functionName)
26 {
27 throw escript::DataException("Error - "+functionName+" function call invalid for DataEmpty.");
28 }
29
30 escript::DataTypes::RealVectorType dummy;
31 escript::DataTypes::CplxVectorType dummyc;
32 }
33
34 namespace escript {
35
36 DataEmpty::DataEmpty() :
37 parent(FunctionSpace(),DataTypes::scalarShape, true)
38 {
39
40 }
41
42 DataEmpty::~DataEmpty()
43 {
44 }
45
46 std::string
47 DataEmpty::toString() const
48 {
49 return "(Empty Data)";
50 }
51
52
53 DataAbstract*
54 DataEmpty::deepCopy() const
55 {
56 return new DataEmpty();
57 }
58
59 DataAbstract*
60 DataEmpty::zeroedCopy() const
61 {
62 return new DataEmpty();
63 }
64
65 DataTypes::RealVectorType::size_type
66 DataEmpty::getPointOffset(int sampleNo,
67 int dataPointNo) const
68 {
69 throwStandardException("getPointOffset");
70 return 0;
71 }
72
73 DataTypes::RealVectorType::size_type
74 DataEmpty::getPointOffset(int sampleNo,
75 int dataPointNo)
76 {
77 throwStandardException("getPointOffset");
78 return 0;
79 }
80
81 DataTypes::RealVectorType::size_type
82 DataEmpty::getLength() const
83 {
84 return 0;
85 }
86
87 DataAbstract*
88 DataEmpty::getSlice(const DataTypes::RegionType& region) const
89 {
90 throwStandardException("getSlice");
91 return 0;
92 }
93
94 void
95 DataEmpty::setSlice(const DataAbstract* value,
96 const DataTypes::RegionType& region)
97 {
98 throwStandardException("setSlice");
99 }
100
101 int
102 DataEmpty::matrixInverse(DataAbstract* out) const
103 {
104 throwStandardException("matrixInverse");
105 return 0;
106 }
107
108
109 DataTypes::RealVectorType&
110 DataEmpty::getVectorRW()
111 {
112 throwStandardException("getVector"); // always throws but the compiler doesn't know that.
113 return dummy; // dead code to stop the compiler complaining
114 }
115
116 const DataTypes::RealVectorType&
117 DataEmpty::getVectorRO() const
118 {
119 throwStandardException("getVector"); // always throws but the compiler doesn't know that.
120 return dummy; // dead code to stop the compiler complaining
121 }
122
123
124 DataTypes::CplxVectorType&
125 DataEmpty::getVectorRWC()
126 {
127 throwStandardException("getVector"); // always throws but the compiler doesn't know that.
128 return dummyc; // dead code to stop the compiler complaining
129 }
130
131 const DataTypes::CplxVectorType&
132 DataEmpty::getVectorROC() const
133 {
134 throwStandardException("getVector"); // always throws but the compiler doesn't know that.
135 return dummyc; // dead code to stop the compiler complaining
136 }
137
138
139 DataTypes::RealVectorType&
140 DataEmpty::getTypedVectorRW(DataTypes::real_t dummypar)
141 {
142 throwStandardException("getVector"); // always throws but the compiler doesn't know that.
143 return dummy; // dead code to stop the compiler complaining
144 }
145
146 const DataTypes::RealVectorType&
147 DataEmpty::getTypedVectorRO(DataTypes::real_t dummypar) const
148 {
149 throwStandardException("getVector"); // always throws but the compiler doesn't know that.
150 return dummy; // dead code to stop the compiler complaining
151 }
152
153
154 DataTypes::CplxVectorType&
155 DataEmpty::getTypedVectorRW(DataTypes::cplx_t dummypar)
156 {
157 throwStandardException("getVector"); // always throws but the compiler doesn't know that.
158 return dummyc; // dead code to stop the compiler complaining
159 }
160
161 const DataTypes::CplxVectorType&
162 DataEmpty::getTypedVectorRO(DataTypes::cplx_t dummypar) const
163 {
164 throwStandardException("getVector"); // always throws but the compiler doesn't know that.
165 return dummyc; // dead code to stop the compiler complaining
166 }
167
168
169
170 void
171 DataEmpty::dump(const std::string fileName) const
172 {
173 throw DataException("Error - Cannot dump() a DataEmpty object.");
174 }
175
176 } // end of namespace
177

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26