G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsMeshElement.h
Go to the documentation of this file.
1 
14 #pragma once
15 
17 
18 
19 namespace gismo {
20 
21 
22 template <class T>
23 class gsMeshElement
24 {
25 public:
26  typedef T scalar_t;
27  typedef gsVertex<T> * gsVertexHandle;
28  typedef gsEdge<T> * gsEdgeHandle;
29  typedef gsFace<T> * gsFaceHandle;
30  typedef gsCell<T> * gsCellHandle;
31 
32  typedef gsHalfEdge<T> * gsHalfEdgeHandle;
33  typedef gsHeVertex<T> * gsHeVertexHandle;
34  typedef gsHalfFace<T> * gsHalfFaceHandle;
35 
36 public:
37  explicit gsMeshElement(int i = 0) : id(i)
38  { }
39 
40  virtual ~gsMeshElement() { }
41 
42  int getId() const { return id; }
43  void setId(int i) { id=i; }
44 
45 public:
46 
47  static gsVertexHandle makeVertex( scalar_t x, scalar_t y, scalar_t z = 0)
48  { return new gsVertex<T>(x,y,z); }
49 
50  static gsVertexHandle makeVertex( gsVector<T> const & u )
51  { return new gsVertex<T>(u); }
52 
53  static gsFaceHandle makeFace( std::vector<gsVertexHandle> const & vert)
54  { return new gsFace<T>(vert); }
55 
56  static gsFaceHandle makeFace(gsVertexHandle v0, gsVertexHandle v1,
57  gsVertexHandle v2, gsVertexHandle v3)
58  { return new gsFace<T>(v0,v1,v2,v3); }
59 
60  static gsFaceHandle makeFace(gsVertexHandle v0, gsVertexHandle v1, gsVertexHandle v2)
61  { return new gsFace<T>(v0,v1,v2); }
62 
64  virtual std::ostream &print(std::ostream &os) const
65  { os<<"gsMeshElement\n"; return os; }
66 
67  friend std::ostream& operator<<(std::ostream& os, const gsMeshElement& e)
68  { return e.print(os); }
69 
70 private:
71  int id;
72 };
73 
74 
75 } // namespace gismo
76 
std::ostream & operator<<(std::ostream &os, const _expr< E > &b)
Stream operator for expressions.
Definition: gsExpressions.h:382
Provides forward declarations of types and structs.
EIGEN_STRONG_INLINE idMat_expr id(const index_t dim)
The identity matrix of dimension dim.
Definition: gsExpressions.h:4472