G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
gsMeshElement.h
Go to the documentation of this file.
1
14#pragma once
15
17
18
19namespace gismo {
20
21
22template <class T>
23class gsMeshElement
24{
25public:
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
36public:
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
45public:
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
70private:
71 int id;
72};
73
74
75} // namespace gismo
76
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:4470
std::ostream & operator<<(std::ostream &os, const _expr< E > &b)
Stream operator for expressions.
Definition gsExpressions.h:382
The G+Smo namespace, containing all definitions for the library.