/[escript]/trunk/bruce/src/Bruce/Bruce.h
ViewVC logotype

Diff of /trunk/bruce/src/Bruce/Bruce.h

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

revision 150 by jgs, Thu Sep 15 03:44:45 2005 UTC revision 154 by jgs, Mon Nov 7 05:51:17 2005 UTC
# Line 12  Line 12 
12   *                                                                            *   *                                                                            *
13   ******************************************************************************   ******************************************************************************
14  */  */
15                                                                              
16  #if !defined bruce_Bruce_20050829_H  #if !defined bruce_Bruce_20050829_H
17  #define bruce_Bruce_20050829_H  #define bruce_Bruce_20050829_H
18    
# Line 28  namespace bruce { Line 28  namespace bruce {
28    
29  /**  /**
30     \brief     \brief
31     Bruce implements the AbstractContinuousDomain     Bruce implements a structured AbstractContinuousDomain.
    interface for the Bruce library.  
32    
33     Description:     Description:
34     Bruce implements the AbstractContinuousDomain     Bruce implements a structured AbstractContinuousDomain.
    interface for the Bruce library.  
35  */  */
36    
37  class Bruce : public escript::AbstractContinuousDomain {  class Bruce : public escript::AbstractContinuousDomain {
# Line 42  class Bruce : public escript::AbstractCo Line 40  class Bruce : public escript::AbstractCo
40    
41    //    //
42    // Codes for function space types supported    // Codes for function space types supported
43    static const int ContinuousFunction;    static const int ContinuousFunction;  // data is on the nodes
44    static const int Function;    static const int Function;            // data is on the cell centres
45    
46    //    //
47    // Type of FunctionSpaceNamesMap    // Type of FunctionSpaceNamesMap
# Line 126  class Bruce : public escript::AbstractCo Line 124  class Bruce : public escript::AbstractCo
124       Return a description for this domain.       Return a description for this domain.
125    */    */
126    virtual    virtual
127      inline
128    std::string    std::string
129    getDescription() const;    getDescription() const
130      {
131        return "Bruce";
132      }
133    
134    /**    /**
135       \brief       \brief
# Line 151  class Bruce : public escript::AbstractCo Line 153  class Bruce : public escript::AbstractCo
153       Return a continuous FunctionSpace code.       Return a continuous FunctionSpace code.
154    */    */
155    virtual    virtual
156      inline
157    int    int
158    getContinuousFunctionCode() const;    getContinuousFunctionCode() const
159      {
160        return ContinuousFunction;
161      }
162    
163    /**    /**
164       \brief       \brief
165       Return a function FunctionSpace code.       Return a function FunctionSpace code.
166    */    */
167    virtual    virtual
168      inline
169    int    int
170    getFunctionCode() const;    getFunctionCode() const
171      {
172        return Function;
173      }
174    
175    /**    /**
176       \brief       \brief
177       Return the spatial dimension of the mesh.       Return the spatial dimension of the mesh.
178    */    */
179    virtual    virtual
180      inline
181    int    int
182    getDim() const;    getDim() const
183      {
184        return m_origin.size();
185      }
186    
187    /**    /**
188       \brief       \brief
# Line 181  class Bruce : public escript::AbstractCo Line 195  class Bruce : public escript::AbstractCo
195    
196    /**    /**
197       \brief       \brief
198         Return the number of samples
199         needed to represent data on parts of the mesh.
200      */
201      int
202      getNumSamples(int functionSpaceCode) const;
203    
204      /**
205         \brief
206         Return the number of data-points per sample
207         needed to represent data on parts of the mesh.
208      */
209      inline
210      int
211      getNumDataPointsPerSample(int functionSpaceCode) const
212      {
213        return 1;
214      }
215    
216      /**
217         \brief
218       Returns the locations in the domain of the FEM nodes.       Returns the locations in the domain of the FEM nodes.
219    */    */
220    virtual    virtual
# Line 213  class Bruce : public escript::AbstractCo Line 247  class Bruce : public escript::AbstractCo
247    
248    /**    /**
249       \brief       \brief
250         Copies the gradient of arg into grad. The actual function space to be considered
251         for the gradient is defined by grad. arg and grad have to be defined on this.
252      */
253      virtual
254      void
255      setToGradient(escript::Data& grad,
256                    const escript::Data& arg) const;
257    
258      /**
259         \brief
260       Comparison operators.       Comparison operators.
261    */    */
262    virtual bool operator==(const AbstractDomain& other) const;    virtual bool operator==(const AbstractDomain& other) const;
263    virtual bool operator!=(const AbstractDomain& other) const;    virtual bool operator!=(const AbstractDomain& other) const;
264    
265      /*
266         \brief
267         Return the tag key for the given sample number.
268         NB: tags are not implemented on Bruce, so this method always returns 0.
269      */
270      virtual
271      inline
272      int
273      getTagFromSampleNo(int functionSpaceCode,
274                         int sampleNo) const
275      {
276        return 0;
277      }
278    
279      /**
280         \brief
281         Return the reference number of the given sample number.
282      */
283      virtual
284      int
285      getReferenceNoFromSampleNo(int functionSpaceCode,
286                                 int sampleNo) const;
287    
288      /**
289         \brief
290         Saves a dictionary of Data objects to a VTK XML input file.
291         The dictionary consists of pairs of Data objects plus a name
292         for each. Each Data object must be defined on this domain.
293      */
294      virtual
295      void
296      saveVTK(const std::string& filename,
297              const boost::python::dict& dataDict) const;
298    
299      /**
300         \brief
301         Interpolates data given on source onto target where source and target
302         have to be given on the same domain.
303      */
304      virtual
305      void
306      interpolateOnDomain(escript::Data& target,
307                          const escript::Data& source) const;
308    
309      virtual
310      bool
311      probeInterpolationOnDomain(int functionSpaceType_source,
312                                 int functionSpaceType_target) const;
313    
314      /**
315         \brief
316         Interpolates data given on source onto target where source and target
317         are given on different domains.
318      */
319      virtual
320      void
321      interpolateACross(escript::Data& target,
322                        const escript::Data& source) const;
323    
324      virtual
325      bool
326      probeInterpolationACross(int functionSpaceType_source,
327                               const AbstractDomain& targetDomain,
328                               int functionSpaceType_target) const;
329    
330   protected:   protected:
331    
332    /**    /**
# Line 238  class Bruce : public escript::AbstractCo Line 347  class Bruce : public escript::AbstractCo
347       \brief       \brief
348       Check if all components of vector are zero.       Check if all components of vector are zero.
349    */    */
350      static
351    bool    bool
352    isZero(DimVec vec) const;    isZero(DimVec vec);
353    
354   private:   private:
355    

Legend:
Removed from v.150  
changed lines
  Added in v.154

  ViewVC Help
Powered by ViewVC 1.1.26