/[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 757 by woo409, Mon Jun 26 13:12:56 2006 UTC revision 1801 by ksteube, Fri Sep 19 01:37:09 2008 UTC
# Line 1  Line 1 
 // $Id$  
 /*  
  ************************************************************  
  *          Copyright 2006 by ACcESS MNRF                   *  
  *                                                          *  
  *              http://www.access.edu.au                    *  
  *       Primary Business: Queensland, Australia            *  
  *  Licensed under the Open Software License version 3.0    *  
  *     http://www.opensource.org/licenses/osl-3.0.php       *  
  *                                                          *  
  ************************************************************  
1    
2  */  /* $Id$ */
3    
4    /*******************************************************
5     *
6     *           Copyright 2003-2007 by ACceSS MNRF
7     *       Copyright 2007 by University of Queensland
8     *
9     *                http://esscc.uq.edu.au
10     *        Primary Business: Queensland, Australia
11     *  Licensed under the Open Software License version 3.0
12     *     http://www.opensource.org/licenses/osl-3.0.php
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
# Line 18  Line 19 
19  #include "system_dep.h"  #include "system_dep.h"
20    
21  #include <string>  #include <string>
22    #include <map>
23  #include <boost/python/dict.hpp>  #include <boost/python/dict.hpp>
24    #include <boost/python/list.hpp>
25    #include "paso/Paso_MPI.h"
26    
27  namespace escript {  namespace escript {
28    // class forward declarations
 //  
 // forward declarations  
29  class Data;  class Data;
 //class AbstractSystemMatrix;  
 //class FunctionSpace;  
   
30  /**  /**
31     \brief     \brief
32     Base class for all escript domains.     Base class for all escript domains.
# Line 40  class AbstractDomain { Line 39  class AbstractDomain {
39    
40   public:   public:
41    
42    
43       // structure holding values for X, size and normal
44       typedef int StatusType;
45       struct ValueBuffer
46       {
47           StatusType m_status;
48           boost::shared_ptr<Data> m_data;
49       };
50       typedef struct ValueBuffer ValueBuffer;
51    
52       //
53       // map from function space type code to value buffer
54       typedef std::map<int, ValueBuffer> BufferMapType;
55    
56    
57    /**    /**
58       \brief       \brief
59       Default constructor for AbstractDomain.       Default constructor for AbstractDomain.
# Line 75  class AbstractDomain { Line 89  class AbstractDomain {
89    
90    /**    /**
91       \brief       \brief
92         return the number of processors used for this domain
93      */
94      ESCRIPT_DLL_API
95      virtual int getMPISize() const;
96      /**
97         \brief
98         return the number MPI rank of this processor
99      */
100    
101      ESCRIPT_DLL_API
102      virtual int getMPIRank() const;
103    
104    
105    
106      /**
107         \brief
108       Returns true if the given integer is a valid function space type       Returns true if the given integer is a valid function space type
109       for this domain.       for this domain.
110    */    */
# Line 124  class AbstractDomain { Line 154  class AbstractDomain {
154    
155    /**    /**
156       \brief       \brief
157         dumps the domain to an external file filename.
158    
159         This has to be implemented by the actual Domain adapter.
160      */
161      ESCRIPT_DLL_API
162      virtual void dump(const std::string& filename) const;
163    
164      /**
165         \brief
166       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.
167    
168       This has to be implemented by the actual Domain adapter.       This has to be implemented by the actual Domain adapter.
# Line 145  class AbstractDomain { Line 184  class AbstractDomain {
184    
185    /**    /**
186       \brief       \brief
187       Return the reference number of the given sample number.       sets a map from a clear tag name to a tag key
188         \param name Input - tag name.
189         \param tag Input - tag key.
190      */
191      ESCRIPT_DLL_API
192      virtual void setTagMap(const std::string& name,  int tag);
193    
194      /**
195         \brief
196         Return the tag key for tag name.
197         \param name Input - tag name
198      */
199      ESCRIPT_DLL_API
200      virtual int getTag(const std::string& name) const;
201    
202      /**
203         \brief
204         Returns True if name is a defined tag name
205         \param name Input - tag name
206      */
207      ESCRIPT_DLL_API
208      virtual bool isValidTagName(const std::string& name) const;
209    
210      /**
211         \brief
212         Returns all tag names in a single string sperated by commas
213      */
214      ESCRIPT_DLL_API
215      virtual std::string showTagNames() const;
216    
217      /**
218         \brief
219         Return a borrowed pointer to the sample reference number id list
220       \param functionSpaceType Input - The function space type.       \param functionSpaceType Input - The function space type.
      \param sampleNo Input - The sample number.  
221    */    */
222    ESCRIPT_DLL_API    ESCRIPT_DLL_API
223    virtual int getReferenceNoFromSampleNo(int functionSpaceType, int sampleNo) const;    virtual int* borrowSampleReferenceIDs(int functionSpaceType) const;
224    
225    /**    /**
226       \brief       \brief
# Line 274  class AbstractDomain { Line 344  class AbstractDomain {
344    //virtual vtkObject createVtkObject(int functionSpaceCode) const;    //virtual vtkObject createVtkObject(int functionSpaceCode) const;
345    
346    /**    /**
347         \brief assigns new tag newTag to all samples of functionspace with a positive
348         value of mask for any its sample point.
349    
350      */
351      ESCRIPT_DLL_API
352      virtual void setTags(const int functionSpaceType, const int newTag, const escript::Data& mask) const;
353    
354      /**
355       \brief       \brief
356       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
357       considered as cell centered data.       considered as cell centered data.
# Line 285  class AbstractDomain { Line 363  class AbstractDomain {
363    
364    /**    /**
365       \brief       \brief
366         returns status of the domain.
367    
368         This has to be implemented by the actual Domain adapter.
369      */
370      ESCRIPT_DLL_API
371      virtual StatusType getStatus() const;
372    
373      /**
374         \brief
375       Throw a standard exception. This function is called if any attempt       Throw a standard exception. This function is called if any attempt
376       is made to use a base class function.       is made to use a base class function.
377    */    */
378    ESCRIPT_DLL_API    ESCRIPT_DLL_API
379    void throwStandardException(const std::string& functionName) const;    void throwStandardException(const std::string& functionName) const;
380    
381      /**
382            \brief
383                      return the number of tags in use and a pointer to an array with the number of tags in use
384      */
385      ESCRIPT_DLL_API
386      virtual int getNumberOfTagsInUse(int functionSpaceCode) const;
387    
388      ESCRIPT_DLL_API
389      virtual int* borrowListOfTagsInUse(int functionSpaceCode) const;
390    
391    
392    
393   protected:   protected:
394    
395   private:   private:
396    
397       // buffer for coordinates used by function spaces
398       BufferMapType m_x_buffer;
399    
400       // buffer for normal vectors used by function spaces
401       BufferMapType m_normal_buffer;
402    
403       // buffer for normal element size used by function spaces
404       BufferMapType m_size_buffer;
405    
406  };  };
407    
408  } // end of namespace  } // end of namespace

Legend:
Removed from v.757  
changed lines
  Added in v.1801

  ViewVC Help
Powered by ViewVC 1.1.26