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

trunk/esys2/finley/src/CPPAdapter/MeshAdapter.h revision 110 by jgs, Mon Feb 14 04:14:42 2005 UTC trunk/finley/src/CPPAdapter/MeshAdapter.h revision 3259 by jfenwick, Mon Oct 11 01:48:14 2010 UTC
# Line 1  Line 1 
1  // $Id$  
2  /*  /*******************************************************
3   ******************************************************************************  *
4   *                                                                            *  * Copyright (c) 2003-2010 by University of Queensland
5   *       COPYRIGHT  ACcESS 2004 -  All Rights Reserved                        *  * Earth Systems Science Computational Center (ESSCC)
6   *                                                                            *  * http://www.uq.edu.au/esscc
7   * This software is the property of ACcESS. No part of this code              *  *
8   * may be copied in any form or by any means without the expressed written    *  * Primary Business: Queensland, Australia
9   * consent of ACcESS.  Copying, use or modification of this software          *  * Licensed under the Open Software License version 3.0
10   * by any unauthorised person is illegal unless that person has a software    *  * http://www.opensource.org/licenses/osl-3.0.php
11   * license agreement with ACcESS.                                             *  *
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
17    #include "system_dep.h"
18    
 #include "escript/Data/AbstractContinuousDomain.h"  
 #include "escript/Data/Data.h"  
 #include "escript/Data/FunctionSpace.h"  
19  extern "C" {  extern "C" {
20  #include "finley/finleyC/Mesh.h"  #include "finley/Mesh.h"
21    #include "finley/Finley.h"
22    #include "finley/Assemble.h"
23    #include "paso/SystemMatrix.h"
24    #include "paso/Transport.h"
25    #include "esysUtils/Esys_MPI.h"
26  }  }
27  #include "finley/CPPAdapter/SystemMatrixAdapter.h"  
28    #include "FinleyError.h"
29    #include "FinleyAdapterException.h"
30    
31    #include "SystemMatrixAdapter.h"
32    #include "TransportProblemAdapter.h"
33    #include "escript/AbstractContinuousDomain.h"
34    #include "escript/FunctionSpace.h"
35    #include "escript/FunctionSpaceFactory.h"
36    
37  #include <boost/shared_ptr.hpp>  #include <boost/shared_ptr.hpp>
38  #include <boost/python/object.hpp>  #include <boost/python/dict.hpp>
39    #include <boost/python/extract.hpp>
40    
41  #include <map>  #include <map>
42  #include <vector>  #include <vector>
43  #include <string>  #include <string>
44    #include <sstream>
45    
46  namespace finley {  namespace finley {
47    
48    struct null_deleter
49    {
50      void operator()(void const *ptr) const
51      {
52      }
53    };
54    
55    
56  /**  /**
57     \brief     \brief
58     MeshAdapter implements the AbstractContinuousDomain     MeshAdapter implements the AbstractContinuousDomain
# Line 41  namespace finley { Line 63  namespace finley {
63     interface for the Finley library.     interface for the Finley library.
64  */  */
65    
66  class MeshAdapter:public escript::AbstractContinuousDomain {  class MeshAdapter : public escript::AbstractContinuousDomain {
67    
68   public:   public:
69    
# Line 50  class MeshAdapter:public escript::Abstra Line 72  class MeshAdapter:public escript::Abstra
72    static const int DegreesOfFreedom;    static const int DegreesOfFreedom;
73    static const int ReducedDegreesOfFreedom;    static const int ReducedDegreesOfFreedom;
74    static const int Nodes;    static const int Nodes;
75      static const int ReducedNodes;
76    static const int Elements;    static const int Elements;
77      static const int ReducedElements;
78    static const int FaceElements;    static const int FaceElements;
79      static const int ReducedFaceElements;
80    static const int Points;    static const int Points;
81    static const int ContactElementsZero;    static const int ContactElementsZero;
82      static const int ReducedContactElementsZero;
83    static const int ContactElementsOne;    static const int ContactElementsOne;
84      static const int ReducedContactElementsOne;
85    
86    /**    /**
87       \brief       \brief
# Line 62  class MeshAdapter:public escript::Abstra Line 89  class MeshAdapter:public escript::Abstra
89    
90       Description:       Description:
91       Constructor for MeshAdapter. The pointer passed to MeshAdapter       Constructor for MeshAdapter. The pointer passed to MeshAdapter
92       is deleted using a call to Finley_Mesh_deallocate in the       is deleted using a call to Finley_Mesh_free in the
93       MeshAdapter destructor.       MeshAdapter destructor.
94    
95       Throws:       Throws:
# Line 71  class MeshAdapter:public escript::Abstra Line 98  class MeshAdapter:public escript::Abstra
98       \param finleyMesh Input - A pointer to the externally constructed       \param finleyMesh Input - A pointer to the externally constructed
99                                 finley mesh.The pointer passed to MeshAdapter                                 finley mesh.The pointer passed to MeshAdapter
100                                 is deleted using a call to                                 is deleted using a call to
101                                 Finley_Mesh_deallocate in the MeshAdapter                                 Finley_Mesh_free in the MeshAdapter
102                                 destructor.                                 destructor.
103    */    */
104      FINLEY_DLL_API
105    MeshAdapter(Finley_Mesh* finleyMesh=0);    MeshAdapter(Finley_Mesh* finleyMesh=0);
106    
107    /**    /**
108       \brief       \brief
109       Copy constructor.       Copy constructor.
110    */    */
111      FINLEY_DLL_API
112    MeshAdapter(const MeshAdapter& in);    MeshAdapter(const MeshAdapter& in);
113    
114    /**    /**
115       \brief       \brief
116       Destructor for MeshAdapter. As specified in the constructor       Destructor for MeshAdapter. As specified in the constructor
117       this calls  Finley_Mesh_deallocate for the pointer given to the       this calls Finley_Mesh_free for the pointer given to the
118       constructor.       constructor.
119    */    */
120      FINLEY_DLL_API
121    ~MeshAdapter();    ~MeshAdapter();
122    
123    /**    /**
124       \brief       \brief
125       return this as an AbstractContinuousDomain.       return the number of processors used for this domain
126      */
127      FINLEY_DLL_API
128      virtual int getMPISize() const;
129      /**
130         \brief
131         return the number MPI rank of this processor
132    */    */
133    inline const AbstractContinuousDomain& asAbstractContinuousDomain() const  
134    {    FINLEY_DLL_API
135       return *(static_cast<const AbstractContinuousDomain*>(this));    virtual int getMPIRank() const;
   }  
136    
137    /**    /**
138       \brief       \brief
139       return this as an AbstractDomain.       If compiled for MPI then execute an MPI_Barrier, else do nothing
140    */    */
141    inline const AbstractDomain& asAbstractDomain() const  
142    {    FINLEY_DLL_API
143       return *(static_cast<const AbstractDomain*>(this));    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 ESYS_MPI
155      MPI_Comm
156    #else
157      unsigned int
158    #endif
159      getMPIComm() const;
160    
161    /**    /**
162       \brief       \brief
163       Write the current mesh to a file with the given name.       Write the current mesh to a file with the given name.
164       \param fileName Input - The name of the file to write to.       \param fileName Input - The name of the file to write to.
165    */    */
166      FINLEY_DLL_API
167    void write(const std::string& fileName) const;    void write(const std::string& fileName) const;
168    
169    /**    /**
170       \brief       \brief
171       return the pointer of the underlying finley mesh structure       \param full
172    */    */
173    Finley_Mesh* getFinley_Mesh() const;    FINLEY_DLL_API
174      void Print_Mesh_Info(const bool full=false) const;
175    
176    /**    /**
177       \brief       \brief
178       Return the tag list indexed by sampleNo.       dumps the mesh to a file with the given name.
179       \param functionSpaceType Input       \param fileName Input - The name of the file
      \param tagList Output  
      \param numTags Output  
180    */    */
181      FINLEY_DLL_API
182      void dump(const std::string& fileName) const;
183    
   void getTagList(int functionSpaceType, int** tagList,  
                    int* numTags) const;  
184    /**    /**
185       \brief       \brief
186       Return the reference number list indexed by sampleNo.       return the pointer to the underlying finley mesh structure
      \param functionSpaceType Input  
      \param referenceNoList Output  
      \param numReferenceNo Output  
187    */    */
188    void getReferenceNoList(int functionSpaceType, int** referenceNoList,    FINLEY_DLL_API
189                     int* numReferenceNo) const;    Finley_Mesh* getFinley_Mesh() const;
190    
191     /**     /**
192       \brief       \brief
# Line 141  class MeshAdapter:public escript::Abstra Line 194  class MeshAdapter:public escript::Abstra
194       \param functionSpaceType Input - The function space type.       \param functionSpaceType Input - The function space type.
195       \param sampleNo Input - The sample number.       \param sampleNo Input - The sample number.
196    */    */
197      FINLEY_DLL_API
198    int getTagFromSampleNo(int functionSpaceType, int sampleNo) const;    int getTagFromSampleNo(int functionSpaceType, int sampleNo) const;
199    
200    /**    /**
201       \brief       \brief
202       Return the reference number of  the given sample number.       Return the reference number of  the given sample number.
203       \param functionSpaceType Input - The function space type.       \param functionSpaceType Input - The function space type.
      \param sampleNo Input - The sample number.  
204    */    */
205    int getReferenceNoFromSampleNo(int functionSpaceType, int sampleNo) const;    FINLEY_DLL_API
206      const int* borrowSampleReferenceIDs(int functionSpaceType) const;
207    
208    /**    /**
209       \brief       \brief
210       Returns true if the given integer is a valid function space type       Returns true if the given integer is a valid function space type
211       for this domain.       for this domain.
212    */    */
213      FINLEY_DLL_API
214    virtual bool isValidFunctionSpaceType(int functionSpaceType) const;    virtual bool isValidFunctionSpaceType(int functionSpaceType) const;
215    
216    /**    /**
217       \brief       \brief
218       Return a description for this domain       Return a description for this domain
219    */    */
220      FINLEY_DLL_API
221    virtual std::string getDescription() const;    virtual std::string getDescription() const;
222    
223    /**    /**
224       \brief       \brief
225       Return a description for the given function space type code       Return a description for the given function space type code
226    */    */
227      FINLEY_DLL_API
228    virtual std::string functionSpaceTypeAsString(int functionSpaceType) const;    virtual std::string functionSpaceTypeAsString(int functionSpaceType) const;
229    
230    /**    /**
231       \brief       \brief
232       Build the table of function space type names       Build the table of function space type names
233    */    */
234      FINLEY_DLL_API
235    void setFunctionSpaceTypeNames();    void setFunctionSpaceTypeNames();
236    
237    /**    /**
238       \brief       \brief
239       Return a continuous FunctionSpace code       Return a continuous FunctionSpace code
240    */    */
241      FINLEY_DLL_API
242    virtual int getContinuousFunctionCode() const;    virtual int getContinuousFunctionCode() const;
243    
244      /**
245         \brief
246         Return a continuous on reduced order nodes FunctionSpace code
247      */
248      FINLEY_DLL_API
249      virtual int getReducedContinuousFunctionCode() const;
250    
251    /**    /**
252       \brief       \brief
253       Return a functon FunctionSpace code       Return a function FunctionSpace code
254    */    */
255      FINLEY_DLL_API
256    virtual int getFunctionCode() const;    virtual int getFunctionCode() const;
257    
258      /**
259         \brief
260         Return a function with reduced integration order FunctionSpace code
261      */
262      FINLEY_DLL_API
263      virtual int getReducedFunctionCode() const;
264    
265    /**    /**
266       \brief       \brief
267       Return a function on boundary FunctionSpace code       Return a function on boundary FunctionSpace code
268    */    */
269      FINLEY_DLL_API
270    virtual int getFunctionOnBoundaryCode() const;    virtual int getFunctionOnBoundaryCode() const;
271    
272      /**
273         \brief
274         Return a function on boundary with reduced integration order FunctionSpace code
275      */
276      FINLEY_DLL_API
277      virtual int getReducedFunctionOnBoundaryCode() const;
278    
279    /**    /**
280       \brief       \brief
281       Return a FunctionOnContactZero code       Return a FunctionOnContactZero code
282    */    */
283      FINLEY_DLL_API
284    virtual int getFunctionOnContactZeroCode() const;    virtual int getFunctionOnContactZeroCode() const;
285    
286      /**
287         \brief
288         Return a FunctionOnContactZero code  with reduced integration order
289      */
290      FINLEY_DLL_API
291      virtual int getReducedFunctionOnContactZeroCode() const;
292    
293    /**    /**
294       \brief       \brief
295       Return a FunctionOnContactOne code       Return a FunctionOnContactOne code
296    */    */
297      FINLEY_DLL_API
298    virtual int getFunctionOnContactOneCode() const;    virtual int getFunctionOnContactOneCode() const;
299    
300      /**
301         \brief
302         Return a FunctionOnContactOne code  with reduced integration order
303      */
304      FINLEY_DLL_API
305      virtual int getReducedFunctionOnContactOneCode() const;
306    
307    /**    /**
308       \brief       \brief
309       Return a Solution code       Return a Solution code
310    */    */
311      FINLEY_DLL_API
312    virtual int getSolutionCode() const;    virtual int getSolutionCode() const;
313    
314    /**    /**
315       \brief       \brief
316       Return a ReducedSolution code       Return a ReducedSolution code
317    */    */
318      FINLEY_DLL_API
319    virtual int getReducedSolutionCode() const;    virtual int getReducedSolutionCode() const;
320    
321    /**    /**
322       \brief       \brief
323       Return a DiracDeltaFunction code       Return a DiracDeltaFunction code
324    */    */
325      FINLEY_DLL_API
326    virtual int getDiracDeltaFunctionCode() const;    virtual int getDiracDeltaFunctionCode() const;
327    //  
328    //    /**
329             5B
330         \brief
331      */
332    typedef std::map<int, std::string> FunctionSpaceNamesMapType;    typedef std::map<int, std::string> FunctionSpaceNamesMapType;
333    
334    /**    /**
335       \brief       \brief
336    */    */
337      FINLEY_DLL_API
338    virtual int getDim() const;    virtual int getDim() const;
339   /**  
340      /**
341         \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
355      */
356      FINLEY_DLL_API
357      virtual int getNumDataPointsGlobal() const;
358    
359      /**
360       \brief       \brief
361       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.
362       \param functionSpace Input -       \param functionSpaceCode Input -
363    */    */
364      FINLEY_DLL_API
365    virtual std::pair<int,int> getDataShape(int functionSpaceCode) const;    virtual std::pair<int,int> getDataShape(int functionSpaceCode) const;
366    
367    /**    /**
# Line 231  class MeshAdapter:public escript::Abstra Line 369  class MeshAdapter:public escript::Abstra
369       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.
370       has to be implemented by the actual Domain adapter.       has to be implemented by the actual Domain adapter.
371    */    */
372      FINLEY_DLL_API
373    virtual void setToX(escript::Data& arg) const;    virtual void setToX(escript::Data& arg) const;
374    
375      /**
376         \brief
377         sets a map from a clear tag name to a tag key
378         \param name Input - tag name.
379         \param tag Input - tag key.
380      */
381      FINLEY_DLL_API
382      virtual void setTagMap(const std::string& name,  int tag);
383    
384      /**
385         \brief
386         Return the tag key for tag name.
387         \param name Input - tag name
388      */
389      FINLEY_DLL_API
390      virtual int getTag(const std::string& name) const;
391    
392      /**
393         \brief
394         Returns true if name is a defined tage name.
395         \param name Input - tag name to be checked.
396      */
397      FINLEY_DLL_API
398      virtual bool isValidTagName(const std::string& name) const;
399    
400      /**
401         \brief
402         Returns all tag names in a single string sperated by commas
403      */
404      FINLEY_DLL_API
405      virtual std::string showTagNames() const;
406    
407    /**    /**
408       \brief       \brief
409       assigns new location to the domain       assigns new location to the domain
410    */    */
411      FINLEY_DLL_API
412    virtual void setNewX(const escript::Data& arg);    virtual void setNewX(const escript::Data& arg);
413    
414    /**    /**
415       \brief       \brief
416       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.
417    */    */
418      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
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
439    virtual void interpolateACross(escript::Data& target, const escript::Data& source) const;    virtual void interpolateACross(escript::Data& target, const escript::Data& source) const;
440    virtual bool probeInterpolationACross(int functionSpaceType_source,const AbstractDomain& targetDomain, int functionSpaceType_target) const;  
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
446      virtual bool probeInterpolationACross(int functionSpaceType_source,const escript::AbstractDomain& targetDomain, int functionSpaceType_target) const;
447    
448    /**    /**
449       \brief       \brief
450       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
451       is defined by out. out has to be defined on this.       is defined by out. out has to be defined on this.
452    */    */
453      FINLEY_DLL_API
454    virtual void setToNormal(escript::Data& out) const;    virtual void setToNormal(escript::Data& out) const;
455    
456    /**    /**
457       \brief       \brief
458       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
459       is defined by out. out has to be defined on this.       is defined by out. out has to be defined on this.
460    */    */
461      FINLEY_DLL_API
462    virtual void setToSize(escript::Data& out) const;    virtual void setToSize(escript::Data& out) const;
463    
464    /**    /**
# Line 268  class MeshAdapter:public escript::Abstra Line 466  class MeshAdapter:public escript::Abstra
466       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
467       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.
468    */    */
469      FINLEY_DLL_API
470    virtual void setToGradient(escript::Data& grad,const escript::Data& arg) const;    virtual void setToGradient(escript::Data& grad,const escript::Data& arg) const;
471    
472    /**    /**
# Line 275  class MeshAdapter:public escript::Abstra Line 474  class MeshAdapter:public escript::Abstra
474       copies the integrals of the function defined by arg into integrals.       copies the integrals of the function defined by arg into integrals.
475       arg has to be defined on this.       arg has to be defined on this.
476    */    */
477      FINLEY_DLL_API
478    virtual void setToIntegrals(std::vector<double>& integrals,const escript::Data& arg) const;    virtual void setToIntegrals(std::vector<double>& integrals,const escript::Data& arg) const;
479    
480   /**    /**
481         \brief
482         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.
484         \param solver
485         \param preconditioner
486         \param package
487         \param symmetry
488      */
489      FINLEY_DLL_API
490      virtual int getSystemMatrixTypeId(const int solver, const int preconditioner, const int package, const bool symmetry) const;
491    
492      /**
493       \brief       \brief
494       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 transport problem type to be used when a particular solver, perconditioner, package
495       and symmetric matrix is used.       and symmetric matrix is used.
496       \param solver       \param solver
497         \param preconditioner
498         \param package
499       \param symmetry       \param symmetry
500    */    */
501    virtual int getSystemMatrixTypeId(const int solver, const bool symmetry) const;    FINLEY_DLL_API
502      virtual int getTransportTypeId(const int solver, const int preconditioner, const int package, const bool symmetry) const;
503    
504    /**    /**
505       \brief       \brief
506       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
507       considered as cell centered data.       considered as cell centered data.
508    */    */
509      FINLEY_DLL_API
510    virtual bool isCellOriented(int functionSpaceCode) const;    virtual bool isCellOriented(int functionSpaceCode) const;
511    
512    /**    /**
513       \brief       \brief
514       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
515       considered as cell centered data.                                                                                                                                                                          
516         This has to be implemented by the actual Domain adapter.
517    */    */
518    virtual void saveDX(const std::string& filename,const escript::Data& arg) const;    FINLEY_DLL_API
519      virtual void saveDX(const std::string& filename,const boost::python::dict& arg) const;
520    
521    
522    /**    /**
523       \brief       \brief
524       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
525       considered as cell centered data.                                                                                                                                                                          
526         This has to be implemented by the actual Domain adapter.
527    */    */
528    virtual void saveVTK(const std::string& filename,const escript::Data& arg) const;    FINLEY_DLL_API
529      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
536       returns the function space representation of the type functionSpaceCode on this domain       returns the function space representation of the type functionSpaceCode on this domain
537       as a vtkObject.       as a vtkObject.
538    */    */
539    // vtkObject createVtkObject(int functionSpaceCode) const;    // vtkObject createVtkObject(int functionSpaceCode) const;
540    
541    /**    /**
542       \brief       \brief
543       adds a PDE onto the stiffness matrix mat and a rhs       adds a PDE onto the stiffness matrix mat and a rhs
544    */    */
545      FINLEY_DLL_API
546    virtual void addPDEToSystem(    virtual void addPDEToSystem(
547                       SystemMatrixAdapter& mat, escript::Data& rhs,                       SystemMatrixAdapter& mat, escript::Data& rhs,
548                       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 322  class MeshAdapter:public escript::Abstra Line 551  class MeshAdapter:public escript::Abstra
551                       const escript::Data& d_contact, const escript::Data& y_contact) const;                       const escript::Data& d_contact, const escript::Data& y_contact) const;
552    /**    /**
553       \brief       \brief
554         adds a PDE onto the lumped stiffness matrix matrix
555      */
556      FINLEY_DLL_API
557      virtual void addPDEToLumpedSystem(
558                         escript::Data& mat,
559                         const escript::Data& D,
560                         const escript::Data& d) const;
561    
562      /**
563         \brief
564       adds a PDE onto the stiffness matrix mat and a rhs       adds a PDE onto the stiffness matrix mat and a rhs
565    */    */
566      FINLEY_DLL_API
567    virtual void addPDEToRHS(escript::Data& rhs,    virtual void addPDEToRHS(escript::Data& rhs,
568                       const escript::Data& X, const escript::Data& Y,                       const escript::Data& X, const escript::Data& Y,
569                       const escript::Data& y, const escript::Data& y_contact) const;                       const escript::Data& y, const escript::Data& y_contact) const;
570    /**    /**
571       \brief       \brief
572      creates a SystemMatrixAdapter stiffness matrix an initializes it with zeros:       adds a PDE onto a transport problem
573    */    */
574    SystemMatrixAdapter newSystemMatrix(  
575      FINLEY_DLL_API
576      virtual void addPDEToTransportProblem(
577                         TransportProblemAdapter& tp, escript::Data& source,
578                         const escript::Data& M,
579                         const escript::Data& A, const escript::Data& B, const escript::Data& C,const  escript::Data& D,
580                         const  escript::Data& X,const  escript::Data& Y,
581                         const escript::Data& d, const escript::Data& y,
582                         const escript::Data& d_contact,const escript::Data& y_contact) const;
583    
584    
585      /**
586         \brief
587        creates a SystemMatrixAdapter stiffness matrix and initializes it with zeros:
588      */
589      FINLEY_DLL_API
590      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,
594                        const escript::FunctionSpace& column_functionspace,                        const escript::FunctionSpace& column_functionspace,
595                        const int type) const;                        const int type) const;
596      /**
597       \brief
598        creates a TransportProblemAdapter
599    
600      */
601    
602      FINLEY_DLL_API
603      escript::ATP_ptr newTransportProblem(
604                          const bool useBackwardEuler,
605                          const int blocksize,
606                          const escript::FunctionSpace& functionspace,
607                          const int type) const;
608    
609    /**    /**
610       \brief returns locations in the FEM nodes       \brief returns locations in the FEM nodes
611    */    */
612      FINLEY_DLL_API
613    virtual escript::Data getX() const;    virtual escript::Data getX() const;
614    
615    /**    /**
616       \brief return boundary normals at the quadrature point on the face elements       \brief return boundary normals at the quadrature point on the face elements
617    */    */
618      FINLEY_DLL_API
619    virtual escript::Data getNormal() const;    virtual escript::Data getNormal() const;
620    
621    /**    /**
622       \brief returns the element size       \brief returns the element size
623    */    */
624      FINLEY_DLL_API
625    virtual escript::Data getSize() const;    virtual escript::Data getSize() const;
626    
627    bool operator==(const MeshAdapter& other) const;    /**
628    bool operator!=(const MeshAdapter& other) const;       \brief comparison operators
629      */
630      FINLEY_DLL_API
631      virtual bool operator==(const escript::AbstractDomain& other) const;
632      FINLEY_DLL_API
633      virtual bool operator!=(const escript::AbstractDomain& other) const;
634    
635      /**
636         \brief assigns new tag newTag to all samples of functionspace with a positive
637         value of mask for any its sample point.
638    
639      */
640      FINLEY_DLL_API
641      virtual void setTags(const int functionSpaceType, const int newTag, const escript::Data& mask) const;
642    
643      /**
644          \brief
645              return the number of tags in use and a pointer to an array with the number of tags in use
646      */
647      FINLEY_DLL_API
648      virtual int getNumberOfTagsInUse(int functionSpaceCode) const;
649    
650      FINLEY_DLL_API
651      virtual const int* borrowListOfTagsInUse(int functionSpaceCode) const;
652    
653    
654      /**
655         \brief Checks if this domain allows tags for the specified functionSpaceCode.
656      */
657      FINLEY_DLL_API
658      virtual
659      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
682    boost::shared_ptr<Finley_Mesh> m_finleyMesh;    boost::shared_ptr<Finley_Mesh> m_finleyMesh;
# Line 365  class MeshAdapter:public escript::Abstra Line 685  class MeshAdapter:public escript::Abstra
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.110  
changed lines
  Added in v.3259

  ViewVC Help
Powered by ViewVC 1.1.26