/[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 115 by jgs, Fri Mar 4 07:12:47 2005 UTC revision 117 by jgs, Fri Apr 1 05:48:57 2005 UTC
# Line 21  Line 21 
21    
22  namespace escript {  namespace escript {
23    
24      // forward declarations of certain classes which will be used  //
25      class Data;  // forward declarations of certain classes which will be used
26      class AbstractSystemMatrix;  class Data;
27      class FunctionSpace;  class AbstractSystemMatrix;
28    class FunctionSpace;
29    
30  /**  /**
31     \brief     \brief
# Line 40  class AbstractDomain { Line 41  class AbstractDomain {
41    
42    /**    /**
43       \brief       \brief
44       Default constructor for AbstractDomain       Default constructor for AbstractDomain.
45    
46       Description:       Description:
47       Default constructor for AbstractDomain. As the name suggests       Default constructor for AbstractDomain. As the name suggests
48       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
49       constructable avoid a boost.python wrapper class. A call to       constructable we avoid a boost.python wrapper class. A call to
50       almost any of the base class functions will throw an exception       almost any of the base class functions will throw an exception
51       as they are not intended to be used directly, but are overridden       as they are not intended to be used directly, but are overridden
52       by the underlying solver package which is linked to.       by the underlying solver package which escript is linked to.
53    
54       By default, this class is overridden by the class NullDomain.       By default, this class is overridden by the class NullDomain.
55    
56       Preconditions:       Preconditions:
57       Describe any preconditions       Describe any preconditions.
58    
59       Throws:       Throws:
60       Describe any exceptions thrown       Describe any exceptions thrown.
61    */    */
62    AbstractDomain();    AbstractDomain();
63    
64    /**    /**
65       \brief       \brief
66       Destructor for AbstractDomain       Destructor for AbstractDomain.
67    
68       Description:       Description:
69       Destructor for AbstractDomain       Destructor for AbstractDomain.
70    */    */
71    virtual ~AbstractDomain();    virtual ~AbstractDomain();
72    
# Line 78  class AbstractDomain { Line 79  class AbstractDomain {
79    
80    /**    /**
81       \brief       \brief
82       Return a description for this domain       Return a description for this domain.
83    */    */
84    virtual std::string getDescription() const;    virtual std::string getDescription() const;
85    
86    /**    /**
87       \brief       \brief
88       Return a description for the given function space type code       Return a description for the given function space type code.
89    */    */
90    virtual std::string functionSpaceTypeAsString(int functionSpaceType) const;    virtual std::string functionSpaceTypeAsString(int functionSpaceType) const;
91    
92    /**    /**
93       \brief       \brief
      Throw a standard exception. This function is called if any attempt  
      is made to use a base class function.  
   */  
   void throwStandardException(const std::string& functionName) const;  
   
   /**  
      \brief  
94        Returns the spatial dimension of the domain.        Returns the spatial dimension of the domain.
95        has to be implemented by the actual Domain adapter.  
96          This has to be implemented by the actual Domain adapter.
97    */    */
98    virtual int getDim() const;    virtual int getDim() const;
99    
100    /**    /**
101     \brief       \brief
102     Return true if given domains are equal.       Return true if given domains are equal.
103    */    */
104    bool operator==(const AbstractDomain& other) const;    bool operator==(const AbstractDomain& other) const;
105    bool operator!=(const AbstractDomain& other) const;    bool operator!=(const AbstractDomain& other) const;
106    
107    /**    /**
108       \brief       \brief
109       Writes the doamin to an external file filename.       Writes the domain to an external file filename.
110    
111       This has to be implemented by the actual Domain adapter.       This has to be implemented by the actual Domain adapter.
112    */    */
113    virtual void write(const std::string& filename) const;    virtual void write(const std::string& filename) const;
# Line 131  class AbstractDomain { Line 127  class AbstractDomain {
127    /**    /**
128       \brief       \brief
129       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.
130       has to be implemented by the actual Domain adapter.  
131         This has to be implemented by the actual Domain adapter.
132    
133       \param functionSpaceCode Input - Code for the function space type.       \param functionSpaceCode Input - Code for the function space type.
134       \return pair, first - number of data points per sample, second - number of samples       \return pair, first - number of data points per sample, second - number of samples
135    */    */
# Line 155  class AbstractDomain { Line 153  class AbstractDomain {
153    
154    /**    /**
155       \brief       \brief
156       Assigns new location to the domain       Assigns new location to the domain.
157       has to be implemented by the actual Domain adapter.  
158         This has to be implemented by the actual Domain adapter.
159    */    */
160    virtual void setNewX(const escript::Data& arg);    virtual void setNewX(const escript::Data& arg);
161    
162    /**    /**
163       \brief       \brief
164       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.
165       has to be implemented by the actual Domain adapter.  
166         This 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;
# Line 171  class AbstractDomain { Line 171  class AbstractDomain {
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.  
175         This has to be implemented by the actual Domain adapter.
176    */    */
177    virtual void interpolateACross(escript::Data& target, const escript::Data& source) const;    virtual void interpolateACross(escript::Data& target, const escript::Data& source) const;
178    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;
179    
180    /**    /**
181       \brief returns locations in the domain. The function space is chosen appropriately.       \brief
182         Returns locations in the domain. The function space is chosen appropriately.
183    */    */
184    virtual escript::Data getX() const;    virtual escript::Data getX() const;
185    
186    /**    /**
187       \brief return boundary normals. The function space is chosen appropriately.       \brief
188         Return boundary normals. The function space is chosen appropriately.
189    */    */
190    virtual escript::Data getNormal() const;    virtual escript::Data getNormal() const;
191    
192    /**    /**
193       \brief returns the local size of samples. The function space is chosen appropriately.       \brief
194         Returns the local size of samples. The function space is chosen appropriately.
195    */    */
196    virtual escript::Data getSize() const;    virtual escript::Data getSize() const;
197        
# Line 196  class AbstractDomain { Line 200  class AbstractDomain {
200       Copies the location of data points on the domain into out.       Copies the location of data points on the domain into out.
201       The actual function space to be considered       The actual function space to be considered
202       is defined by out. out has to be defined on this.       is defined by out. out has to be defined on this.
203       has to be implemented by the actual Domain adapter.  
204         This has to be implemented by the actual Domain adapter.
205    */    */
206    virtual void setToX(escript::Data& out) const;    virtual void setToX(escript::Data& out) const;
207    
# Line 205  class AbstractDomain { Line 210  class AbstractDomain {
210       Copies the surface normals at data points into out.       Copies the surface normals at data points into out.
211       The actual function space to be considered       The actual function space to be considered
212       is defined by out. out has to be defined on this.       is defined by out. out has to be defined on this.
213       has to be implemented by the actual Domain adapter.  
214         This has to be implemented by the actual Domain adapter.
215    */    */
216    virtual void setToNormal(escript::Data& out) const;    virtual void setToNormal(escript::Data& out) const;
217    
# Line 214  class AbstractDomain { Line 220  class AbstractDomain {
220       Copies the size of samples into out. The actual       Copies the size of samples into out. The actual
221       function space to be considered       function space to be considered
222       is defined by out. out has to be defined on this.       is defined by out. out has to be defined on this.
223       has to be implemented by the actual Domain adapter.  
224         This has to be implemented by the actual Domain adapter.
225    */    */
226    virtual void setToSize(escript::Data& out) const;    virtual void setToSize(escript::Data& out) const;
227    
# Line 222  class AbstractDomain { Line 229  class AbstractDomain {
229       \brief       \brief
230       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
231       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.
232       has to be implemented by the actual Domain adapter.  
233         This has to be implemented by the actual Domain adapter.
234    */    */
235    virtual void setToGradient(escript::Data& grad, const escript::Data& arg) const;    virtual void setToGradient(escript::Data& grad, const escript::Data& arg) const;
236    
# Line 230  class AbstractDomain { Line 238  class AbstractDomain {
238       \brief       \brief
239       Saves data arg to an OpenDX input file.       Saves data arg to an OpenDX input file.
240       considered as cell centered data.       considered as cell centered data.
241       has to be implemented by the actual Domain adapter.  
242         This has to be implemented by the actual Domain adapter.
243    */    */
244    virtual void saveDX(const std::string& filename,const escript::Data& arg) const;    virtual void saveDX(const std::string& filename,const escript::Data& arg) const;
245    
# Line 238  class AbstractDomain { Line 247  class AbstractDomain {
247       \brief       \brief
248       saves data arg to a VTK input file.       saves data arg to a VTK input file.
249       considered as cell centered data.       considered as cell centered data.
250       has to be implemented by the actual Domain adapter.  
251         This has to be implemented by the actual Domain adapter.
252    */    */
253    virtual void saveVTK(const std::string& filename,const escript::Data& arg) const;    virtual void saveVTK(const std::string& filename,const escript::Data& arg) const;
254    
# Line 246  class AbstractDomain { Line 256  class AbstractDomain {
256       \brief       \brief
257       returns the function space representation of the type functionSpaceCode on this domain       returns the function space representation of the type functionSpaceCode on this domain
258       as a vtkObject.       as a vtkObject.
259       has to be implemented by the actual Domain adapter.  
260         This has to be implemented by the actual Domain adapter.
261    */    */
262    //virtual vtkObject createVtkObject(int functionSpaceCode) const;    //virtual vtkObject createVtkObject(int functionSpaceCode) const;
263    
# Line 254  class AbstractDomain { Line 265  class AbstractDomain {
265       \brief       \brief
266       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
267       considered as cell centered data.       considered as cell centered data.
268       has to be implemented by the actual Domain adapter.  
269         This has to be implemented by the actual Domain adapter.
270    */    */
271    virtual bool isCellOriented(int functionSpaceCode) const;    virtual bool isCellOriented(int functionSpaceCode) const;
272    
273      /**
274         \brief
275         Throw a standard exception. This function is called if any attempt
276         is made to use a base class function.
277      */
278      void throwStandardException(const std::string& functionName) const;
279    
280   protected:   protected:
281    
282   private:   private:
# Line 265  class AbstractDomain { Line 284  class AbstractDomain {
284  };  };
285    
286  } // end of namespace  } // end of namespace
287    
288  #endif  #endif

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

  ViewVC Help
Powered by ViewVC 1.1.26