/[escript]/trunk/escript/src/AbstractDomain.h
ViewVC logotype

Annotation of /trunk/escript/src/AbstractDomain.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 100 - (hide annotations)
Wed Dec 15 03:48:48 2004 UTC (15 years ago) by jgs
Original Path: trunk/esys2/escript/src/Data/AbstractDomain.h
File MIME type: text/plain
File size: 7304 byte(s)
*** empty log message ***

1 jgs 82 /*
2     ******************************************************************************
3     * *
4     * COPYRIGHT ACcESS 2004 - All Rights Reserved *
5     * *
6     * This software is the property of ACcESS. No part of this code *
7     * may be copied in any form or by any means without the expressed written *
8     * consent of ACcESS. Copying, use or modification of this software *
9     * by any unauthorised person is illegal unless that person has a software *
10     * license agreement with ACcESS. *
11     * *
12     ******************************************************************************
13     */
14    
15     #if !defined escript_AbstractDomain_20040609_H
16     #define escript_AbstractDomain_20040609_H
17    
18     #include <string>
19     #include <utility>
20    
21     namespace escript {
22    
23     class Data;
24     class AbstractSystemMatrix;
25     class FunctionSpace;
26     /**
27     \brief
28     Base class for all escript domains.
29    
30     Description:
31     Base class for all escript domains.
32     */
33     class AbstractDomain {
34    
35     public:
36    
37     /**
38     \brief
39     Default constructor for AbstractDomain
40    
41     Description:
42     Default constructor for AbstractDomain. As the name suggests
43     this is intended to be an abstract base class but by making it
44     constructable avoid a boost.python wrapper class. A call to
45     almost any of the base class functions will throw an exception
46     as they are not intended to be used.
47    
48     Preconditions:
49     Describe any preconditions
50    
51     Throws:
52     Describe any exceptions thrown
53     */
54     AbstractDomain();
55     /**
56     \brief
57     Destructor for AbstractDomain
58    
59     Description:
60     Destructor for AbstractDomain
61     */
62     virtual ~AbstractDomain();
63     /**
64     \brief
65     Returns true if the given integer is a valid function space type
66     for this domain.
67     */
68     virtual bool isValidFunctionSpaceType(int functionSpaceType) const;
69     /**
70     \brief
71     Return a description for this domain
72     */
73     virtual std::string getDescription() const;
74     /**
75     \brief
76     Return a description for the given function space type code
77     */
78     virtual std::string functionSpaceTypeAsString(int functionSpaceType) const;
79     /**
80     \brief
81     Throw a standard exception. This function is called if any attempt
82     is made to use a base class function.
83     */
84     void throwStandardException(const std::string& functionName) const;
85     /**
86     \brief
87     returns the spatial dimension of the domain.
88     has to be implemented by the actual Domain adapter.
89     */
90     virtual int getDim() const;
91    
92     /**
93     \brief
94     Return true if domains equal.
95     */
96     virtual bool operator==(const AbstractDomain& other) const;
97 jgs 100 bool operator!=(const AbstractDomain& other) const;
98 jgs 82 /**
99     \brief
100     writes the doamin to an external file filename.
101     has to be implemented by the actual Domain adapter.
102     */
103     virtual void write(const std::string& filename) const;
104    
105     /**
106     \brief
107     sets the tagList pointer and length of tag list numTags.
108     *tagList may be null in which case on tags are used for functionSpaceType on the Domain.
109     has to be implemented by the actual Domain adapter.
110     */
111     virtual void getTagList(int functionSpaceType, int** tagList, int* numTags) const;
112    
113     /**
114     \brief
115     Return the number of data points per sample, and the number of samples as a pair.
116     has to be implemented by the actual Domain adapter.
117     \param functionSpaceCode Input - Code for the function space type.
118     \return pair, first - number of data points per sample, second - number of samples
119     */
120     virtual std::pair<int,int> getDataShape(int functionSpaceCode) const;
121    
122     /**
123     \brief
124     Return the tag key for the given sample number.
125     \param functionSpaceType Input - The function space type.
126     \param sampleNo Input - The sample number.
127     */
128     virtual int getTagFromSampleNo(int functionSpaceType, int sampleNo) const;
129     /**
130     \brief
131     assigns new location to the domain
132     has to be implemented by the actual Domain adapter.
133     */
134     virtual void setNewX(const escript::Data& arg);
135    
136     /**
137     \brief
138     interpolates data given on source onto target where source and target have to be given on the same domain.
139     has to be implemented by the actual Domain adapter.
140     */
141     virtual void interpolateOnDomain(escript::Data& target,const escript::Data& source) const;
142     virtual bool probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const;
143     /**
144     \brief
145     interpolates data given on source onto target where source and target are given on different domains.
146     has to be implemented by the actual Domain adapter.
147     */
148     virtual void interpolateACross(escript::Data& target, const escript::Data& source) const;
149     virtual bool probeInterpolationACross(int functionSpaceType_source,const AbstractDomain& targetDomain, int functionSpaceType_target) const;
150    
151     /**
152     \brief
153     copies the location of data points on the domain into out. The actual function space to be considered
154     is defined by out. out has to be defined on this.
155     has to be implemented by the actual Domain adapter.
156     */
157     virtual void setToX(escript::Data& out) const;
158     /**
159     \brief
160     copies the surface normals at data points into out. The actual function space to be considered
161     is defined by out. out has to be defined on this.
162     has to be implemented by the actual Domain adapter.
163     */
164     virtual void setToNormal(escript::Data& out) const;
165     /**
166     \brief
167     copies the size of samples into out. The actual function space to be considered
168     is defined by out. out has to be defined on this.
169     has to be implemented by the actual Domain adapter.
170     */
171     virtual void setToSize(escript::Data& out) const;
172    
173     /**
174     \brief
175     copies the gradient of arg into grad. The actual function space to be considered
176     for the gradient is defined by grad. arg and grad have to be defined on this.
177     has to be implemented by the actual Domain adapter.
178     */
179     virtual void setToGradient(escript::Data& grad, const escript::Data& arg) const;
180    
181     /**
182     \brief
183     saves data arg to a OpenDX input file.
184     considered as cell centered data.
185     has to be implemented by the actual Domain adapter.
186     */
187     virtual void saveDX(const std::string& filename,const escript::Data& arg) const;
188     /**
189     \brief
190     returns the function space representation of the type functionSpaceCode on this domain
191     as a vtkObject.
192     has to be implemented by the actual Domain adapter.
193     */
194     //virtual vtkObject createVtkObject(int functionSpaceCode) const;
195    
196     /**
197     \brief
198     returns true if data on this domain and a function space of type functionSpaceCode has to
199     considered as cell centered data.
200     has to be implemented by the actual Domain adapter.
201     */
202     virtual bool isCellOriented(int functionSpaceCode) const;
203    
204    
205     protected:
206    
207     private:
208     };
209    
210     } // end of namespace
211     #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26