1 |
/* $Id$ */ |
|
2 |
/* |
/******************************************************* |
3 |
************************************************************ |
* |
4 |
* Copyright 2006 by ACcESS MNRF * |
* Copyright (c) 2003-2008 by University of Queensland |
5 |
* * |
* Earth Systems Science Computational Center (ESSCC) |
6 |
* http://www.access.edu.au * |
* http://www.uq.edu.au/esscc |
7 |
* Primary Business: Queensland, Australia * |
* |
8 |
* Licensed under the Open Software License version 3.0 * |
* Primary Business: Queensland, Australia |
9 |
* http://www.opensource.org/licenses/osl-3.0.php * |
* Licensed under the Open Software License version 3.0 |
10 |
* * |
* http://www.opensource.org/licenses/osl-3.0.php |
11 |
************************************************************ |
* |
12 |
*/ |
*******************************************************/ |
13 |
|
|
14 |
|
|
15 |
#include "AbstractDomain.h" |
#include "AbstractDomain.h" |
16 |
#include "DomainException.h" |
#include "DomainException.h" |
17 |
#include "Data.h" |
#include "Data.h" |
18 |
|
#include "paso/Paso_MPI.h" |
19 |
|
|
20 |
using namespace std; |
using namespace std; |
21 |
|
|
22 |
namespace escript { |
namespace escript { |
23 |
|
|
24 |
|
|
25 |
|
Domain_ptr AbstractDomain::getPtr() |
26 |
|
{ |
27 |
|
if (_internal_weak_this.expired()) |
28 |
|
{ |
29 |
|
return Domain_ptr(this); |
30 |
|
} |
31 |
|
else |
32 |
|
{ |
33 |
|
return shared_from_this(); |
34 |
|
} |
35 |
|
} |
36 |
|
|
37 |
|
const_Domain_ptr AbstractDomain::getPtr() const |
38 |
|
{ |
39 |
|
if (_internal_weak_this.expired()) |
40 |
|
{ |
41 |
|
return const_Domain_ptr(this); |
42 |
|
} |
43 |
|
else |
44 |
|
{ |
45 |
|
return shared_from_this(); |
46 |
|
} |
47 |
|
} |
48 |
|
|
49 |
AbstractDomain::AbstractDomain() { |
AbstractDomain::AbstractDomain() { |
50 |
} |
} |
51 |
|
|
52 |
AbstractDomain::~AbstractDomain() { |
AbstractDomain::~AbstractDomain() { |
53 |
} |
} |
54 |
|
|
55 |
|
int AbstractDomain::getMPISize() const |
56 |
|
{ |
57 |
|
return 1; |
58 |
|
} |
59 |
|
int AbstractDomain::getMPIRank() const |
60 |
|
{ |
61 |
|
return 0; |
62 |
|
} |
63 |
|
|
64 |
|
|
65 |
void AbstractDomain::throwStandardException(const std::string& functionName) const |
void AbstractDomain::throwStandardException(const std::string& functionName) const |
66 |
{ |
{ |
67 |
throw DomainException("Error - Base class function: " + functionName + " should not be called. Programming error."); |
throw DomainException("Error - Base class function: " + functionName + " should not be called. Programming error."); |
79 |
return ""; |
return ""; |
80 |
} |
} |
81 |
|
|
|
const |
|
|
boost::python::str |
|
|
AbstractDomain::str() const |
|
|
{ |
|
|
return boost::python::str(getDescription().c_str()); |
|
|
} |
|
|
|
|
82 |
std::string AbstractDomain::functionSpaceTypeAsString(int functionSpaceType) const |
std::string AbstractDomain::functionSpaceTypeAsString(int functionSpaceType) const |
83 |
{ |
{ |
84 |
throwStandardException("AbstractDomain::functionSpaceTypeAsString"); |
throwStandardException("AbstractDomain::functionSpaceTypeAsString"); |
96 |
throwStandardException("AbstractDomain::write"); |
throwStandardException("AbstractDomain::write"); |
97 |
return; |
return; |
98 |
} |
} |
99 |
|
void AbstractDomain::dump(const std::string& filename) const |
100 |
|
{ |
101 |
|
throwStandardException("AbstractDomain::dump"); |
102 |
|
return; |
103 |
|
} |
104 |
|
|
105 |
std::pair<int,int> AbstractDomain::getDataShape(int functionSpaceCode) const |
std::pair<int,int> AbstractDomain::getDataShape(int functionSpaceCode) const |
106 |
{ |
{ |
252 |
return string(); |
return string(); |
253 |
} |
} |
254 |
|
|
255 |
|
int AbstractDomain::getNumberOfTagsInUse(int functionSpaceCode) const |
256 |
|
{ |
257 |
|
throwStandardException("AbstractDomain::getNumberOfTagsInUse is not implemented."); |
258 |
|
return 0; |
259 |
|
} |
260 |
|
int* AbstractDomain::borrowListOfTagsInUse(int functionSpaceCode) const |
261 |
|
{ |
262 |
|
throwStandardException("AbstractDomain::borrowListOfTagsInUse is not implemented."); |
263 |
|
return NULL; |
264 |
|
} |
265 |
|
|
266 |
|
|
267 |
|
bool AbstractDomain::canTag(int functionspacecode) const |
268 |
|
{ |
269 |
|
throwStandardException("AbstractDomain::canTag is not implemented."); |
270 |
|
return false; |
271 |
|
} |
272 |
|
|
273 |
|
|
274 |
|
|
275 |
} // end of namespace |
} // end of namespace |