SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NoData.h
Go to the documentation of this file.
1 //
2 // For more information, please see: http://software.sci.utah.edu
3 //
4 // The MIT License
5 //
6 // Copyright (c) 2009 Scientific Computing and Imaging Institute,
7 // University of Utah.
8 //
9 //
10 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
16 //
17 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
19 //
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 // DEALINGS IN THE SOFTWARE.
27 //
28 /// @file NoData.h
29 /// @author Martin Cole, Frank B. Sachse
30 /// @date Mon Aug 23 09:57:14 2004
31 
32 #ifndef CORE_BASIS_NODATA_H
33 #define CORE_BASIS_NODATA_H 1
34 
35 #include <Core/Basis/Basis.h>
38 //#include <Core/Persistent/Persistent.h>
40 
41 namespace SCIRun {
42 namespace Core {
43 namespace Basis {
44 
45 /// Class for describing unit geometry of NoDataBasis
47 public:
49  virtual ~NoDataUnitElement() {}
50 
51  static double unit_vertices[1][1]; ///< Parametric coordinates of vertices
52  static int unit_edges[1][1]; ///< References to vertices of unit edge
53 
54  /// return dimension of domain
55  static int domain_dimension()
56  { return -1; }
57 
58  /// return size of domain
59  static double domain_size()
60  { return 0.0; }
61 
62  /// return number of vertices
63  static int number_of_vertices()
64  { return 0; }
65 
66  /// return number of vertices in mesh
68  { return 0; }
69 
70  /// return degrees of freedom
71  static int dofs()
72  { return 0; }
73 
74  /// return number of edges
75  static int number_of_edges()
76  { return 0; }
77 
78  /// return number of vertices per face
79  static int vertices_of_face()
80  { return 0; }
81 
82  /// return number of faces per cell
83  static int faces_of_cell()
84  { return 0; }
85 
86  static double volume() { return 0.; } ///< return volume
87 };
88 
89 
90 /// Class for handling of element without storage for field variables
91 template <class T> /// for compilation consistency
92  class NoDataBasis : public BasisSimple<T>,
93  public NoDataUnitElement,
94  public NoElementWeights
95 {
96 public:
97  typedef T value_type;
98 
99 
101  virtual ~NoDataBasis() {}
102 
103  static int polynomial_order() { return -1; }
104 
105  template <class VECTOR>
106  void get_weights(const VECTOR &coords, unsigned int elem, double *w) const
107  {
108  }
109 
110  template <class VECTOR>
111  void get_derivate_weights(const VECTOR &coords, unsigned int elem, double *w) const
112  {
113  }
114 
115  static const std::string type_name(int n = -1);
116 
117  virtual void io (Piostream& str);
118 
119 };
120 
121 
122 template <class T>
123 const std::string
125 {
126  ASSERT((n >= -1) && n <= 1);
127  if (n == -1)
128  {
129  static const std::string name = TypeNameGenerator::make_template_id(type_name(0), type_name(1));
130  return name;
131  }
132  else if (n == 0)
133  {
134  static const std::string nm("NoDataBasis");
135  return nm;
136  }
137  else
138  {
139  return find_type_name((T *)0);
140  }
141 }
142 
143 
144 
145 
146 #define NODATABASIS_VERSION 1
147 
148 
149 }}
150 template <class T>
152 {
153  static TypeDescription *td = 0;
154  if (!td)
155  {
156  const TypeDescription *sub = get_type_description((T*)0);
158  (*subs)[0] = sub;
159  td = new TypeDescription("NoDataBasis", subs,
160  std::string(__FILE__),
161  "SCIRun",
163  }
164  return td;
165 }
166 
167  template <class T>
168  void
170  {
171  stream.begin_class(get_type_description(this)->get_name(),
173  stream.end_class();
174  }
175 }
176 
177 #endif
void get_derivate_weights(const VECTOR &coords, unsigned int elem, double *w) const
Definition: NoData.h:111
#define NODATABASIS_VERSION
Definition: NoData.h:146
static int number_of_vertices()
return number of vertices
Definition: NoData.h:63
static const std::string type_name(int n=-1)
Definition: NoData.h:124
specializations of template&lt;class T&gt; find_type_name() function for build-in and simple types not deri...
static double unit_vertices[1][1]
Parametric coordinates of vertices.
Definition: NoData.h:51
Definition: Persistent.h:89
virtual ~NoDataBasis()
Definition: NoData.h:101
virtual void io(Piostream &str)
Definition: NoData.h:169
static int dofs()
return degrees of freedom
Definition: NoData.h:71
Definition: TypeDescription.h:45
std::vector< const TypeDescription * > td_vec
Definition: TypeDescription.h:56
static int number_of_edges()
return number of edges
Definition: NoData.h:75
static int unit_edges[1][1]
References to vertices of unit edge.
Definition: NoData.h:52
#define ASSERT(condition)
Definition: Assert.h:110
Class for describing interfaces to basis elements.
Definition: Basis.h:48
static double volume()
return volume
Definition: NoData.h:86
virtual int begin_class(const std::string &name, int current_version)
Definition: Persistent.cc:143
NoDataBasis()
Definition: NoData.h:100
Class for handling of element without storage for field variables.
Definition: NoData.h:92
const string find_type_name(float *)
Definition: TypeName.cc:63
NoDataUnitElement()
Definition: NoData.h:48
const char * name[]
Definition: BoostGraphExampleTests.cc:87
virtual ~NoDataUnitElement()
Definition: NoData.h:49
static int faces_of_cell()
return number of faces per cell
Definition: NoData.h:83
void get_weights(const VECTOR &coords, unsigned int elem, double *w) const
Definition: NoData.h:106
static const std::string make_template_id(const std::string &templateName, const std::string &templateParam)
Definition: TypeName.h:62
T value_type
Definition: NoData.h:97
static int polynomial_order()
Definition: NoData.h:103
virtual void end_class()
Definition: Persistent.cc:178
Definition: NoElementWeights.h:36
static int domain_dimension()
return dimension of domain
Definition: NoData.h:55
static double domain_size()
return size of domain
Definition: NoData.h:59
int n
Definition: eab.py:9
static int vertices_of_face()
return number of vertices per face
Definition: NoData.h:79
Class for describing unit geometry of NoDataBasis.
Definition: NoData.h:46
static int number_of_mesh_vertices()
return number of vertices in mesh
Definition: NoData.h:67
Definition: TypeDescription.h:49
const TypeDescription * get_type_description(Core::Basis::ConstantBasis< T > *)
Definition: Constant.h:209