/[escript]/trunk/finley/src/CPPAdapter/MeshAdapter.h
ViewVC logotype

Diff of /trunk/finley/src/CPPAdapter/MeshAdapter.h

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

temp_trunk_copy/finley/src/CPPAdapter/MeshAdapter.h revision 1384 by phornby, Fri Jan 11 02:29:38 2008 UTC trunk/finley/src/CPPAdapter/MeshAdapter.h revision 2751 by caltinay, Wed Nov 18 00:30:47 2009 UTC
# Line 1  Line 1 
1    
 /* $Id$ */  
   
2  /*******************************************************  /*******************************************************
3   *  *
4   *           Copyright 2003-2007 by ACceSS MNRF  * Copyright (c) 2003-2009 by University of Queensland
5   *       Copyright 2007 by University of Queensland  * Earth Systems Science Computational Center (ESSCC)
6   *  * http://www.uq.edu.au/esscc
7   *                http://esscc.uq.edu.au  *
8   *        Primary Business: Queensland, Australia  * Primary Business: Queensland, Australia
9   *  Licensed under the Open Software License version 3.0  * Licensed under the Open Software License version 3.0
10   *     http://www.opensource.org/licenses/osl-3.0.php  * http://www.opensource.org/licenses/osl-3.0.php
11   *  *
12   *******************************************************/  *******************************************************/
13    
14    
15  #if !defined finley_MeshAdapter_20040526_H  #if !defined finley_MeshAdapter_20040526_H
16  #define finley_MeshAdapter_20040526_H  #define finley_MeshAdapter_20040526_H
# Line 23  extern "C" { Line 22  extern "C" {
22  #include "../Assemble.h"  #include "../Assemble.h"
23  #include "paso/SystemMatrix.h"  #include "paso/SystemMatrix.h"
24  #include "paso/SolverFCT.h"  #include "paso/SolverFCT.h"
25    #include "paso/Paso_MPI.h"
26  }  }
27    
28  #include "FinleyError.h"  #include "FinleyError.h"
# Line 43  extern "C" { Line 43  extern "C" {
43  #include <string>  #include <string>
44  #include <sstream>  #include <sstream>
45    
 //  
 // forward declarations  
 class Data;  
   
 //using namespace escript;  
   
