G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsPatchwiseFunction.h
Go to the documentation of this file.
1 
14 #pragma once
15 
16 #include <gsCore/gsFunction.h>
17 
18 namespace gismo
19 {
20 
31 template <class T>
33 {
34 public:
35 
36  virtual ~gsPatchwiseFunction() { }
37 
38  GISMO_UPTR_FUNCTION_PURE(gsPatchwiseFunction, clone)
39 
40  operator const gsFunction<T> & ()
41  {
42  return piece(0);
43  }
44 
45 public:
46 
47  virtual const gsFunction<T> & piece(const index_t i) const = 0;
48 
49  virtual index_t size() const = 0;
50 
51 public:
52 
53  inline const gsFunction<T> & operator [] (const index_t i) const
54  {
55  return piece(i);
56  }
57 
58  std::ostream &print(std::ostream &os) const
59  {
60  os << "Patch-wise function.\n";
61  return os;
62  }
63 
64  friend std::ostream & operator<<(std::ostream &os, const gsPatchwiseFunction &pwf)
65  {
66  return pwf.print(os);
67  }
68 };
69 
70 } // namespace gismo
71 
A function depending on an index i, typically referring to a patch/sub-domain.
Definition: gsPatchwiseFunction.h:32
std::ostream & print(std::ostream &os) const
Prints the object as a string.
Definition: gsPatchwiseFunction.h:58
#define index_t
Definition: gsConfig.h:32
A function from a n-dimensional domain to an m-dimensional image.
Definition: gsFunction.h:59
virtual const gsFunction< T > & piece(const index_t i) const =0
Returns the piece(s) of the function(s) at subdomain k.
Interface for the set of functions defined on a domain (the total number of functions in the set equa...
Definition: gsFuncData.h:23
uPtr clone()
Clone methode. Produceds a deep copy inside a uPtr.
Provides declaration of Function abstract interface.
virtual index_t size() const =0
size