G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsCurve.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 gsCurve : public gsGeometry<T>
31 {
32 
33 public:
35  typedef memory::shared_ptr< gsCurve > Ptr;
36 
38  typedef memory::unique_ptr< gsCurve > uPtr;
39 
40  typedef T Scalar_t;
41 public:
42 
45 
47  gsCurve() : 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  }
57 
59 
60 // GISMO_UPTR_FUNCTION_PURE(gsCurve, clone)
61 private: virtual gsCurve * clone_impl() const = 0;
62 public: inline uPtr clone() const { return uPtr(clone_impl()); }
63 
64  short_t domainDim() const { return 1; }
65 
66  short_t degree() const;
67 
68  void toMesh(gsMesh<T> & msh, int npoints = 100) const;
69 
71  void reverse()
72  {
73  this->m_coefs = this->m_coefs.colwise().reverse().eval();
74  this->basis().reverse();
75  }
76 
77  virtual bool isOn(gsMatrix<T> const &, T = 1e-3) const
79 
80 }; // class gsCurve
81 
82 } // namespace gismo
83 
84 
85 #ifndef GISMO_BUILD_LIB
86 #include GISMO_HPP_HEADER(gsCurve.hpp)
87 #endif
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
#define GISMO_NO_IMPLEMENTATION
Definition: gsDebug.h:129
Abstract base class representing a curve.
Definition: gsCurve.h:30
void reverse()
Reverse the coefficients.
Definition: gsCurve.h:71
#define short_t
Definition: gsConfig.h:35
S give(S &x)
Definition: gsMemory.h:266
Provides declaration of Geometry abstract interface.
#define GISMO_ASSERT(cond, message)
Definition: gsDebug.h:89
Class Representing a triangle mesh with 3D vertices.
Definition: gsMesh.h:31
gsCurve(const gsBasis< T > &basis, gsMatrix< T > coefs)
Definition: gsCurve.h:51
memory::shared_ptr< gsCurve > Ptr
Shared pointer for gsCurve.
Definition: gsCurve.h:35
memory::unique_ptr< gsCurve > uPtr
Unique pointer for gsCurve.
Definition: gsCurve.h:38
gsCurve()
Default empty constructor.
Definition: gsCurve.h:47
virtual const gsBasis< T > & basis() const =0
Returns a const reference to the basis of the geometry.
short_t domainDim() const
Dimension d of the parameter domain (overriding gsFunction::domainDim()).
Definition: gsCurve.h:64
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