/[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 682 by robwdcock, Mon Mar 27 02:43:09 2006 UTC revision 1059 by gross, Fri Mar 23 11:01:53 2007 UTC
# Line 13  Line 13 
13                                                                                                                                                        
14  #if !defined finley_MeshAdapter_20040526_H  #if !defined finley_MeshAdapter_20040526_H
15  #define finley_MeshAdapter_20040526_H  #define finley_MeshAdapter_20040526_H
16    #include "system_dep.h"
17    
18  extern "C" {  extern "C" {
19  #include "../Mesh.h"  #include "../Mesh.h"
# Line 74  class MeshAdapter : public escript::Abst Line 75  class MeshAdapter : public escript::Abst
75    static const int ReducedDegreesOfFreedom;    static const int ReducedDegreesOfFreedom;
76    static const int Nodes;    static const int Nodes;
77    static const int Elements;    static const int Elements;
78      static const int ReducedElements;
79    static const int FaceElements;    static const int FaceElements;
80      static const int ReducedFaceElements;
81    static const int Points;    static const int Points;
82    static const int ContactElementsZero;    static const int ContactElementsZero;
83      static const int ReducedContactElementsZero;
84    static const int ContactElementsOne;    static const int ContactElementsOne;
85      static const int ReducedContactElementsOne;
86    
87    /**    /**
88       \brief       \brief
# Line 97  class MeshAdapter : public escript::Abst Line 102  class MeshAdapter : public escript::Abst
102                                 Finley_Mesh_deallocate in the MeshAdapter                                 Finley_Mesh_deallocate in the MeshAdapter
103                                 destructor.                                 destructor.
104    */    */
105      FINLEY_DLL_API
106    MeshAdapter(Finley_Mesh* finleyMesh=0);    MeshAdapter(Finley_Mesh* finleyMesh=0);
107    
108    /**    /**
109       \brief       \brief
110       Copy constructor.       Copy constructor.
111    */    */
112      FINLEY_DLL_API
113    MeshAdapter(const MeshAdapter& in);    MeshAdapter(const MeshAdapter& in);
114    
115    /**    /**
# Line 111  class MeshAdapter : public escript::Abst Line 118  class MeshAdapter : public escript::Abst
118       this calls Finley_Mesh_deallocate for the pointer given to the       this calls Finley_Mesh_deallocate for the pointer given to the
119       constructor.       constructor.
120    */    */
121      FINLEY_DLL_API
122    ~MeshAdapter();    ~MeshAdapter();
123    
124    /**    /**
# Line 136  class MeshAdapter : public escript::Abst Line 144  class MeshAdapter : public escript::Abst
144       Write the current mesh to a file with the given name.       Write the current mesh to a file with the given name.
145       \param fileName Input - The name of the file to write to.       \param fileName Input - The name of the file to write to.
146    */    */
147      FINLEY_DLL_API
148    void write(const std::string& fileName) const;    void write(const std::string& fileName) const;
149    
150    /**    /**
151       \brief       \brief
152       return the pointer to the underlying finley mesh structure       return the pointer to the underlying finley mesh structure
153    */    */
154      FINLEY_DLL_API
155    Finley_Mesh* getFinley_Mesh() const;    Finley_Mesh* getFinley_Mesh() const;
156    
157     /**     /**
# Line 150  class MeshAdapter : public escript::Abst Line 160  class MeshAdapter : public escript::Abst
160       \param functionSpaceType Input - The function space type.       \param functionSpaceType Input - The function space type.
161       \param sampleNo Input - The sample number.       \param sampleNo Input - The sample number.
162    */    */
163      FINLEY_DLL_API
164    int getTagFromSampleNo(int functionSpaceType, int sampleNo) const;    int getTagFromSampleNo(int functionSpaceType, int sampleNo) const;
165    
166    /**    /**
167       \brief       \brief
168       Return the reference number of  the given sample number.       Return the reference number of  the given sample number.
169       \param functionSpaceType Input - The function space type.       \param functionSpaceType Input - The function space type.
      \param sampleNo Input - The sample number.  
170    */    */
171    int getReferenceNoFromSampleNo(int functionSpaceType, int sampleNo) const;    FINLEY_DLL_API
172      int* borrowSampleReferenceIDs(int functionSpaceType) const;
173    
174    /**    /**
175       \brief       \brief
176       Returns true if the given integer is a valid function space type       Returns true if the given integer is a valid function space type
177       for this domain.       for this domain.
178    */    */
179      FINLEY_DLL_API
180    virtual bool isValidFunctionSpaceType(int functionSpaceType) const;    virtual bool isValidFunctionSpaceType(int functionSpaceType) const;
181    
182    /**    /**
183       \brief       \brief
184       Return a description for this domain       Return a description for this domain
185    */    */
186      FINLEY_DLL_API
187    virtual std::string getDescription() const;    virtual std::string getDescription() const;
188    
189    /**    /**
190       \brief       \brief
191       Return a description for the given function space type code       Return a description for the given function space type code
192    */    */
193      FINLEY_DLL_API
194    virtual std::string functionSpaceTypeAsString(int functionSpaceType) const;    virtual std::string functionSpaceTypeAsString(int functionSpaceType) const;
195    
196    /**    /**
197       \brief       \brief
198       Build the table of function space type names       Build the table of function space type names
199    */    */
200      FINLEY_DLL_API
201    void setFunctionSpaceTypeNames();    void setFunctionSpaceTypeNames();
202    
203    /**    /**
204       \brief       \brief
205       Return a continuous FunctionSpace code       Return a continuous FunctionSpace code
206    */    */
207      FINLEY_DLL_API
208    virtual int getContinuousFunctionCode() const;    virtual int getContinuousFunctionCode() const;
209    
210    /**    /**
211       \brief       \brief
212       Return a functon FunctionSpace code       Return a function FunctionSpace code
213    */    */
214      FINLEY_DLL_API
215    virtual int getFunctionCode() const;    virtual int getFunctionCode() const;
216    
217    /**    /**
218       \brief       \brief
219         Return a function with reduced integration order FunctionSpace code
220      */
221      FINLEY_DLL_API
222      virtual int getReducedFunctionCode() const;
223    
224      /**
225         \brief
226       Return a function on boundary FunctionSpace code       Return a function on boundary FunctionSpace code
227    */    */
228      FINLEY_DLL_API
229    virtual int getFunctionOnBoundaryCode() const;    virtual int getFunctionOnBoundaryCode() const;
230    
231    /**    /**
232       \brief       \brief
233         Return a function on boundary with reduced integration order FunctionSpace code
234      */
235      FINLEY_DLL_API
236      virtual int getReducedFunctionOnBoundaryCode() const;
237    
238      /**
239         \brief
240       Return a FunctionOnContactZero code       Return a FunctionOnContactZero code
241    */    */
242      FINLEY_DLL_API
243    virtual int getFunctionOnContactZeroCode() const;    virtual int getFunctionOnContactZeroCode() const;
244    
245    /**    /**
246       \brief       \brief
247         Return a FunctionOnContactZero code  with reduced integration order
248      */
249      FINLEY_DLL_API
250      virtual int getReducedFunctionOnContactZeroCode() const;
251    
252      /**
253         \brief
254       Return a FunctionOnContactOne code       Return a FunctionOnContactOne code
255    */    */
256      FINLEY_DLL_API
257    virtual int getFunctionOnContactOneCode() const;    virtual int getFunctionOnContactOneCode() const;
258    
259    /**    /**
260       \brief       \brief
261         Return a FunctionOnContactOne code  with reduced integration order
262      */
263      FINLEY_DLL_API
264      virtual int getReducedFunctionOnContactOneCode() const;
265    
266      /**
267         \brief
268       Return a Solution code       Return a Solution code
269    */    */
270      FINLEY_DLL_API
271    virtual int getSolutionCode() const;    virtual int getSolutionCode() const;
272    
273    /**    /**
274       \brief       \brief
275       Return a ReducedSolution code       Return a ReducedSolution code
276    */    */
277      FINLEY_DLL_API
278    virtual int getReducedSolutionCode() const;    virtual int getReducedSolutionCode() const;
279    
280    /**    /**
281       \brief       \brief
282       Return a DiracDeltaFunction code       Return a DiracDeltaFunction code
283    */    */
284      FINLEY_DLL_API
285    virtual int getDiracDeltaFunctionCode() const;    virtual int getDiracDeltaFunctionCode() const;
286    
287    /**    /**
288             5B
289       \brief       \brief
290    */    */
291    typedef std::map<int, std::string> FunctionSpaceNamesMapType;    typedef std::map<int, std::string> FunctionSpaceNamesMapType;
# Line 241  class MeshAdapter : public escript::Abst Line 293  class MeshAdapter : public escript::Abst
293    /**    /**
294       \brief       \brief
295    */    */
296      FINLEY_DLL_API
297    virtual int getDim() const;    virtual int getDim() const;
298    
299    /**    /**
# Line 248  class MeshAdapter : public escript::Abst Line 301  class MeshAdapter : public escript::Abst
301       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.
302       \param functionSpaceCode Input -       \param functionSpaceCode Input -
303    */    */
304      FINLEY_DLL_API
305    virtual std::pair<int,int> getDataShape(int functionSpaceCode) const;    virtual std::pair<int,int> getDataShape(int functionSpaceCode) const;
306    
307    /**    /**
# Line 255  class MeshAdapter : public escript::Abst Line 309  class MeshAdapter : public escript::Abst
309       copies the location of data points into arg. The domain of arg has to match this.       copies the location of data points into arg. The domain of arg has to match this.
310       has to be implemented by the actual Domain adapter.       has to be implemented by the actual Domain adapter.
311    */    */
312      FINLEY_DLL_API
313    virtual void setToX(escript::Data& arg) const;    virtual void setToX(escript::Data& arg) const;
314    
315    /**    /**
316       \brief       \brief
317         sets a map from a clear tag name to a tag key
318         \param name Input - tag name.
319         \param tag Input - tag key.
320      */
321      FINLEY_DLL_API
322      virtual void setTagMap(const std::string& name,  int tag);
323    
324      /**
325         \brief
326         Return the tag key for tag name.
327         \param name Input - tag name
328      */
329      FINLEY_DLL_API
330      virtual int getTag(const std::string& name) const;
331    
332      /**
333         \brief
334         Returns true if name is a defined tage name.
335         \param name Input - tag name to be checked.
336      */
337      FINLEY_DLL_API
338      virtual bool isValidTagName(const std::string& name) const;
339    
340      /**
341         \brief
342         Returns all tag names in a single string sperated by commas
343      */
344      FINLEY_DLL_API
345      virtual std::string showTagNames() const;
346    
347      /**
348         \brief
349       assigns new location to the domain       assigns new location to the domain
350    */    */
351      FINLEY_DLL_API
352    virtual void setNewX(const escript::Data& arg);    virtual void setNewX(const escript::Data& arg);
353    
354    /**    /**
355       \brief       \brief
356       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.
357    */    */
358      FINLEY_DLL_API
359    virtual void interpolateOnDomain(escript::Data& target,const escript::Data& source) const;    virtual void interpolateOnDomain(escript::Data& target,const escript::Data& source) const;
360      FINLEY_DLL_API
361    virtual bool probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const;    virtual bool probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const;
362    
363    /**    /**
# Line 275  class MeshAdapter : public escript::Abst Line 365  class MeshAdapter : public escript::Abst
365       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.
366       has to be implemented by the actual Domain adapter.       has to be implemented by the actual Domain adapter.
367    */    */
368      FINLEY_DLL_API
369    virtual void interpolateACross(escript::Data& target, const escript::Data& source) const;    virtual void interpolateACross(escript::Data& target, const escript::Data& source) const;
370      FINLEY_DLL_API
371    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;
372    
373    /**    /**
# Line 283  class MeshAdapter : public escript::Abst Line 375  class MeshAdapter : public escript::Abst
375       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
376       is defined by out. out has to be defined on this.       is defined by out. out has to be defined on this.
377    */    */
378      FINLEY_DLL_API
379    virtual void setToNormal(escript::Data& out) const;    virtual void setToNormal(escript::Data& out) const;
380    
381    /**    /**
# Line 290  class MeshAdapter : public escript::Abst Line 383  class MeshAdapter : public escript::Abst
383       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
384       is defined by out. out has to be defined on this.       is defined by out. out has to be defined on this.
385    */    */
386      FINLEY_DLL_API
387    virtual void setToSize(escript::Data& out) const;    virtual void setToSize(escript::Data& out) const;
388    
389    /**    /**
# Line 297  class MeshAdapter : public escript::Abst Line 391  class MeshAdapter : public escript::Abst
391       copies the gradient of arg into grad. The actual function space to be considered       copies the gradient of arg into grad. The actual function space to be considered
392       for the gradient is defined by grad. arg and grad have to be defined on this.       for the gradient is defined by grad. arg and grad have to be defined on this.
393    */    */
394      FINLEY_DLL_API
395    virtual void setToGradient(escript::Data& grad,const escript::Data& arg) const;    virtual void setToGradient(escript::Data& grad,const escript::Data& arg) const;
396    
397    /**    /**
# Line 304  class MeshAdapter : public escript::Abst Line 399  class MeshAdapter : public escript::Abst
399       copies the integrals of the function defined by arg into integrals.       copies the integrals of the function defined by arg into integrals.
400       arg has to be defined on this.       arg has to be defined on this.
401    */    */
402      FINLEY_DLL_API
403    virtual void setToIntegrals(std::vector<double>& integrals,const escript::Data& arg) const;    virtual void setToIntegrals(std::vector<double>& integrals,const escript::Data& arg) const;
404    
405    /**    /**
# Line 313  class MeshAdapter : public escript::Abst Line 409  class MeshAdapter : public escript::Abst
409       \param solver       \param solver
410       \param symmetry       \param symmetry
411    */    */
412      FINLEY_DLL_API
413    virtual int getSystemMatrixTypeId(const int solver, const int package, const bool symmetry) const;    virtual int getSystemMatrixTypeId(const int solver, const int package, const bool symmetry) const;
414    
415    /**    /**
# Line 320  class MeshAdapter : public escript::Abst Line 417  class MeshAdapter : public escript::Abst
417       returns true if data on this domain and a function space of type functionSpaceCode has to       returns true if data on this domain and a function space of type functionSpaceCode has to
418       considered as cell centered data.       considered as cell centered data.
419    */    */
420      FINLEY_DLL_API
421    virtual bool isCellOriented(int functionSpaceCode) const;    virtual bool isCellOriented(int functionSpaceCode) const;
422    
423    /**    /**
# Line 328  class MeshAdapter : public escript::Abst Line 426  class MeshAdapter : public escript::Abst
426                                                                                                                                                                                                                                                                                                                                                    
427       This has to be implemented by the actual Domain adapter.       This has to be implemented by the actual Domain adapter.
428    */    */
429      FINLEY_DLL_API
430    virtual void saveDX(const std::string& filename,const boost::python::dict& arg) const;    virtual void saveDX(const std::string& filename,const boost::python::dict& arg) const;
431    
432    
# Line 337  class MeshAdapter : public escript::Abst Line 436  class MeshAdapter : public escript::Abst
436                                                                                                                                                                                                                                                                                                                                                    
437       This has to be implemented by the actual Domain adapter.       This has to be implemented by the actual Domain adapter.
438    */    */
439      FINLEY_DLL_API
440    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;
441    
442    /**    /**
# Line 350  class MeshAdapter : public escript::Abst Line 450  class MeshAdapter : public escript::Abst
450       \brief       \brief
451       adds a PDE onto the stiffness matrix mat and a rhs       adds a PDE onto the stiffness matrix mat and a rhs
452    */    */
453      FINLEY_DLL_API
454    virtual void addPDEToSystem(    virtual void addPDEToSystem(
455                       SystemMatrixAdapter& mat, escript::Data& rhs,                       SystemMatrixAdapter& mat, escript::Data& rhs,
456                       const escript::Data& A, const escript::Data& B, const escript::Data& C,                       const escript::Data& A, const escript::Data& B, const escript::Data& C,
# Line 361  class MeshAdapter : public escript::Abst Line 462  class MeshAdapter : public escript::Abst
462       \brief       \brief
463       adds a PDE onto the stiffness matrix mat and a rhs       adds a PDE onto the stiffness matrix mat and a rhs
464    */    */
465      FINLEY_DLL_API
466    virtual void addPDEToRHS(escript::Data& rhs,    virtual void addPDEToRHS(escript::Data& rhs,
467                       const escript::Data& X, const escript::Data& Y,                       const escript::Data& X, const escript::Data& Y,
468                       const escript::Data& y, const escript::Data& y_contact) const;                       const escript::Data& y, const escript::Data& y_contact) const;
# Line 369  class MeshAdapter : public escript::Abst Line 471  class MeshAdapter : public escript::Abst
471       \brief       \brief
472      creates a SystemMatrixAdapter stiffness matrix an initializes it with zeros:      creates a SystemMatrixAdapter stiffness matrix an initializes it with zeros:
473    */    */
474      FINLEY_DLL_API
475    SystemMatrixAdapter newSystemMatrix(    SystemMatrixAdapter newSystemMatrix(
476                        const int row_blocksize,                        const int row_blocksize,
477                        const escript::FunctionSpace& row_functionspace,                        const escript::FunctionSpace& row_functionspace,
# Line 379  class MeshAdapter : public escript::Abst Line 482  class MeshAdapter : public escript::Abst
482    /**    /**
483       \brief returns locations in the FEM nodes       \brief returns locations in the FEM nodes
484    */    */
485      FINLEY_DLL_API
486    virtual escript::Data getX() const;    virtual escript::Data getX() const;
487    
488    /**    /**
489       \brief return boundary normals at the quadrature point on the face elements       \brief return boundary normals at the quadrature point on the face elements
490    */    */
491      FINLEY_DLL_API
492    virtual escript::Data getNormal() const;    virtual escript::Data getNormal() const;
493    
494    /**    /**
495       \brief returns the element size       \brief returns the element size
496    */    */
497      FINLEY_DLL_API
498    virtual escript::Data getSize() const;    virtual escript::Data getSize() const;
499    
500    /**    /**
501       \brief comparison operators       \brief comparison operators
502    */    */
503      FINLEY_DLL_API
504    virtual bool operator==(const AbstractDomain& other) const;    virtual bool operator==(const AbstractDomain& other) const;
505      FINLEY_DLL_API
506    virtual bool operator!=(const AbstractDomain& other) const;    virtual bool operator!=(const AbstractDomain& other) const;
507    
508      /**
509         \brief assigns new tag newTag to all samples of functionspace with a positive
510         value of mask for any its sample point.
511    
512      */
513      FINLEY_DLL_API
514      virtual void setTags(const int functionSpaceType, const int newTag, const escript::Data& mask) const;
515    
516   protected:   protected:
517    
518   private:   private:

Legend:
Removed from v.682  
changed lines
  Added in v.1059

  ViewVC Help
Powered by ViewVC 1.1.26