G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsSurface.h
Go to the documentation of this file.
1 
14 #pragma once
15 
16 #include <gsCore/gsGeometry.h>
17 
18 namespace gismo
19 {
20 
29 template<class T>
30 class gsSurface : public gsGeometry<T>
31 {
32 
33 public:
35  typedef memory::shared_ptr< gsSurface > Ptr;
36 
38  typedef memory::unique_ptr< gsSurface > uPtr;
39 
40  typedef T Scalar_t;
41 public:
42 
45 
47  gsSurface() : gsGeometry<T>() { }
48 
52  gsGeometry<T>(basis, give(coefs) )
53  {
54  GISMO_ASSERT( this->m_coefs.size() >= 1,
55  "Coefficient matrix cannot be empty.\n");
56  // GISMO_ASSERT( coefs.cols() >= 2,
57  // "Surface must be embedded in dimension at least two.\n");
58  }
59 
61 
62 // GISMO_UPTR_FUNCTION_PURE(gsSurface, clone)
63 private: virtual gsSurface * clone_impl() const = 0;
64 public: inline uPtr clone() const { return uPtr(clone_impl()); }
65 
66  short_t domainDim() const { return 2; }
67 
68  void toMesh(gsMesh<T> & msh, int npoints = 625) const;
69 
70 }; // class gsSurface
71 
72 } // namespace gismo
73 
74 
75 #ifndef GISMO_BUILD_LIB
76 #include GISMO_HPP_HEADER(gsSurface.hpp)
77 #endif
78 
Abstract base class representing a geometry map.
Definition: gsGeometry.h:92
gsMatrix< T > m_coefs
Coefficient matrix of size coefsSize() x geoDim()
Definition: gsGeometry.h:624
short_t domainDim() const
Dimension d of the parameter domain (overriding gsFunction::domainDim()).
Definition: gsSurface.h:66
#define short_t
Definition: gsConfig.h:35
S give(S &x)
Definition: gsMemory.h:266
Provides declaration of Geometry abstract interface.
gsSurface()
Default empty constructor.
Definition: gsSurface.h:47
memory::unique_ptr< gsSurface > uPtr
Unique pointer for gsSurface.
Definition: gsSurface.h:38
#define GISMO_ASSERT(cond, message)
Definition: gsDebug.h:89
Class Representing a triangle mesh with 3D vertices.
Definition: gsMesh.h:31
Abstract base class representing a surface.
Definition: gsSurface.h:30
memory::shared_ptr< gsSurface > Ptr
Shared pointer for gsSurface.
Definition: gsSurface.h:35
gsSurface(const gsBasis< T > &basis, gsMatrix< T > coefs)
Definition: gsSurface.h:51
virtual const gsBasis< T > & basis() const =0
Returns a const reference to the basis of the geometry.
A basis represents a family of scalar basis functions defined over a common parameter domain...
Definition: gsBasis.h:78
gsMatrix< T > & coefs()
Definition: gsGeometry.h:340