/[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

revision 1859 by gross, Wed Oct 8 03:03:37 2008 UTC revision 3259 by jfenwick, Mon Oct 11 01:48:14 2010 UTC
# Line 1  Line 1 
1    
2  /*******************************************************  /*******************************************************
3  *  *
4  * Copyright (c) 2003-2008 by University of Queensland  * Copyright (c) 2003-2010 by University of Queensland
5  * Earth Systems Science Computational Center (ESSCC)  * Earth Systems Science Computational Center (ESSCC)
6  * http://www.uq.edu.au/esscc  * http://www.uq.edu.au/esscc
7  *  *
# Line 17  Line 17 
17  #include "system_dep.h"  #include "system_dep.h"
18    
19  extern "C" {  extern "C" {
20  #include "../Mesh.h"  #include "finley/Mesh.h"
21  #include "../Finley.h"  #include "finley/Finley.h"
22  #include "../Assemble.h"  #include "finley/Assemble.h"
23  #include "paso/SystemMatrix.h"  #include "paso/SystemMatrix.h"
24  #include "paso/SolverFCT.h"  #include "paso/Transport.h"
25  #include "paso/Paso_MPI.h"  #include "esysUtils/Esys_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       return this as an AbstractContinuousDomain.       If compiled for MPI then execute an MPI_Barrier, else do nothing
140    */    */
141    inline const AbstractContinuousDomain& asAbstractContinuousDomain() const  
142    {    FINLEY_DLL_API
143       return *(static_cast<const AbstractContinuousDomain*>(this));    virtual void MPIBarrier() const;
   }  
144    
145    /**    /**
146       \brief       \brief
147       return this as an AbstractDomain.       Return true if on MPI processor 0, else false
148    */    */
149    inline const AbstractDomain& asAbstractDomain() const  
150    {    FINLEY_DLL_API
151       return *(static_cast<const AbstractDomain*>(this));    virtual bool onMasterProcessor() const;
152    }  
153      FINLEY_DLL_API
154    #ifdef ESYS_MPI
155      MPI_Comm
156    #else
157      unsigned int
158    #endif
159      getMPIComm() const;
160    
161    /**    /**
162       \brief       \brief
# Line 168  class MeshAdapter : public escript::Abst Line 168  class MeshAdapter : public escript::Abst
168    
169    /**    /**
170       \brief       \brief
171       Write the current mesh to a file with the given name.       \param full
      \param fileName Input - The name of the file to write to.  
172    */    */
173    FINLEY_DLL_API    FINLEY_DLL_API
174    void Print_Mesh_Info(const bool) const;    void Print_Mesh_Info(const bool full=false) const;
175    
176    /**    /**
177       \brief       \brief
# Line 204  class MeshAdapter : public escript::Abst Line 203  class MeshAdapter : public escript::Abst
203       \param functionSpaceType Input - The function space type.       \param functionSpaceType Input - The function space type.
204    */    */
205    FINLEY_DLL_API    FINLEY_DLL_API
206    int* borrowSampleReferenceIDs(int functionSpaceType) const;    const int* borrowSampleReferenceIDs(int functionSpaceType) const;
207    
208    /**    /**
209       \brief       \brief
# Line 340  class MeshAdapter : public escript::Abst Line 339  class MeshAdapter : public escript::Abst
339    
340    /**    /**
341       \brief       \brief
342          Returns a status indicator of the domain. The status identifier should be unique over
343          the live time if the object but may be updated if changes to the domain happen, e.g.
344          modifications to its geometry.
345    
346         This has to be implemented by the actual Domain adapter.
347      */
348      FINLEY_DLL_API
349      virtual StatusType getStatus() const;
350    
351    
352      /**
353         \brief
354       Return the number of data points summed across all MPI processes       Return the number of data points summed across all MPI processes
355    */    */
356    FINLEY_DLL_API    FINLEY_DLL_API
# Line 406  class MeshAdapter : public escript::Abst Line 417  class MeshAdapter : public escript::Abst
417    */    */
418    FINLEY_DLL_API    FINLEY_DLL_API
419    virtual void interpolateOnDomain(escript::Data& target,const escript::Data& source) const;    virtual void interpolateOnDomain(escript::Data& target,const escript::Data& source) const;
420    
421    
422    FINLEY_DLL_API    FINLEY_DLL_API
423    virtual bool probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const;    virtual bool probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const;
424    
425    /**    /**
426        \brief given a vector of FunctionSpace typecodes, pass back a code which then can all be interpolated to.
427        \return true is result is valid, false if not
428      */
429      FINLEY_DLL_API
430      bool
431      commonFunctionSpace(const std::vector<int>& fs, int& resultcode) const;
432    
433      /**
434       \brief       \brief
435       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.
436       has to be implemented by the actual Domain adapter.       has to be implemented by the actual Domain adapter.
437    */    */
438    FINLEY_DLL_API    FINLEY_DLL_API
439    virtual void interpolateACross(escript::Data& target, const escript::Data& source) const;    virtual void interpolateACross(escript::Data& target, const escript::Data& source) const;
440    
441      /**
442      \brief determines whether interpolation from source to target is possible.
443      Must be implemented by the actual Domain adapter
444      */
445    FINLEY_DLL_API    FINLEY_DLL_API
446    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;
447    
448    /**    /**
449       \brief       \brief
# Line 455  class MeshAdapter : public escript::Abst Line 481  class MeshAdapter : public escript::Abst
481       \brief       \brief
482       return the identifier of the matrix type to be used for the global stiffness matrix when a particular solver, package, perconditioner,       return the identifier of the matrix type to be used for the global stiffness matrix when a particular solver, package, perconditioner,
483       and symmetric matrix is used.       and symmetric matrix is used.
      \param precondioner  
484       \param solver       \param solver
485         \param preconditioner
486         \param package
487       \param symmetry       \param symmetry
488    */    */
489    FINLEY_DLL_API    FINLEY_DLL_API
# Line 466  class MeshAdapter : public escript::Abst Line 493  class MeshAdapter : public escript::Abst
493       \brief       \brief
494       return the identifier of the transport problem type to be used when a particular solver, perconditioner, package       return the identifier of the transport problem type to be used when a particular solver, perconditioner, package
495       and symmetric matrix is used.       and symmetric matrix is used.
      \param precondioner  
496       \param solver       \param solver
497         \param preconditioner
498         \param package
499       \param symmetry       \param symmetry
500    */    */
501    FINLEY_DLL_API    FINLEY_DLL_API
# Line 498  class MeshAdapter : public escript::Abst Line 526  class MeshAdapter : public escript::Abst
526       This has to be implemented by the actual Domain adapter.       This has to be implemented by the actual Domain adapter.
527    */    */
528    FINLEY_DLL_API    FINLEY_DLL_API
529    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;
530    
531      FINLEY_DLL_API
532      virtual bool ownSample(int fs_code, index_t id) const;
533    
534    /**    /**
535       \brief       \brief
# Line 556  class MeshAdapter : public escript::Abst Line 587  class MeshAdapter : public escript::Abst
587      creates a SystemMatrixAdapter stiffness matrix and initializes it with zeros:      creates a SystemMatrixAdapter stiffness matrix and initializes it with zeros:
588    */    */
589    FINLEY_DLL_API    FINLEY_DLL_API
590    SystemMatrixAdapter newSystemMatrix(    escript::ASM_ptr newSystemMatrix(
591                        const int row_blocksize,                        const int row_blocksize,
592                        const escript::FunctionSpace& row_functionspace,                        const escript::FunctionSpace& row_functionspace,
593                        const int column_blocksize,                        const int column_blocksize,
# Line 569  class MeshAdapter : public escript::Abst Line 600  class MeshAdapter : public escript::Abst
600    */    */
601    
602    FINLEY_DLL_API    FINLEY_DLL_API
603    TransportProblemAdapter newTransportProblem(    escript::ATP_ptr newTransportProblem(
604                        const double theta,                        const bool useBackwardEuler,
605                        const int blocksize,                        const int blocksize,
606                        const escript::FunctionSpace& functionspace,                        const escript::FunctionSpace& functionspace,
607                        const int type) const;                        const int type) const;
# Line 597  class MeshAdapter : public escript::Abst Line 628  class MeshAdapter : public escript::Abst
628       \brief comparison operators       \brief comparison operators
629    */    */
630    FINLEY_DLL_API    FINLEY_DLL_API
631    virtual bool operator==(const AbstractDomain& other) const;    virtual bool operator==(const escript::AbstractDomain& other) const;
632    FINLEY_DLL_API    FINLEY_DLL_API
633    virtual bool operator!=(const AbstractDomain& other) const;    virtual bool operator!=(const escript::AbstractDomain& other) const;
634    
635    /**    /**
636       \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 617  class MeshAdapter : public escript::Abst Line 648  class MeshAdapter : public escript::Abst
648    virtual int getNumberOfTagsInUse(int functionSpaceCode) const;    virtual int getNumberOfTagsInUse(int functionSpaceCode) const;
649    
650    FINLEY_DLL_API    FINLEY_DLL_API
651    virtual int* borrowListOfTagsInUse(int functionSpaceCode) const;    virtual const int* borrowListOfTagsInUse(int functionSpaceCode) const;
652    
653    
654    /**    /**
# Line 627  class MeshAdapter : public escript::Abst Line 658  class MeshAdapter : public escript::Abst
658    virtual    virtual
659    bool canTag(int functionSpaceCode) const;    bool canTag(int functionSpaceCode) const;
660    
661       /**
662       \brief returns the approximation order used for a function space functionSpaceCode
663       */
664    
665      FINLEY_DLL_API
666      virtual
667      int getApproximationOrder(const int functionSpaceCode) const;
668    
669      FINLEY_DLL_API
670      bool supportsContactElements() const;
671    
672    
673   protected:   protected:
674    
675   private:   private:
676      void extractArgsFromDict(const boost::python::dict& arg, int& numData,
677                                 char**& names, escriptDataC*& data,
678                                 escriptDataC**& dataPtr) const;
679    
680    //    //
681    // pointer to the externally created finley mesh    // pointer to the externally created finley mesh
# Line 640  class MeshAdapter : public escript::Abst Line 685  class MeshAdapter : public escript::Abst
685    
686  };  };
687    
688    // Do not use this class. It is a convenience wrapper for the dataexporter.
689    class FINLEY_DLL_API ReferenceElementSetWrapper {
690     public:
691      ReferenceElementSetWrapper(Finley_ElementTypeId id, index_t order,
692                                 index_t reducedOrder);
693      ~ReferenceElementSetWrapper();
694    
695      Finley_ReferenceElementSet* getElementSet() const { return m_refSet; }
696    
697     private:
698      Finley_ReferenceElementSet* m_refSet;
699    };
700    
701    
702  } // end of namespace  } // end of namespace
703    
704  #endif  #endif

Legend:
Removed from v.1859  
changed lines
  Added in v.3259

  ViewVC Help
Powered by ViewVC 1.1.26