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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 114 by jgs, Mon Feb 14 04:14:42 2005 UTC revision 115 by jgs, Fri Mar 4 07:12:47 2005 UTC
# Line 12  Line 12 
12   *                                                                            *   *                                                                            *
13   ******************************************************************************   ******************************************************************************
14  */  */
15                                                                              
16  #if !defined  escript_AbstractDomain_20040609_H  #if !defined escript_AbstractDomain_20040609_H
17  #define escript_AbstractDomain_20040609_H  #define escript_AbstractDomain_20040609_H
18                                                                                                                        
19  #include <string>  #include <string>
20  #include <utility>  #include <utility>
21    
22  namespace escript {  namespace escript {
23    
24        // forward declarations of certain classes which will be used
25      class Data;      class Data;
26      class AbstractSystemMatrix;      class AbstractSystemMatrix;
27      class FunctionSpace;      class FunctionSpace;
28    
29  /**  /**
30     \brief     \brief
31     Base class for all escript domains.     Base class for all escript domains.
# Line 31  namespace escript { Line 33  namespace escript {
33     Description:     Description:
34     Base class for all escript domains.     Base class for all escript domains.
35  */  */
36    
37  class AbstractDomain {  class AbstractDomain {
38    
39   public:   public:
# Line 44  class AbstractDomain { Line 47  class AbstractDomain {
47       this is intended to be an abstract base class but by making it       this is intended to be an abstract base class but by making it
48       constructable avoid a boost.python wrapper class. A call to       constructable avoid a boost.python wrapper class. A call to
49       almost any of the base class functions will throw an exception       almost any of the base class functions will throw an exception
50       as they are not intended to be used.       as they are not intended to be used directly, but are overridden
51         by the underlying solver package which is linked to.
52    
53         By default, this class is overridden by the class NullDomain.
54    
55       Preconditions:       Preconditions:
56       Describe any preconditions       Describe any preconditions
# Line 53  class AbstractDomain { Line 59  class AbstractDomain {
59       Describe any exceptions thrown       Describe any exceptions thrown
60    */    */
61    AbstractDomain();    AbstractDomain();
62    
63    /**    /**
64       \brief       \brief
65       Destructor for AbstractDomain       Destructor for AbstractDomain
# Line 61  class AbstractDomain { Line 68  class AbstractDomain {
68       Destructor for AbstractDomain       Destructor for AbstractDomain
69    */    */
70    virtual ~AbstractDomain();    virtual ~AbstractDomain();
71    
72    /**    /**
73       \brief       \brief
74       Returns true if the given integer is a valid function space type       Returns true if the given integer is a valid function space type
75       for this domain.       for this domain.
76    */    */
77    virtual bool isValidFunctionSpaceType(int functionSpaceType) const;    virtual bool isValidFunctionSpaceType(int functionSpaceType) const;
78    
79    /**    /**
80       \brief       \brief
81       Return a description for this domain       Return a description for this domain
82    */    */
83    virtual std::string getDescription() const;    virtual std::string getDescription() const;
84    
85    /**    /**
86       \brief       \brief
87       Return a description for the given function space type code       Return a description for the given function space type code
88    */    */
89    virtual std::string functionSpaceTypeAsString(int functionSpaceType) const;    virtual std::string functionSpaceTypeAsString(int functionSpaceType) const;
90    
91    /**    /**
92       \brief       \brief
93       Throw a standard exception. This function is called if any attempt       Throw a standard exception. This function is called if any attempt
94       is made to use a base class function.       is made to use a base class function.
95    */    */
96    void throwStandardException(const std::string& functionName) const;    void throwStandardException(const std::string& functionName) const;
97    
98    /**    /**
99       \brief       \brief
100        returns the spatial dimension of the domain.        Returns the spatial dimension of the domain.
101        has to be implemented by the actual Domain adapter.        has to be implemented by the actual Domain adapter.
102    */    */
103    virtual int getDim() const;    virtual int getDim() const;
104    
105    /**    /**
106     \brief     \brief
107     Return true if domains equal.     Return true if given domains are equal.
108    */    */
109    bool operator==(const AbstractDomain& other) const;    bool operator==(const AbstractDomain& other) const;
110    bool operator!=(const AbstractDomain& other) const;    bool operator!=(const AbstractDomain& other) const;
111    
112    /**    /**
113       \brief       \brief
114       writes the doamin to an external file filename.       Writes the doamin to an external file filename.
115       has to be implemented by the actual Domain adapter.       This has to be implemented by the actual Domain adapter.
116    */    */
117    virtual void write(const std::string& filename) const;    virtual void write(const std::string& filename) const;
118    
119    /**    /**
120       \brief       \brief
121       sets the tagList pointer and length of tag list numTags.       Sets the tagList pointer and length of tag list numTags.
122    */    */
123    virtual void getTagList(int functionSpaceType, int** tagList, int* numTags) const;    virtual void getTagList(int functionSpaceType, int** tagList, int* numTags) const;
124    
125    /**    /**
126       \brief       \brief
127       sets the referenceNoList pointer and length of tag list numReferenceNo.       Sets the referenceNoList pointer and length of tag list numReferenceNo.
128    */    */
129    virtual void getReferenceNoList(int functionSpaceType, int** referenceNoList, int* numReferenceNo) const;    virtual void getReferenceNoList(int functionSpaceType, int** referenceNoList, int* numReferenceNo) const;
130    
131   /**    /**
132       \brief       \brief
133       Return the number of data points per sample, and the number of samples as a pair.       Return the number of data points per sample, and the number of samples as a pair.
134       has to be implemented by the actual Domain adapter.       has to be implemented by the actual Domain adapter.
# Line 131  class AbstractDomain { Line 144  class AbstractDomain {
144       \param sampleNo Input - The sample number.       \param sampleNo Input - The sample number.
145    */    */
146    virtual int getTagFromSampleNo(int functionSpaceType, int sampleNo) const;    virtual int getTagFromSampleNo(int functionSpaceType, int sampleNo) const;
147    
148    /**    /**
149       \brief       \brief
150       Return the reference number of  the given sample number.       Return the reference number of the given sample number.
151       \param functionSpaceType Input - The function space type.       \param functionSpaceType Input - The function space type.
152       \param sampleNo Input - The sample number.       \param sampleNo Input - The sample number.
153    */    */
154    virtual int getReferenceNoFromSampleNo(int functionSpaceType, int sampleNo) const;    virtual int getReferenceNoFromSampleNo(int functionSpaceType, int sampleNo) const;
155    
156    /**    /**
157       \brief       \brief
158       assigns new location to the domain       Assigns new location to the domain
159       has to be implemented by the actual Domain adapter.       has to be implemented by the actual Domain adapter.
160    */    */
161    virtual void setNewX(const escript::Data& arg);    virtual void setNewX(const escript::Data& arg);
162    
163    /**    /**
164       \brief       \brief
165       interpolates data given on source onto target where source and target have to be given on the same domain.       Interpolates data given on source onto target where source and target have to be given on the same domain.
166       has to be implemented by the actual Domain adapter.       has to be implemented by the actual Domain adapter.
167    */    */
168    virtual void interpolateOnDomain(escript::Data& target,const escript::Data& source) const;    virtual void interpolateOnDomain(escript::Data& target,const escript::Data& source) const;
169    virtual bool probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const;    virtual bool probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const;
170    
171    /**    /**
172       \brief       \brief
173       interpolates data given on source onto target where source and target are given on different domains.       Interpolates data given on source onto target where source and target are given on different domains.
174       has to be implemented by the actual Domain adapter.       has to be implemented by the actual Domain adapter.
175    */    */
176    virtual void interpolateACross(escript::Data& target, const escript::Data& source) const;    virtual void interpolateACross(escript::Data& target, const escript::Data& source) const;
177    virtual bool probeInterpolationACross(int functionSpaceType_source,const AbstractDomain& targetDomain, int functionSpaceType_target) const;    virtual bool probeInterpolationACross(int functionSpaceType_source,const AbstractDomain& targetDomain, int functionSpaceType_target) const;
178    
179    /**    /**
180       \brief returns locations in the domain. The function space is chosen appropriatly.       \brief returns locations in the domain. The function space is chosen appropriately.
181    */    */
182    virtual escript::Data getX() const;    virtual escript::Data getX() const;
183    
184    /**    /**
185       \brief return boundary normals. The function space is chosen appropriatly.       \brief return boundary normals. The function space is chosen appropriately.
186    */    */
187    virtual escript::Data getNormal() const;    virtual escript::Data getNormal() const;
188    
189    /**    /**
190       \brief returns the local size od samples. The function space is chosen appropriatly.       \brief returns the local size of samples. The function space is chosen appropriately.
191    */    */
192    virtual escript::Data getSize() const;    virtual escript::Data getSize() const;
193        
194    /**    /**
195       \brief       \brief
196       copies the location of data points on the domain into out. The actual function space to be considered       Copies the location of data points on the domain into out.
197         The actual function space to be considered
198       is defined by out. out has to be defined on this.       is defined by out. out has to be defined on this.
199       has to be implemented by the actual Domain adapter.       has to be implemented by the actual Domain adapter.
200    */    */
201    virtual void setToX(escript::Data& out) const;    virtual void setToX(escript::Data& out) const;
202    
203    /**    /**
204       \brief       \brief
205       copies the surface normals at data points into out.  The actual function space to be considered       Copies the surface normals at data points into out.
206         The actual function space to be considered
207       is defined by out. out has to be defined on this.       is defined by out. out has to be defined on this.
208       has to be implemented by the actual Domain adapter.       has to be implemented by the actual Domain adapter.
209    */    */
210    virtual void setToNormal(escript::Data& out) const;    virtual void setToNormal(escript::Data& out) const;
211    
212    /**    /**
213       \brief       \brief
214       copies the size of samples into out. The actual function space to be considered       Copies the size of samples into out. The actual
215         function space to be considered
216       is defined by out. out has to be defined on this.       is defined by out. out has to be defined on this.
217       has to be implemented by the actual Domain adapter.       has to be implemented by the actual Domain adapter.
218    */    */
# Line 197  class AbstractDomain { Line 220  class AbstractDomain {
220    
221    /**    /**
222       \brief       \brief
223       copies the gradient of arg into grad. The actual function space to be considered       Copies the gradient of arg into grad. The actual function space to be considered
224       for the gradient is defined by grad. arg and grad have to be defined on this.       for the gradient is defined by grad. arg and grad have to be defined on this.
225       has to be implemented by the actual Domain adapter.       has to be implemented by the actual Domain adapter.
226    */    */
# Line 205  class AbstractDomain { Line 228  class AbstractDomain {
228    
229    /**    /**
230       \brief       \brief
231       saves data arg to an OpenDX input file.       Saves data arg to an OpenDX input file.
232       considered as cell centered data.       considered as cell centered data.
233       has to be implemented by the actual Domain adapter.       has to be implemented by the actual Domain adapter.
234    */    */
# Line 227  class AbstractDomain { Line 250  class AbstractDomain {
250    */    */
251    //virtual vtkObject createVtkObject(int functionSpaceCode) const;    //virtual vtkObject createVtkObject(int functionSpaceCode) const;
252    
253      /**    /**
254       \brief       \brief
255       returns true if data on this domain and a function space of type functionSpaceCode has to       returns true if data on this domain and a function space of type functionSpaceCode has to
256       considered as cell centered data.       considered as cell centered data.
# Line 235  class AbstractDomain { Line 258  class AbstractDomain {
258    */    */
259    virtual bool isCellOriented(int functionSpaceCode) const;    virtual bool isCellOriented(int functionSpaceCode) const;
260    
   
261   protected:   protected:
262    
263   private:   private:
264    
265  };  };
266    
267  } // end of namespace  } // end of namespace

Legend:
Removed from v.114  
changed lines
  Added in v.115

  ViewVC Help
Powered by ViewVC 1.1.26