G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
gsCurve.h
Go to the documentation of this file.
1
14#pragma once
15
16#include <gsCore/gsGeometry.h>
17
18namespace gismo
19{
20
29template<class T>
30class gsCurve : public gsGeometry<T>
31{
32
33public:
35 typedef memory::shared_ptr< gsCurve > Ptr;
36
38 typedef memory::unique_ptr< gsCurve > uPtr;
39
40 typedef T Scalar_t;
41public:
42
45
47 gsCurve() : gsGeometry<T>() { }
48
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)
61private: virtual gsCurve * clone_impl() const = 0;
62public: 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
A basis represents a family of scalar basis functions defined over a common parameter domain.
Definition gsBasis.h:79
Abstract base class representing a curve.
Definition gsCurve.h:31
gsCurve()
Default empty constructor.
Definition gsCurve.h:47
void reverse()
Reverse the coefficients.
Definition gsCurve.h:71
gsCurve(const gsBasis< T > &basis, gsMatrix< T > coefs)
Definition gsCurve.h:51
short_t domainDim() const
Dimension d of the parameter domain (overriding gsFunction::domainDim()).
Definition gsCurve.h:64
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
Abstract base class representing a geometry map.
Definition gsGeometry.h:93
gsMatrix< T > & coefs()
Definition gsGeometry.h:340
virtual const gsBasis< T > & basis() const =0
Returns a const reference to the basis of the geometry.
gsMatrix< T > m_coefs
Coefficient matrix of size coefsSize() x geoDim()
Definition gsGeometry.h:629
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
Class Representing a triangle mesh with 3D vertices.
Definition gsMesh.h:32
#define short_t
Definition gsConfig.h:35
#define GISMO_NO_IMPLEMENTATION
Definition gsDebug.h:129
#define GISMO_ASSERT(cond, message)
Definition gsDebug.h:89
Provides declaration of Geometry abstract interface.
The G+Smo namespace, containing all definitions for the library.
S give(S &x)
Definition gsMemory.h:266