46  namespace finley {  namespace finley {
47    
48  struct null_deleter  struct null_deleter
# Line 142  class MeshAdapter : public escript::Abst Line 136  class MeshAdapter : public escript::Abst
136    
137    /**    /**
138       \brief       \brief
139         If compiled for MPI then execute an MPI_Barrier, else do nothing
140      */
141    
142      FINLEY_DLL_API
143      virtual void MPIBarrier() const;
144    
145      /**
146         \brief
147         Return true if on MPI processor 0, else false
148      */
149    
150      FINLEY_DLL_API
151      virtual bool onMasterProcessor() const;
152    
153      FINLEY_DLL_API
154    #ifdef PASO_MPI
155      MPI_Comm
156    #else
157      unsigned int
158    #endif
159      getMPIComm() const;
160    
161      /**
162         \brief
163       return this as an AbstractContinuousDomain.       return this as an AbstractContinuousDomain.
164    */    */
165    inline const AbstractContinuousDomain& asAbstractContinuousDomain() const    inline const AbstractContinuousDomain& asAbstractContinuousDomain() const
# Line 168  class MeshAdapter : public escript::Abst Line 186  class MeshAdapter : public escript::Abst
186    
187    /**    /**
188       \brief       \brief
189       Write the current mesh to a file with the given name.       \param full
      \param fileName Input - The name of the file to write to.  
190    */    */
191    FINLEY_DLL_API    FINLEY_DLL_API
192    void Print_Mesh_Info(const bool) const;    void Print_Mesh_Info(const bool full=false) const;
193    
194    /**    /**
195       \brief       \brief
# Line 204  class MeshAdapter : public escript::Abst Line 221  class MeshAdapter : public escript::Abst
221       \param functionSpaceType Input - The function space type.       \param functionSpaceType Input - The function space type.
222    */    */
223    FINLEY_DLL_API    FINLEY_DLL_API
224    int* borrowSampleReferenceIDs(int functionSpaceType) const;    const int* borrowSampleReferenceIDs(int functionSpaceType) const;
225    
226    /**    /**
227       \brief       \brief
# Line 340  class MeshAdapter : public escript::Abst Line 357  class MeshAdapter : public escript::Abst
357    
358    /**    /**
359       \brief       \brief
360          Returns a status indicator of the domain. The status identifier should be unique over
361          the live time if the object but may be updated if changes to the domain happen, e.g.
362          modifications to its geometry.
363    
364         This has to be implemented by the actual Domain adapter.
365      */
366      FINLEY_DLL_API
367      virtual StatusType getStatus() const;
368    
369    
370      /**
371         \brief
372         Return the number of data points summed across all MPI processes
373      */
374      FINLEY_DLL_API
375      virtual int getNumDataPointsGlobal() const;
376    
377      /**
378         \brief
379       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.
380       \param functionSpaceCode Input -       \param functionSpaceCode Input -
381    */    */
# Line 399  class MeshAdapter : public escript::Abst Line 435  class MeshAdapter : public escript::Abst
435    */    */
436    FINLEY_DLL_API    FINLEY_DLL_API
437    virtual void interpolateOnDomain(escript::Data& target,const escript::Data& source) const;    virtual void interpolateOnDomain(escript::Data& target,const escript::Data& source) const;
438    
439    
440    FINLEY_DLL_API    FINLEY_DLL_API
441    virtual bool probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const;    virtual bool probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const;
442    
443    /**    /**
444        \brief given a vector of FunctionSpace typecodes, pass back a code which then can all be interpolated to.
445        \return true is result is valid, false if not
446      */
447      FINLEY_DLL_API
448      bool
449      commonFunctionSpace(const std::vector<int>& fs, int& resultcode) const;
450    
451      /**
452       \brief       \brief
453       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.
454       has to be implemented by the actual Domain adapter.       has to be implemented by the actual Domain adapter.
455    */    */
456    FINLEY_DLL_API    FINLEY_DLL_API
457    virtual void interpolateACross(escript::Data& target, const escript::Data& source) const;    virtual void interpolateACross(escript::Data& target, const escript::Data& source) const;
458    
459      /**
460      \brief determines whether interpolation from source to target is possible.
461      Must be implemented by the actual Domain adapter
462      */
463    FINLEY_DLL_API    FINLEY_DLL_API
464    virtual bool probeInterpolationACross(int functionSpaceType_source,const AbstractDomain& targetDomain, int functionSpaceType_target) const;    virtual bool probeInterpolationACross(int functionSpaceType_source,const escript::AbstractDomain& targetDomain, int functionSpaceType_target) const;
465    
466    /**    /**
467       \brief       \brief
# Line 446  class MeshAdapter : public escript::Abst Line 497  class MeshAdapter : public escript::Abst
497    
498    /**    /**
499       \brief       \brief
500       return the identifier of the matrix type to be used for the global stiffness matrix when a particular solver, package       return the identifier of the matrix type to be used for the global stiffness matrix when a particular solver, package, perconditioner,
501       and symmetric matrix is used.       and symmetric matrix is used.
502       \param solver       \param solver
503         \param preconditioner
504         \param package
505       \param symmetry       \param symmetry
506    */    */
507    FINLEY_DLL_API    FINLEY_DLL_API
508    virtual int getSystemMatrixTypeId(const int solver, const int package, const bool symmetry) const;    virtual int getSystemMatrixTypeId(const int solver, const int preconditioner, const int package, const bool symmetry) const;
509    
510      /**
511         \brief
512         return the identifier of the transport problem type to be used when a particular solver, perconditioner, package
513         and symmetric matrix is used.
514         \param solver
515         \param preconditioner
516         \param package
517         \param symmetry
518      */
519      FINLEY_DLL_API
520      virtual int getTransportTypeId(const int solver, const int preconditioner, const int package, const bool symmetry) const;
521    
522    /**    /**
523       \brief       \brief
# Line 479  class MeshAdapter : public escript::Abst Line 544  class MeshAdapter : public escript::Abst
544       This has to be implemented by the actual Domain adapter.       This has to be implemented by the actual Domain adapter.
545    */    */
546    FINLEY_DLL_API    FINLEY_DLL_API
547    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;
548    
549      FINLEY_DLL_API
550      virtual bool ownSample(int fs_code, index_t id) const;
551    
552    /**    /**
553       \brief       \brief
# Line 552  class MeshAdapter : public escript::Abst Line 620  class MeshAdapter : public escript::Abst
620    FINLEY_DLL_API    FINLEY_DLL_API
621    TransportProblemAdapter newTransportProblem(    TransportProblemAdapter newTransportProblem(
622                        const double theta,                        const double theta,
                       const double dt_max,  
623                        const int blocksize,                        const int blocksize,
624                        const escript::FunctionSpace& functionspace,                        const escript::FunctionSpace& functionspace,
625                        const int type) const;                        const int type) const;
# Line 579  class MeshAdapter : public escript::Abst Line 646  class MeshAdapter : public escript::Abst
646       \brief comparison operators       \brief comparison operators
647    */    */
648    FINLEY_DLL_API    FINLEY_DLL_API
649    virtual bool operator==(const AbstractDomain& other) const;    virtual bool operator==(const escript::AbstractDomain& other) const;
650    FINLEY_DLL_API    FINLEY_DLL_API
651    virtual bool operator!=(const AbstractDomain& other) const;    virtual bool operator!=(const escript::AbstractDomain& other) const;
652    
653    /**    /**
654       \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 591  class MeshAdapter : public escript::Abst Line 658  class MeshAdapter : public escript::Abst
658    FINLEY_DLL_API    FINLEY_DLL_API
659    virtual void setTags(const int functionSpaceType, const int newTag, const escript::Data& mask) const;    virtual void setTags(const int functionSpaceType, const int newTag, const escript::Data& mask) const;
660    
661      /**
662          \brief
663              return the number of tags in use and a pointer to an array with the number of tags in use
664      */
665      FINLEY_DLL_API
666      virtual int getNumberOfTagsInUse(int functionSpaceCode) const;
667    
668      FINLEY_DLL_API
669      virtual const int* borrowListOfTagsInUse(int functionSpaceCode) const;
670    
671    
672      /**
673         \brief Checks if this domain allows tags for the specified functionSpaceCode.
674      */
675      FINLEY_DLL_API
676      virtual
677      bool canTag(int functionSpaceCode) const;
678    
679    
680   protected:   protected:
681    
682   private:   private:
683      void extractArgsFromDict(const boost::python::dict& arg, int& numData,
684                                 char**& names, escriptDataC*& data,
685                                 escriptDataC**& dataPtr) const;
686    
687    //    //
688    // pointer to the externally created finley mesh    // pointer to the externally created finley mesh

Legend:
Removed from v.1384  
changed lines
  Added in v.2751

  ViewVC Help
Powered by ViewVC 1.1.26