/[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 123 by jgs, Fri Jul 8 04:08:13 2005 UTC revision 149 by jgs, Thu Sep 1 03:31:39 2005 UTC
# Line 13  Line 13 
13   ******************************************************************************   ******************************************************************************
14  */  */
15                                                                                                                                                        
16  #if !defined  finley_MeshAdapter_20040526_H  #if !defined finley_MeshAdapter_20040526_H
17  #define finley_MeshAdapter_20040526_H  #define finley_MeshAdapter_20040526_H
18    
19  #include "escript/Data/AbstractContinuousDomain.h"  #include "escript/Data/AbstractContinuousDomain.h"
# Line 23  extern "C" { Line 23  extern "C" {
23  #include "finley/finleyC/Mesh.h"  #include "finley/finleyC/Mesh.h"
24  }  }
25  #include "finley/CPPAdapter/SystemMatrixAdapter.h"  #include "finley/CPPAdapter/SystemMatrixAdapter.h"
26    
27  #include <boost/shared_ptr.hpp>  #include <boost/shared_ptr.hpp>
28  #include <boost/python/object.hpp>  #include <boost/python/object.hpp>
29  #include <map>  #include <map>
# Line 83  class MeshAdapter:public escript::Abstra Line 84  class MeshAdapter:public escript::Abstra
84                                 destructor.                                 destructor.
85    */    */
86    MeshAdapter(Finley_Mesh* finleyMesh=0);    MeshAdapter(Finley_Mesh* finleyMesh=0);
87    
88    /**    /**
89       \brief       \brief
90       Copy constructor.       Copy constructor.
91    */    */
92    MeshAdapter(const MeshAdapter& in);    MeshAdapter(const MeshAdapter& in);
93    
94    /**    /**
95       \brief       \brief
96       Destructor for MeshAdapter. As specified in the constructor       Destructor for MeshAdapter. As specified in the constructor
97       this calls  Finley_Mesh_deallocate for the pointer given to the       this calls Finley_Mesh_deallocate for the pointer given to the
98       constructor.       constructor.
99    */    */
100    ~MeshAdapter();    ~MeshAdapter();
101    
102    /**    /**
103       \brief       \brief
104       return this as an AbstractContinuousDomain.       return this as an AbstractContinuousDomain.
# Line 112  class MeshAdapter:public escript::Abstra Line 116  class MeshAdapter:public escript::Abstra
116    {    {
117       return *(static_cast<const AbstractDomain*>(this));       return *(static_cast<const AbstractDomain*>(this));
118    }    }
119    
120    /**    /**
121       \brief       \brief
122       Write the current mesh to a file with the given name.       Write the current mesh to a file with the given name.
123       \param fileName Input - The name of the file to write to.       \param fileName Input - The name of the file to write to.
124    */    */
125    void write(const std::string& fileName) const;    void write(const std::string& fileName) const;
126    
127    /**    /**
128       \brief       \brief
129       return the pointer of the underlying finley mesh structure       return the pointer to the underlying finley mesh structure
130    */    */
131    Finley_Mesh* getFinley_Mesh() const;    Finley_Mesh* getFinley_Mesh() const;
132    
133    /**    /**
134       \brief       \brief
135       Return the tag list indexed by sampleNo.       Return the tag list indexed by sampleNo.
# Line 130  class MeshAdapter:public escript::Abstra Line 137  class MeshAdapter:public escript::Abstra
137       \param tagList Output       \param tagList Output
138       \param numTags Output       \param numTags Output
139    */    */
   
