G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsDomain.h
Go to the documentation of this file.
1 
15 #pragma once
16 
17 #include <gsCore/gsLinearAlgebra.h>
18 
19 namespace gismo
20 {
21 
30 template<class T>
31 class gsDomain
32 {
33 public:
34 
35  virtual ~gsDomain() { }
36 
37 #if EIGEN_HAS_RVALUE_REFERENCES && EIGEN_GNUC_AT_MOST(4,7) && !EIGEN_COMP_PGI
38  // defaulted declaration required at least in Gcc 4.7.2
39  gsDomain() = default;
40  gsDomain(const gsDomain&) = default;
41  gsDomain(gsDomain&&) = default;
42  gsDomain & operator=(const gsDomain&) = default;
43  gsDomain & operator=(gsDomain&&) = default;
44 #endif
45 
46 public:
47 
49  virtual short_t dim() const
50  { gsWarn << "gsDomain: dimension() not defined at "<< *this << "\n"; return 0; }
51 
56 
60 
62  virtual gsMatrix<T> mesh()
64 
65  virtual T minMeshSize()
67 
69  virtual std::vector<T> breaks() const
71 
73  virtual gsDomain* clone() const = 0;
74 
76  virtual std::ostream &print(std::ostream &os) const = 0;
77 
78  /*
79  Member functions that may be implemented or not in the derived class
80  */
81 
82  virtual std::vector<T> unique() const
83  { gsWarn<<"gsDomain: unique() was not defined at"<< *this <<"\n"; return std::vector<T>() ;}
84 
85  void merge(gsDomain<T> * other )
86  { gsWarn<<"gsDomain: merge(..) was not defined in "<< *this <<"\n"; return;}
87 
88 }; // class gsDomain
89 
91 template<class T>
92 std::ostream &operator<<(std::ostream &os, const gsDomain<T>& b)
93 { return b.print(os); }
94 
95 
96 } // namespace gismo
Class representing a domain. i.e. a collection of elements (triangles, rectangles, cubes, simplices.
Definition: gsDomain.h:31
#define GISMO_NO_IMPLEMENTATION
Definition: gsDebug.h:129
#define short_t
Definition: gsConfig.h:35
virtual gsDomain * clone() const =0
Clone function. Used to make a copy of the (derived) geometry.
virtual std::vector< T > breaks() const
Returns the breaks..
Definition: gsDomain.h:69
virtual gsMatrix< T > mesh()
Returns the mesh..
Definition: gsDomain.h:62
virtual short_t dim() const
dimension of the domain
Definition: gsDomain.h:49
#define gsWarn
Definition: gsDebug.h:50
virtual std::ostream & print(std::ostream &os) const =0
Prints the object as a string.
virtual gsMatrix< T > boundingBox()
Definition: gsDomain.h:54
virtual gsMatrix< T > elements()
Returns a list of elements.
Definition: gsDomain.h:58
This is the main header file that collects wrappers of Eigen for linear algebra.