G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsSolidElement.h
Go to the documentation of this file.
1 
15 #pragma once
16 
17 #include <gsCore/gsExport.h>
18 
19 namespace gismo {
20 
21 template <class T > class gsSolidHeVertex;
22 template <class T > class gsSolidHalfEdge;
23 template <class T > class gsSolidHalfFace;
24 template <class T > class gsVolumeBlock;
25 
26 template <class T >
27 class GISMO_DEFAULT_VIS gsSolidElement
28 {
29 public:
30  typedef T scalar_t;
31  typedef gsSolidHeVertex<T> * gsSolidHeVertexHandle;
32  typedef gsSolidHalfEdge<T> * gsSolidHalfEdgeHandle;
33  typedef gsSolidHalfFace<T> * gsSolidHalfFaceHandle;
34  typedef gsVolumeBlock<T> * gsVolumeHandle;
35 
36 private:
37  int id;
38 
39 public:
40  explicit gsSolidElement(int i = 0) : id(i)
41  { }
42 
43  virtual ~gsSolidElement() { }
44 
45  int getId() const { return id; }
46  void setId(int i) { id=i; }
47 
48 public:
49 
50  static gsSolidHeVertexHandle makeHeVertex( scalar_t x, scalar_t y, scalar_t z = 0)
51  { return new gsSolidHeVertex<T>(x,y,z); }
52 // gsSolidHalfFaceHandle makeFace( std::vector<gsVertexHandle> const & vert)
53 // { return new gsFace<T>(vert); }
54 // gsSolidHalfFaceHandle makeFace(gsVertexHandle v0, gsVertexHandle v1, gsVertexHandle v2, gsVertexHandle v3)
55 // { return new gsFace<T>(v0,v1,v2,v3); }
56 // gsSolidHalfFaceHandle makeFace(gsVertexHandle v0, gsVertexHandle v1, gsVertexHandle v2)
57 // { return new gsFace<T>(v0,v1,v2); }
58 
59  static gsSolidHalfEdgeHandle makeSolidHalfEdge( gsSolidHeVertexHandle source, gsSolidHalfFaceHandle f)
60  { return new gsSolidHalfEdge<T>(source,f, 0, true); }
61 // gsSolidHalfFaceHandle makeHalfFace( std::vector<gsSolidHalfEdgeHandle> const & hedges)
62 // { return new gsHalfFace<T>(hedges); }
63  static gsVolumeHandle makeVolume( const std::vector<gsSolidHalfFaceHandle>& hfaces)
64  { return new gsVolumeBlock<T>(hfaces); }
65 
67  virtual std::ostream &print(std::ostream &os) const { os<<"gsSolidElement\n"; return os; }
68 
69  friend std::ostream& operator<<(std::ostream& os, const gsSolidElement& e) { return e.print(os); }
70 };
71 
72 
73 } // namespace gismo
Handles shared library creation and other class attributes.
std::ostream & operator<<(std::ostream &os, const _expr< E > &b)
Stream operator for expressions.
Definition: gsExpressions.h:382
EIGEN_STRONG_INLINE idMat_expr id(const index_t dim)
The identity matrix of dimension dim.
Definition: gsExpressions.h:4472