/[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 797 by gross, Thu Aug 3 02:03:18 2006 UTC revision 2642 by jfenwick, Tue Sep 1 04:15:50 2009 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  */  /*******************************************************
3    *
4    * Copyright (c) 2003-2009 by University of Queensland
5    * Earth Systems Science Computational Center (ESSCC)
6    * http://www.uq.edu.au/esscc
7    *
8    * Primary Business: Queensland, Australia
9    * Licensed under the Open Software License version 3.0
10    * http://www.opensource.org/licenses/osl-3.0.php
11    *
12    *******************************************************/
13    
14    
15  #if !defined escript_AbstractDomain_20040609_H  #if !defined escript_AbstractDomain_20040609_H
16  #define escript_AbstractDomain_20040609_H  #define escript_AbstractDomain_20040609_H
17    
18  #include "system_dep.h"  #include "system_dep.h"
19    
20    #include <vector>
21  #include <string>  #include <string>
22  #include <map>  #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    
28    #include "Pointers.h"
29    
30  namespace escript {  namespace escript {
31  // class forward declarations  // class forward declarations
# Line 32  class Data; Line 38  class Data;
38     Base class for all escript domains.     Base class for all escript domains.
39  */  */
40    
41  class AbstractDomain {  class AbstractDomain;
42    
43    typedef POINTER_WRAPPER_CLASS(AbstractDomain) Domain_ptr;
44    typedef POINTER_WRAPPER_CLASS(const AbstractDomain) const_Domain_ptr;
45    
46    class AbstractDomain : public REFCOUNT_BASE_CLASS(AbstractDomain){
47    
48   public:   public:
49    
50    /**
51    \brief Returns smart pointer which is managing this object.
52    If one does not exist yet it creates one.
53    
54    Note: This is _not_ equivalent to weak_ptr::lock.
55    */
56       ESCRIPT_DLL_API
57       Domain_ptr getPtr();
58       ESCRIPT_DLL_API
59       const_Domain_ptr getPtr() const;
60    
61     // structure holding values for X, size and normal     // structure holding values for X, size and normal
62     typedef int StatusType;     typedef int StatusType;
# Line 86  class AbstractDomain { Line 107  class AbstractDomain {
107    
108    /**    /**
109       \brief       \brief
110         return the number of processors used for this domain
111      */
112      ESCRIPT_DLL_API
113      virtual int getMPISize() const;
114      /**
115         \brief
116         return the number MPI rank of this processor
117      */
118    
119      ESCRIPT_DLL_API
120      virtual int getMPIRank() const;
121    
122      /**
123         \brief
124         If compiled for MPI then execute an MPI_Barrier, else do nothing
125      */
126    
127      ESCRIPT_DLL_API
128      virtual void MPIBarrier() const;
129      /**
130         \brief
131         Return true if on MPI master, else false
132      */
133    
134      ESCRIPT_DLL_API
135      virtual bool onMasterProcessor() const;
136    
137      /**
138      \brief get the communicator for this domain.
139      Returns 0 on non-MPI builds
140      */
141      ESCRIPT_DLL_API
142      virtual
143    #ifdef PASO_MPI
144      MPI_Comm
145    #else
146      unsigned int
147    #endif
148      getMPIComm() const;
149    
150      /**
151         \brief
152       Returns true if the given integer is a valid function space type       Returns true if the given integer is a valid function space type
153       for this domain.       for this domain.
154    */    */
# Line 135  class AbstractDomain { Line 198  class AbstractDomain {
198    
199    /**    /**
200       \brief       \brief
201         dumps the domain to an external file filename.
202    
203         This has to be implemented by the actual Domain adapter.
204      */
205      ESCRIPT_DLL_API
206      virtual void dump(const std::string& filename) const;
207    
208      /**
209         \brief
210       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.
211    
212       This has to be implemented by the actual Domain adapter.       This has to be implemented by the actual Domain adapter.
# Line 156  class AbstractDomain { Line 228  class AbstractDomain {
228    
229    /**    /**
230       \brief       \brief
231       Return the reference number of the given sample number.       sets a map from a clear tag name to a tag key
232         \param name Input - tag name.
233         \param tag Input - tag key.
234      */
235      ESCRIPT_DLL_API
236      virtual void setTagMap(const std::string& name,  int tag);
237    
238      /**
239         \brief
240         Return the tag key for tag name.
241         \param name Input - tag name
242      */
243      ESCRIPT_DLL_API
244      virtual int getTag(const std::string& name) const;
245    
246      /**
247         \brief
248         Returns True if name is a defined tag name
249         \param name Input - tag name
250      */
251      ESCRIPT_DLL_API
252      virtual bool isValidTagName(const std::string& name) const;
253    
254      /**
255         \brief
256         Returns all tag names in a single string sperated by commas
257      */
258      ESCRIPT_DLL_API
259      virtual std::string showTagNames() const;
260    
261      /**
262         \brief
263         Return a borrowed pointer to the sample reference number id list
264       \param functionSpaceType Input - The function space type.       \param functionSpaceType Input - The function space type.
      \param sampleNo Input - The sample number.  
265    */    */
266    ESCRIPT_DLL_API    ESCRIPT_DLL_API
267    virtual int getReferenceNoFromSampleNo(int functionSpaceType, int sampleNo) const;    virtual const int* borrowSampleReferenceIDs(int functionSpaceType) const;
268    
269    /**    /**
270       \brief       \brief
# Line 184  class AbstractDomain { Line 287  class AbstractDomain {
287    virtual bool probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const;    virtual bool probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const;
288    
289    /**    /**
290        \brief given a vector of FunctionSpace type codes, pass back a code which then can all be interpolated to.
291        \note This method must be called on the domain which the FunctionSpaces point to
292        \return true is result is valid, false if not
293      */
294      ESCRIPT_DLL_API
295      virtual
296      bool
297      commonFunctionSpace(const std::vector<int>& fs, int& resultcode) const;
298    
299      /**
300       \brief       \brief
301       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.
302    
# Line 268  class AbstractDomain { Line 381  class AbstractDomain {
381    
382    /**    /**
383       \brief       \brief
384       Saves a dictonary of Data objects to an VTK XML input file. The keywords are used as identifier       Saves a dictonary of Data objects to an VTK XML input file. The keywords are used as identifier.
385         metadata is string representing some meta data to be added. metadata_schema assign schema to namespaces used in the meta data.
386    
387       This has to be implemented by the actual Domain adapter.       This has to be implemented by the actual Domain adapter.
388    */    */
389    ESCRIPT_DLL_API    ESCRIPT_DLL_API
390    virtual void saveVTK(const std::string& filename,const boost::python::dict& arg) const;    virtual void saveVTK(const std::string& filename,const boost::python::dict& arg, const std::string& metadata, const std::string& metadata_schema) const;
391    
   /**  
      \brief  
      returns the function space representation of the type functionSpaceCode on this domain  
      as a vtkObject.  
392    
393       This has to be implemented by the actual Domain adapter.    ESCRIPT_DLL_API
394    */    virtual bool ownSample(int fs_code, index_t id) const;
   //virtual vtkObject createVtkObject(int functionSpaceCode) const;  
395    
396    /**    /**
397       \brief assigns new tag newTag to all samples of functionspace with a positive       \brief assigns new tag newTag to all samples of functionspace with a positive
# Line 304  class AbstractDomain { Line 413  class AbstractDomain {
413    
414    /**    /**
415       \brief       \brief
416       returns status of the domain.        Returns a status indicator of the domain. The status identifier should be unique over
417          the live time if the object but may be updated if changes to the domain happen, e.g.
418          modifications to its geometry.
419    
420       This has to be implemented by the actual Domain adapter.       This has to be implemented by the actual Domain adapter.
421    */    */
# Line 319  class AbstractDomain { Line 430  class AbstractDomain {
430    ESCRIPT_DLL_API    ESCRIPT_DLL_API
431    void throwStandardException(const std::string& functionName) const;    void throwStandardException(const std::string& functionName) const;
432    
433      /**
434            \brief
435                      return the number of tags in use and a pointer to an array with the number of tags in use
436      */
437      ESCRIPT_DLL_API
438      virtual int getNumberOfTagsInUse(int functionSpaceCode) const;
439    
440      ESCRIPT_DLL_API
441      virtual const int* borrowListOfTagsInUse(int functionSpaceCode) const;
442    
443      /**
444        \brief Checks if this domain allows tags for the specified functionSpaceCode.
445      */
446      ESCRIPT_DLL_API
447      virtual bool canTag(int functionspacecode) const;
448    
449   protected:   protected:
450    
451   private:   private:

Legend:
Removed from v.797  
changed lines
  Added in v.2642

  ViewVC Help
Powered by ViewVC 1.1.26