/[escript]/branches/subworld2/escriptcore/src/NullDomain.h
ViewVC logotype

Contents of /branches/subworld2/escriptcore/src/NullDomain.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5504 - (show annotations)
Wed Mar 4 22:58:13 2015 UTC (4 years, 1 month ago) by jfenwick
File MIME type: text/plain
File size: 5284 byte(s)
Again with a more up to date copy


1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2015 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
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 #ifndef __ESCRIPT_NULLDOMAIN_H__
18 #define __ESCRIPT_NULLDOMAIN_H__
19
20 #include "system_dep.h"
21
22 #include "AbstractDomain.h"
23
24 namespace escript {
25
26 /**
27 \brief
28 NullDomain provides a null value for domain. Needed for the construction
29 of a default FunctionSpace.
30
31 Description:
32 NullDomain provides a null value for domain. Needed for the construction
33 of a default FunctionSpace. Inherits from AbstractDomain and overrides its
34 methods.
35 This domain supports a single type of FunctionSpace for which canTag is true.
36 This compromise is needed to allow the default contructor of DataTagged to
37 have a FunctionSpace which supports tagging.
38 See notes on the borrowListOfTagsInUse() method.
39 */
40 class ESCRIPT_DLL_API NullDomain : public AbstractDomain
41 {
42 private:
43 static int NullDomainFS;
44 static dim_t referenceID;
45
46 public:
47 NullDomain() {}
48
49 virtual int getMPISize() const { return 1; }
50 virtual int getMPIRank() const { return 0; }
51 virtual void MPIBarrier() const {}
52 virtual bool onMasterProcessor() const { return true; }
53 virtual MPI_Comm getMPIComm() const { return MPI_COMM_WORLD; }
54
55 virtual bool isValidFunctionSpaceType(int fsCode) const {
56 return fsCode==NullDomainFS;
57 }
58
59 virtual std::string getDescription() const;
60
61 virtual std::string functionSpaceTypeAsString(int functionSpaceType) const;
62
63 virtual void interpolateOnDomain(escript::Data& target,const escript::Data& source) const;
64
65 virtual bool probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const;
66
67 virtual void interpolateAcross(escript::Data& target, const escript::Data& source) const;
68
69 virtual bool probeInterpolationAcross(int, const AbstractDomain&, int) const {
70 return false;
71 }
72
73 virtual int getContinuousFunctionCode() const { return NullDomainFS; }
74 virtual int getFunctionCode() const { return NullDomainFS; }
75 virtual int getFunctionOnBoundaryCode() const { return NullDomainFS; }
76 virtual int getFunctionOnContactZeroCode() const { return NullDomainFS; }
77 virtual int getFunctionOnContactOneCode() const { return NullDomainFS; }
78 virtual int getSolutionCode() const { return NullDomainFS; }
79 virtual int getReducedSolutionCode() const { return NullDomainFS; }
80 virtual int getDiracDeltaFunctionsCode() const { return NullDomainFS; }
81
82 virtual std::pair<int,dim_t> getDataShape(int functionSpaceCode) const;
83
84 virtual int getTagFromSampleNo(int, index_t) const { return 1; }
85
86 virtual const dim_t* borrowSampleReferenceIDs(int) const { return &referenceID; }
87
88 virtual int getDim() const { return 1; }
89
90 virtual bool operator==(const AbstractDomain& other) const;
91
92 virtual bool operator!=(const AbstractDomain& other) const {
93 return !(*this==other);
94 }
95
96 virtual void write(const std::string& filename) const;
97
98 virtual void dump(const std::string& filename) const;
99
100 virtual void setTagMap(const std::string& name, int tag);
101
102 virtual int getTag(const std::string& name) const;
103
104 virtual bool canTag(int) const { return true; }
105
106 virtual std::string showTagNames() const;
107
108 virtual int getNumberOfTagsInUse(int) const { return 1; }
109
110 virtual const int* borrowListOfTagsInUse(int functionSpaceCode) const;
111
112 virtual void setTags(int functionSpaceType, int newTag, const escript::Data& mask) const;
113
114 bool supportsContactElements() const { return false; }
115
116 virtual void setNewX(const escript::Data& arg);
117
118 virtual signed char preferredInterpolationOnDomain(
119 int functionSpaceType_source,
120 int functionSpaceType_target) const;
121
122 virtual bool commonFunctionSpace(const std::vector<int>& fs,
123 int& resultcode) const;
124 virtual bool isCellOriented(int functionSpaceCode) const;
125 virtual int getApproximationOrder(const int functionSpaceCode) const;
126
127 virtual escript::Data getX() const;
128 virtual escript::Data getNormal() const;
129 virtual escript::Data getSize() const;
130 virtual void setToX(escript::Data& out) const;
131 virtual void setToNormal(escript::Data& out) const;
132 virtual void setToSize(escript::Data& out) const;
133 virtual void setToGradient(escript::Data& grad, const escript::Data& arg) const;
134 virtual bool ownSample(int fs_code, index_t id) const;
135 virtual escript::Data randomFill(const DataTypes::ShapeType& shape,
136 const FunctionSpace& what, long seed,
137 const boost::python::tuple& filter) const;
138 };
139
140 } // end of namespace
141
142 #endif // __ESCRIPT_NULLDOMAIN_H__
143

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26