140    void getTagList(int functionSpaceType, int** tagList,    void getTagList(int functionSpaceType, int** tagList,
141                     int* numTags) const;                     int* numTags) const;
142    /**    /**
# Line 150  class MeshAdapter:public escript::Abstra Line 156  class MeshAdapter:public escript::Abstra
156       \param sampleNo Input - The sample number.       \param sampleNo Input - The sample number.
157    */    */
158    int getTagFromSampleNo(int functionSpaceType, int sampleNo) const;    int getTagFromSampleNo(int functionSpaceType, int sampleNo) const;
159    
160    /**    /**
161       \brief       \brief
162       Return the reference number of  the given sample number.       Return the reference number of  the given sample number.
# Line 164  class MeshAdapter:public escript::Abstra Line 171  class MeshAdapter:public escript::Abstra
171       for this domain.       for this domain.
172    */    */
173    virtual bool isValidFunctionSpaceType(int functionSpaceType) const;    virtual bool isValidFunctionSpaceType(int functionSpaceType) const;
174    
175    /**    /**
176       \brief       \brief
177       Return a description for this domain       Return a description for this domain
178    */    */
179    virtual std::string getDescription() const;    virtual std::string getDescription() const;
180    
181    /**    /**
182       \brief       \brief
183       Return a description for the given function space type code       Return a description for the given function space type code
# Line 180  class MeshAdapter:public escript::Abstra Line 189  class MeshAdapter:public escript::Abstra
189       Build the table of function space type names       Build the table of function space type names
190    */    */
191    void setFunctionSpaceTypeNames();    void setFunctionSpaceTypeNames();
192    
193    /**    /**
194       \brief       \brief
195       Return a continuous FunctionSpace code       Return a continuous FunctionSpace code
196    */    */
197    virtual int getContinuousFunctionCode() const;    virtual int getContinuousFunctionCode() const;
198    
199    /**    /**
200       \brief       \brief
201       Return a functon FunctionSpace code       Return a functon FunctionSpace code
202    */    */
203    virtual int getFunctionCode() const;    virtual int getFunctionCode() const;
204    
205    /**    /**
206       \brief       \brief
207       Return a function on boundary FunctionSpace code       Return a function on boundary FunctionSpace code
208    */    */
209    virtual int getFunctionOnBoundaryCode() const;    virtual int getFunctionOnBoundaryCode() const;
210    
211    /**    /**
212       \brief       \brief
213       Return a FunctionOnContactZero code       Return a FunctionOnContactZero code
214    */    */
215    virtual int getFunctionOnContactZeroCode() const;    virtual int getFunctionOnContactZeroCode() const;
216    
217    /**    /**
218       \brief       \brief
219       Return a FunctionOnContactOne code       Return a FunctionOnContactOne code
220    */    */
221    virtual int getFunctionOnContactOneCode() const;    virtual int getFunctionOnContactOneCode() const;
222    
223    /**    /**
224       \brief       \brief
225       Return a Solution code       Return a Solution code
226    */    */
227    virtual int getSolutionCode() const;    virtual int getSolutionCode() const;
228    
229    /**    /**
230       \brief       \brief
231       Return a ReducedSolution code       Return a ReducedSolution code
232    */    */
233    virtual int getReducedSolutionCode() const;    virtual int getReducedSolutionCode() const;
234    
235    /**    /**
236       \brief       \brief
237       Return a DiracDeltaFunction code       Return a DiracDeltaFunction code
238    */    */
239    virtual int getDiracDeltaFunctionCode() const;    virtual int getDiracDeltaFunctionCode() const;
240    //  
241    //    /**
242         \brief
243      */
244    typedef std::map<int, std::string> FunctionSpaceNamesMapType;    typedef std::map<int, std::string> FunctionSpaceNamesMapType;
245    
246    /**    /**
247       \brief       \brief
248    */    */
249    virtual int getDim() const;    virtual int getDim() const;
250   /**  
251      /**
252       \brief       \brief
253       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.
254       \param functionSpaceCode Input -       \param functionSpaceCode Input -
# Line 240  class MeshAdapter:public escript::Abstra Line 261  class MeshAdapter:public escript::Abstra
261       has to be implemented by the actual Domain adapter.       has to be implemented by the actual Domain adapter.
262    */    */
263    virtual void setToX(escript::Data& arg) const;    virtual void setToX(escript::Data& arg) const;
264    
265    /**    /**
266       \brief       \brief
267       assigns new location to the domain       assigns new location to the domain
268    */    */
269    virtual void setNewX(const escript::Data& arg);    virtual void setNewX(const escript::Data& arg);
270    
271    /**    /**
272       \brief       \brief
273       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.
274    */    */
275    virtual void interpolateOnDomain(escript::Data& target,const escript::Data& source) const;    virtual void interpolateOnDomain(escript::Data& target,const escript::Data& source) const;
276    virtual bool probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const;    virtual bool probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const;
277    
278    /**    /**
279       \brief       \brief
280       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.
# Line 258  class MeshAdapter:public escript::Abstra Line 282  class MeshAdapter:public escript::Abstra
282    */    */
283    virtual void interpolateACross(escript::Data& target, const escript::Data& source) const;    virtual void interpolateACross(escript::Data& target, const escript::Data& source) const;
284    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;
285    
286    /**    /**
287       \brief       \brief
288       copies the surface normals at data points into out.  The actual function space to be considered       copies the surface normals at data points into out. The actual function space to be considered
289       is defined by out. out has to be defined on this.       is defined by out. out has to be defined on this.
290    */    */
291    virtual void setToNormal(escript::Data& out) const;    virtual void setToNormal(escript::Data& out) const;
292    
293    /**    /**
294       \brief       \brief
295       copies the size of samples into out. The actual function space to be considered       copies the size of samples into out. The actual function space to be considered
# Line 285  class MeshAdapter:public escript::Abstra Line 311  class MeshAdapter:public escript::Abstra
311    */    */
312    virtual void setToIntegrals(std::vector<double>& integrals,const escript::Data& arg) const;    virtual void setToIntegrals(std::vector<double>& integrals,const escript::Data& arg) const;
313    
314   /**    /**
315       \brief       \brief
316       return the identifier of the matrix type to be used for the global stiffness matrix when a particular solver, preconditioner       return the identifier of the matrix type to be used for the global stiffness matrix when a particular solver, preconditioner
317       and symmetric matrix is used.       and symmetric matrix is used.
# Line 300  class MeshAdapter:public escript::Abstra Line 326  class MeshAdapter:public escript::Abstra
326       considered as cell centered data.       considered as cell centered data.
327    */    */
328    virtual bool isCellOriented(int functionSpaceCode) const;    virtual bool isCellOriented(int functionSpaceCode) const;
329    
330    /**    /**
331       \brief       \brief
332       saves data arg to an OpenDX input file.       saves data arg to an OpenDX input file.
333       considered as cell centered data.       considered as cell centered data.
334    */    */
335    virtual void saveDX(const std::string& filename,const escript::Data& arg) const;    virtual void saveDX(const std::string& filename,const escript::Data& arg) const;
336    
337    /**    /**
338       \brief       \brief
339       saves data arg to a VTK input file.       saves data arg to a VTK input file.
340       considered as cell centered data.       considered as cell centered data.
341    */    */
342    virtual void saveVTK(const std::string& filename,const escript::Data& arg) const;    virtual void saveVTK(const std::string& filename,const escript::Data& arg) const;
343    
344    /**    /**
345       \brief       \brief
346       returns the function space representation of the type functionSpaceCode on this domain       returns the function space representation of the type functionSpaceCode on this domain
347       as a vtkObject.       as a vtkObject.
348    */    */
349    // vtkObject createVtkObject(int functionSpaceCode) const;    // vtkObject createVtkObject(int functionSpaceCode) const;
350    
351    /**    /**
352       \brief       \brief
353       adds a PDE onto the stiffness matrix mat and a rhs       adds a PDE onto the stiffness matrix mat and a rhs
# Line 328  class MeshAdapter:public escript::Abstra Line 358  class MeshAdapter:public escript::Abstra
358                       const escript::Data& D, const escript::Data& X, const escript::Data& Y,                       const escript::Data& D, const escript::Data& X, const escript::Data& Y,
359                       const escript::Data& d, const escript::Data& y,                       const escript::Data& d, const escript::Data& y,
360                       const escript::Data& d_contact, const escript::Data& y_contact) const;                       const escript::Data& d_contact, const escript::Data& y_contact) const;
361    
362    /**    /**
363       \brief       \brief
364       adds a PDE onto the stiffness matrix mat and a rhs       adds a PDE onto the stiffness matrix mat and a rhs
# Line 335  class MeshAdapter:public escript::Abstra Line 366  class MeshAdapter:public escript::Abstra
366    virtual void addPDEToRHS(escript::Data& rhs,    virtual void addPDEToRHS(escript::Data& rhs,
367                       const escript::Data& X, const escript::Data& Y,                       const escript::Data& X, const escript::Data& Y,
368                       const escript::Data& y, const escript::Data& y_contact) const;                       const escript::Data& y, const escript::Data& y_contact) const;
369    
370    /**    /**
371       \brief       \brief
372      creates a SystemMatrixAdapter stiffness matrix an initializes it with zeros:      creates a SystemMatrixAdapter stiffness matrix an initializes it with zeros:
# Line 350  class MeshAdapter:public escript::Abstra Line 382  class MeshAdapter:public escript::Abstra
382       \brief returns locations in the FEM nodes       \brief returns locations in the FEM nodes
383    */    */
384    virtual escript::Data getX() const;    virtual escript::Data getX() const;
385    
386    /**    /**
387       \brief return boundary normals at the quadrature point on the face elements       \brief return boundary normals at the quadrature point on the face elements
388    */    */
389    virtual escript::Data getNormal() const;    virtual escript::Data getNormal() const;
390    
391    /**    /**
392       \brief returns the element size       \brief returns the element size
393    */    */
394    virtual escript::Data getSize() const;    virtual escript::Data getSize() const;
395    
396      /**
397         \brief comparison operators
398      */
399    virtual bool operator==(const AbstractDomain& other) const;    virtual bool operator==(const AbstractDomain& other) const;
400    virtual bool operator!=(const AbstractDomain& other) const;    virtual bool operator!=(const AbstractDomain& other) const;
401    
402   protected:   protected:
403    
404   private:   private:
405    
406    //    //
407    // pointer to the externally created finley mesh    // pointer to the externally created finley mesh
408    boost::shared_ptr<Finley_Mesh> m_finleyMesh;    boost::shared_ptr<Finley_Mesh> m_finleyMesh;
# Line 374  class MeshAdapter:public escript::Abstra Line 412  class MeshAdapter:public escript::Abstra
412  };  };
413    
414  } // end of namespace  } // end of namespace
415    
416  #endif  #endif

Legend:
Removed from v.123  
changed lines
  Added in v.149

  ViewVC Help
Powered by ViewVC 1.1.26