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

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

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

trunk/esys2/finley/src/CPPAdapter/MeshAdapter.h revision 121 by jgs, Fri May 6 04:26:16 2005 UTC trunk/finley/src/finley/CPPAdapter/MeshAdapter.h revision 201 by jgs, Wed Nov 23 04:10:21 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 <boost/python/dict.hpp>
30  #include <map>  #include <map>
31  #include <vector>  #include <vector>
32  #include <string>  #include <string>
33    
34  namespace finley {  namespace finley {
35    
36    struct null_deleter
37    {
38      void operator()(void const *ptr) const
39      {
40      }
41    };
42    
43    
44  /**  /**
45     \brief     \brief
46     MeshAdapter implements the AbstractContinuousDomain     MeshAdapter implements the AbstractContinuousDomain
# Line 75  class MeshAdapter:public escript::Abstra Line 85  class MeshAdapter:public escript::Abstra
85                                 destructor.                                 destructor.
86    */    */
87    MeshAdapter(Finley_Mesh* finleyMesh=0);    MeshAdapter(Finley_Mesh* finleyMesh=0);
88    
89    /**    /**
90       \brief       \brief
91       Copy constructor.       Copy constructor.
92    */    */
93    MeshAdapter(const MeshAdapter& in);    MeshAdapter(const MeshAdapter& in);
94    
95    /**    /**
96       \brief       \brief
97       Destructor for MeshAdapter. As specified in the constructor       Destructor for MeshAdapter. As specified in the constructor
98       this calls  Finley_Mesh_deallocate for the pointer given to the       this calls Finley_Mesh_deallocate for the pointer given to the
99       constructor.       constructor.
100    */    */
101    ~MeshAdapter();    ~MeshAdapter();
102    
103    /**    /**
104       \brief       \brief
105       return this as an AbstractContinuousDomain.       return this as an AbstractContinuousDomain.
# Line 104  class MeshAdapter:public escript::Abstra Line 117  class MeshAdapter:public escript::Abstra
117    {    {
118       return *(static_cast<const AbstractDomain*>(this));       return *(static_cast<const AbstractDomain*>(this));
119    }    }
120    
121    /**    /**
122       \brief       \brief
123       Write the current mesh to a file with the given name.       Write the current mesh to a file with the given name.
124       \param fileName Input - The name of the file to write to.       \param fileName Input - The name of the file to write to.
125    */    */
126    void write(const std::string& fileName) const;    void write(const std::string& fileName) const;
127    
128    /**    /**
129       \brief       \brief
130       return the pointer of the underlying finley mesh structure       return the pointer to the underlying finley mesh structure
131    */    */
132    Finley_Mesh* getFinley_Mesh() const;    Finley_Mesh* getFinley_Mesh() const;
133    
134    /**    /**
135       \brief       \brief
136       Return the tag list indexed by sampleNo.       Return the tag list indexed by sampleNo.
# Line 122  class MeshAdapter:public escript::Abstra Line 138  class MeshAdapter:public escript::Abstra
138       \param tagList Output       \param tagList Output
139       \param numTags Output       \param numTags Output
140    */    */
   
141    void getTagList(int functionSpaceType, int** tagList,    void getTagList(int functionSpaceType, int** tagList,
142                     int* numTags) const;                     int* numTags) const;
143    /**    /**
# Line 142  class MeshAdapter:public escript::Abstra Line 157  class MeshAdapter:public escript::Abstra
157       \param sampleNo Input - The sample number.       \param sampleNo Input - The sample number.
158    */    */
159    int getTagFromSampleNo(int functionSpaceType, int sampleNo) const;    int getTagFromSampleNo(int functionSpaceType, int sampleNo) const;
160    
161    /**    /**
162       \brief       \brief
163       Return the reference number of  the given sample number.       Return the reference number of  the given sample number.
# Line 156  class MeshAdapter:public escript::Abstra Line 172  class MeshAdapter:public escript::Abstra
172       for this domain.       for this domain.
173    */    */
174    virtual bool isValidFunctionSpaceType(int functionSpaceType) const;    virtual bool isValidFunctionSpaceType(int functionSpaceType) const;
175    
176    /**    /**
177       \brief       \brief
178       Return a description for this domain       Return a description for this domain
179    */    */
180    virtual std::string getDescription() const;    virtual std::string getDescription() const;
181    
182    /**    /**
183       \brief       \brief
184       Return a description for the given function space type code       Return a description for the given function space type code
# Line 172  class MeshAdapter:public escript::Abstra Line 190  class MeshAdapter:public escript::Abstra
190       Build the table of function space type names       Build the table of function space type names
191    */    */
192    void setFunctionSpaceTypeNames();    void setFunctionSpaceTypeNames();
193    
194    /**    /**
195       \brief       \brief
196       Return a continuous FunctionSpace code       Return a continuous FunctionSpace code
197    */    */
198    virtual int getContinuousFunctionCode() const;    virtual int getContinuousFunctionCode() const;
199    
200    /**    /**
201       \brief       \brief
202       Return a functon FunctionSpace code       Return a functon FunctionSpace code
203    */    */
204    virtual int getFunctionCode() const;    virtual int getFunctionCode() const;
205    
206    /**    /**
207       \brief       \brief
208       Return a function on boundary FunctionSpace code       Return a function on boundary FunctionSpace code
209    */    */
210    virtual int getFunctionOnBoundaryCode() const;    virtual int getFunctionOnBoundaryCode() const;
211    
212    /**    /**
213       \brief       \brief
214       Return a FunctionOnContactZero code       Return a FunctionOnContactZero code
215    */    */
216    virtual int getFunctionOnContactZeroCode() const;    virtual int getFunctionOnContactZeroCode() const;
217    
218    /**    /**
219       \brief       \brief
220       Return a FunctionOnContactOne code       Return a FunctionOnContactOne code
221    */    */
222    virtual int getFunctionOnContactOneCode() const;    virtual int getFunctionOnContactOneCode() const;
223    
224    /**    /**
225       \brief       \brief
226       Return a Solution code       Return a Solution code
227    */    */
228    virtual int getSolutionCode() const;    virtual int getSolutionCode() const;
229    
230    /**    /**
231       \brief       \brief
232       Return a ReducedSolution code       Return a ReducedSolution code
233    */    */
234    virtual int getReducedSolutionCode() const;    virtual int getReducedSolutionCode() const;
235    
236    /**    /**
237       \brief       \brief
238       Return a DiracDeltaFunction code       Return a DiracDeltaFunction code
239    */    */
240    virtual int getDiracDeltaFunctionCode() const;    virtual int getDiracDeltaFunctionCode() const;
241    //  
242    //    /**
243         \brief
244      */
245    typedef std::map<int, std::string> FunctionSpaceNamesMapType;    typedef std::map<int, std::string> FunctionSpaceNamesMapType;
246    
247    /**    /**
248       \brief       \brief
249    */    */
250    virtual int getDim() const;    virtual int getDim() const;
251   /**  
252      /**
253       \brief       \brief
254       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.
255       \param functionSpaceCode Input -       \param functionSpaceCode Input -
# Line 232  class MeshAdapter:public escript::Abstra Line 262  class MeshAdapter:public escript::Abstra
262       has to be implemented by the actual Domain adapter.       has to be implemented by the actual Domain adapter.
263    */    */
264    virtual void setToX(escript::Data& arg) const;    virtual void setToX(escript::Data& arg) const;
265    
266    /**    /**
267       \brief       \brief
268       assigns new location to the domain       assigns new location to the domain
269    */    */
270    virtual void setNewX(const escript::Data& arg);    virtual void setNewX(const escript::Data& arg);
271    
272    /**    /**
273       \brief       \brief
274       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.
275    */    */
276    virtual void interpolateOnDomain(escript::Data& target,const escript::Data& source) const;    virtual void interpolateOnDomain(escript::Data& target,const escript::Data& source) const;
277    virtual bool probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const;    virtual bool probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const;
278    
279    /**    /**
280       \brief       \brief
281       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 250  class MeshAdapter:public escript::Abstra Line 283  class MeshAdapter:public escript::Abstra
283    */    */
284    virtual void interpolateACross(escript::Data& target, const escript::Data& source) const;    virtual void interpolateACross(escript::Data& target, const escript::Data& source) const;
285    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;
286    
287    /**    /**
288       \brief       \brief
289       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
290       is defined by out. out has to be defined on this.       is defined by out. out has to be defined on this.
291    */    */
292    virtual void setToNormal(escript::Data& out) const;    virtual void setToNormal(escript::Data& out) const;
293    
294    /**    /**
295       \brief       \brief
296       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 277  class MeshAdapter:public escript::Abstra Line 312  class MeshAdapter:public escript::Abstra
312    */    */
313    virtual void setToIntegrals(std::vector<double>& integrals,const escript::Data& arg) const;    virtual void setToIntegrals(std::vector<double>& integrals,const escript::Data& arg) const;
314    
315   /**    /**
316       \brief       \brief
317       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, package
318       and symmetric matrix is used.       and symmetric matrix is used.
319       \param solver       \param solver
320       \param symmetry       \param symmetry
321    */    */
322    virtual int getSystemMatrixTypeId(const int solver, const bool symmetry) const;    virtual int getSystemMatrixTypeId(const int solver, const int package, const bool symmetry) const;
323    
324    /**    /**
325       \brief       \brief
# Line 292  class MeshAdapter:public escript::Abstra Line 327  class MeshAdapter:public escript::Abstra
327       considered as cell centered data.       considered as cell centered data.
328    */    */
329    virtual bool isCellOriented(int functionSpaceCode) const;    virtual bool isCellOriented(int functionSpaceCode) const;
330    
331    /**    /**
332       \brief       \brief
333       saves data arg to an OpenDX input file.       Saves a dictonary of Data objects to an OpenDX input file. The keywords are used as identifier
334       considered as cell centered data.                                                                                                                                                                          
335         This has to be implemented by the actual Domain adapter.
336    */    */
337    virtual void saveDX(const std::string& filename,const escript::Data& arg) const;    virtual void saveDX(const std::string& filename,const boost::python::dict& arg) const;
338    
339    
340    /**    /**
341       \brief       \brief
342       saves data arg to a VTK input file.       Saves a dictonary of Data objects to an VTK XML input file. The keywords are used as identifier
343       considered as cell centered data.                                                                                                                                                                          
344         This has to be implemented by the actual Domain adapter.
345    */    */
346    virtual void saveVTK(const std::string& filename,const escript::Data& arg) const;    virtual void saveVTK(const std::string& filename,const boost::python::dict& arg) const;
347    
348    /**    /**
349       \brief       \brief
350       returns the function space representation of the type functionSpaceCode on this domain       returns the function space representation of the type functionSpaceCode on this domain
351       as a vtkObject.       as a vtkObject.
352    */    */
353    // vtkObject createVtkObject(int functionSpaceCode) const;    // vtkObject createVtkObject(int functionSpaceCode) const;
354    
355    /**    /**
356       \brief       \brief
357       adds a PDE onto the stiffness matrix mat and a rhs       adds a PDE onto the stiffness matrix mat and a rhs
# Line 320  class MeshAdapter:public escript::Abstra Line 362  class MeshAdapter:public escript::Abstra
362                       const escript::Data& D, const escript::Data& X, const escript::Data& Y,                       const escript::Data& D, const escript::Data& X, const escript::Data& Y,
363                       const escript::Data& d, const escript::Data& y,                       const escript::Data& d, const escript::Data& y,
364                       const escript::Data& d_contact, const escript::Data& y_contact) const;                       const escript::Data& d_contact, const escript::Data& y_contact) const;
365    
366    /**    /**
367       \brief       \brief
368       adds a PDE onto the stiffness matrix mat and a rhs       adds a PDE onto the stiffness matrix mat and a rhs
# Line 327  class MeshAdapter:public escript::Abstra Line 370  class MeshAdapter:public escript::Abstra
370    virtual void addPDEToRHS(escript::Data& rhs,    virtual void addPDEToRHS(escript::Data& rhs,
371                       const escript::Data& X, const escript::Data& Y,                       const escript::Data& X, const escript::Data& Y,
372                       const escript::Data& y, const escript::Data& y_contact) const;                       const escript::Data& y, const escript::Data& y_contact) const;
373    
374    /**    /**
375       \brief       \brief
376      creates a SystemMatrixAdapter stiffness matrix an initializes it with zeros:      creates a SystemMatrixAdapter stiffness matrix an initializes it with zeros:
# Line 342  class MeshAdapter:public escript::Abstra Line 386  class MeshAdapter:public escript::Abstra
386       \brief returns locations in the FEM nodes       \brief returns locations in the FEM nodes
387    */    */
388    virtual escript::Data getX() const;    virtual escript::Data getX() const;
389    
390    /**    /**
391       \brief return boundary normals at the quadrature point on the face elements       \brief return boundary normals at the quadrature point on the face elements
392    */    */
393    virtual escript::Data getNormal() const;    virtual escript::Data getNormal() const;
394    
395    /**    /**
396       \brief returns the element size       \brief returns the element size
397    */    */
398    virtual escript::Data getSize() const;    virtual escript::Data getSize() const;
399    
400      /**
401         \brief comparison operators
402      */
403    virtual bool operator==(const AbstractDomain& other) const;    virtual bool operator==(const AbstractDomain& other) const;
404    virtual bool operator!=(const AbstractDomain& other) const;    virtual bool operator!=(const AbstractDomain& other) const;
405    
406   protected:   protected:
407    
408   private:   private:
409    
410    //    //
411    // pointer to the externally created finley mesh    // pointer to the externally created finley mesh
412    boost::shared_ptr<Finley_Mesh> m_finleyMesh;    boost::shared_ptr<Finley_Mesh> m_finleyMesh;
# Line 366  class MeshAdapter:public escript::Abstra Line 416  class MeshAdapter:public escript::Abstra
416  };  };
417    
418  } // end of namespace  } // end of namespace
419    
420  #endif  #endif

Legend:
Removed from v.121  
changed lines
  Added in v.201

  ViewVC Help
Powered by ViewVC 1.1.26