G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsGenericTensorBasis.h
Go to the documentation of this file.
1 
14 #pragma once
15 
16 #include <gsTensor/gsTensorBasis.h>
17 
18 
19 namespace 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 
37 template<short_t d, class T>
39 {
40 
41 public:
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 
65 public:
66  // Constructors forwarded from the base class
67  gsGenericTensorBasis() : Base() { }
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 
86 public:
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
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
index_t size() const
Returns the number of elements in the basis.
Definition: gsTensorBasis.h:108
memory::shared_ptr< gsGenericTensorBasis > Ptr
Shared pointer for gsGenericTensorBasis.
Definition: gsGenericTensorBasis.h:51
Basis_t ** iterator
Iterators on coordinate bases.
Definition: gsTensorBasis.h:52
#define GISMO_ENSURE(cond, message)
Definition: gsDebug.h:102
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
Class for a quasi-tensor B-spline basis.
Definition: gsGenericTensorBasis.h:38
memory::unique_ptr< gsGenericTensorBasis > uPtr
Unique pointer for gsGenericTensorBasis.
Definition: gsGenericTensorBasis.h:54
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
Interface for the set of functions defined on a domain (the total number of functions in the set equa...
Definition: gsFuncData.h:23
Abstract base class for tensor product bases.
Definition: gsTensorBasis.h:33
uPtr clone()
Clone methode. Produceds a deep copy inside a uPtr.
T Scalar_t
Coefficient type.
Definition: gsGenericTensorBasis.h:46
gsTensorBasis< d, T > Base
Base type.
Definition: gsGenericTensorBasis.h:43
Provides declaration of TensorBasis class.
A basis represents a family of scalar basis functions defined over a common parameter domain...
Definition: gsBasis.h:78