G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
gsGenericTensorBasis.h
Go to the documentation of this file.
1
14#pragma once
15
17
18
19namespace gismo
20{
21
22/*template <short_t d, class T, class KnotVectorType>
23 struct TensorVersionOf<d, gsNurbsBasis<T,KnotVectorType> >
24 {
25 // Tensor basis for gsBSplineBasis
26 typedef gsQuasiTensorNurbsBasis<d,T,KnotVectorType> R;
27 };*/
28
37template<short_t d, class T>
39{
40
41public:
44
46 typedef T Scalar_t;
47
48 typedef gsBasis<T> Basis_t;
49
51 typedef memory::shared_ptr< gsGenericTensorBasis > Ptr;
52
54 typedef memory::unique_ptr< gsGenericTensorBasis > uPtr;
55
56 // Associated geometry type
57 typedef gsGenericGeometry<d,T> GeometryType;
58
59 // Associated Boundary basis type
60 //typedef typename Base::BoundaryBasisType BoundaryBasisType;
61
62 typedef typename Base::iterator iterator;
63 typedef typename Base::const_iterator const_iterator;
64
65public:
66 // Constructors forwarded from the base class
68
69 gsGenericTensorBasis( Basis_t* x, Basis_t* y) : Base(x,y) { }
70
71 gsGenericTensorBasis( const Basis_t & x, const Basis_t & y) :
72 Base(x.clone().release(), y.clone().release()) { }
73
74 gsGenericTensorBasis( Basis_t* x, Basis_t* y, Basis_t* z ) : Base(x,y,z) { }
75
76 gsGenericTensorBasis( const Basis_t & x, const Basis_t & y, const Basis_t & z ) :
77 Base(x.clone().release(), y.clone().release(), z.clone().release()) { }
78
79 gsGenericTensorBasis( std::vector<Basis_t*> & bb ) : Base(bb.data())
80 {
81 GISMO_ENSURE( d == bb.size(), "Wrong d in the constructor of gsTensorBSplineBasis." );
82 }
83
84
85
86public:
87
88 GISMO_MAKE_GEOMETRY_NEW
89
90 std::ostream &print(std::ostream &os) const
91 {
92 os << "GenericTensorNurbsBasis<" << this->dim()<< ">, size "<< this->size() <<".";
93 for ( unsigned i = 0; i!=d; ++i )
94 os << "\n Direction "<< i <<": "<< this->component(i) <<" ";
95 return os;
96 }
97
98 GISMO_CLONE_FUNCTION(gsGenericTensorBasis)
99
100};
101
102
103} // namespace gismo
A basis represents a family of scalar basis functions defined over a common parameter domain.
Definition gsBasis.h:79
uPtr clone()
Clone methode. Produceds a deep copy inside a uPtr.
Class for a quasi-tensor B-spline basis.
Definition gsGenericTensorBasis.h:39
GISMO_MAKE_GEOMETRY_NEW std::ostream & print(std::ostream &os) const
Prints the object as a string, pure virtual function of gsTensorBasis.
Definition gsGenericTensorBasis.h:90
memory::unique_ptr< gsGenericTensorBasis > uPtr
Unique pointer for gsGenericTensorBasis.
Definition gsGenericTensorBasis.h:54
T Scalar_t
Coefficient type.
Definition gsGenericTensorBasis.h:46
memory::shared_ptr< gsGenericTensorBasis > Ptr
Shared pointer for gsGenericTensorBasis.
Definition gsGenericTensorBasis.h:51
gsTensorBasis< d, T > Base
Base type.
Definition gsGenericTensorBasis.h:43
Abstract base class for tensor product bases.
Definition gsTensorBasis.h:34
index_t size() const
Returns the number of elements in the basis.
Definition gsTensorBasis.h:108
Basis_t & component(short_t dir)
For a tensor product basis, return the 1-d basis for the i-th parameter component.
Definition gsTensorBasis.h:596
#define GISMO_ENSURE(cond, message)
Definition gsDebug.h:102
Provides declaration of TensorBasis class.
std::vector< T * > release(std::vector< unique_ptr< T > > &cont)
Takes a vector of smart pointers, releases them and returns the corresponding raw pointers.
Definition gsMemory.h:228
The G+Smo namespace, containing all definitions for the library.