G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsPde.h
Go to the documentation of this file.
1 
15 #pragma once
16 
18 #include <gsCore/gsMultiPatch.h>
20 
21 namespace gismo
22 {
23 
24 
42 template<class T>
43 class gsPde
44 {
45 protected:
46  gsPde()
47  {
48  }
49 public:
50  typedef memory::shared_ptr<gsPde> Ptr;
51  typedef memory::unique_ptr<gsPde> uPtr;
52 
55  : m_domain(domain), m_boundary_conditions(bc)
56  {}
57 
58  virtual ~gsPde()
59  { }
60 
67 
68  const gsMultiPatch<T> & domain() const {return m_domain;}
69 
70  gsMultiPatch<T> & patches() {return m_domain;}
71 
72  const gsMultiPatch<T> & patches() const {return m_domain;}
73 
80 
82 
83  const gsBoundaryConditions<T> & bc() const {return m_boundary_conditions;}
84 
85  // Is the associated linear system symmetric?
86  // TODO: Remove, because it depends on the method and the used
87  // discretization and test spaces whether the resulting linear system
88  // is symmetric or not. Hence, the isSymmetric()-Flag does not
89  // make too much sense in the specification of the PDE.
90  //
91  // As of now, the function still remains, because it is called
92  // by some other functions.
93  virtual bool isSymmetric() const {gsWarn<<"Function is gsPde::isSymmetric should not be used!!"; return false;}
94 
96  virtual std::ostream &print(std::ostream &os) const = 0;
97 
102  {
103  return m_unknownDim;
104  }
105 
109  int numUnknowns() const
110  {
111  return m_unknownDim.size();
112  }
113 
117  virtual int numRhs() const
118  {
119  return 1;
120  }
126  GISMO_DEPRECATED
127  int fieldDim(index_t field_id = 0)
128  {
129  GISMO_ASSERT(field_id<numUnknowns(),"Asked for size of an Unknown field for this PDE type");
130  return m_unknownDim[field_id];
131  }
132 
133  GISMO_DEPRECATED bool solutionGiven(index_t field_id = 0) const
134  { GISMO_UNUSED(field_id); return false;}
135 
136  const std::vector<gsFunction<T>*> &solutions() const
137  { GISMO_ERROR("Deprecated"); }
138 
139  gsFunction<T>* solution(index_t field_id = 0) const
140  { GISMO_UNUSED(field_id); return NULL; }
141 
146  GISMO_DEPRECATED
147  short_t dim() const
148  {
149  return m_domain.dim();
150  }
151 
158 
159 protected:
163 
168 
169 }; // class gsPde
170 
172 template<class T>
173 std::ostream &operator<<(std::ostream &os, const gsPde<T>& pde)
174 {
175  return pde.print(os);
176 }
177 
178 } // namespace gismo
gsMultiPatch< T > & domain()
Returns a reference to the Pde domain.
Definition: gsPde.h:66
GISMO_DEPRECATED int fieldDim(index_t field_id=0)
gives the dimension of the i-th field it returns 1 for scalar fields, 2 for 2d vectors field etc...
Definition: gsPde.h:127
#define GISMO_NO_IMPLEMENTATION
Definition: gsDebug.h:129
#define short_t
Definition: gsConfig.h:35
virtual std::ostream & print(std::ostream &os) const =0
Print a short description of the PDE.
Abstract class representing a PDE (partial differential equation).
Definition: gsPde.h:43
gsBoundaryConditions< T > m_boundary_conditions
Boundary conditions.
Definition: gsPde.h:167
#define index_t
Definition: gsConfig.h:32
virtual gsPde< T > * restrictToPatch(unsigned) const
restrictToPatch creats a new PDE object for a single patch np.
Definition: gsPde.h:157
gsBoundaryConditions< T > & boundaryConditions()
Returns a reference to the Pde boundary conditions.
Definition: gsPde.h:79
#define GISMO_ASSERT(cond, message)
Definition: gsDebug.h:89
#define gsWarn
Definition: gsDebug.h:50
Provides declaration of the MultiPatch class.
GISMO_DEPRECATED short_t dim() const
returns the dimension of the domain
Definition: gsPde.h:147
Provides declaration of a gsPiecewiseFunction class.
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition: gsMultiPatch.h:33
virtual int numRhs() const
gives the number of rhs functions of the PDEs
Definition: gsPde.h:117
Class containing a set of boundary conditions.
Definition: gsBoundaryConditions.h:341
#define GISMO_UNUSED(x)
Definition: gsDebug.h:112
Provides gsBoundaryConditions class.
#define GISMO_ERROR(message)
Definition: gsDebug.h:118
gsMultiPatch< T > m_domain
Computational domain.
Definition: gsPde.h:165
gsPde(const gsMultiPatch< T > &domain, const gsBoundaryConditions< T > &bc)
Constructor without given exact solution.
Definition: gsPde.h:54
int numUnknowns() const
Gives the number of unknown fields of the PDEs.
Definition: gsPde.h:109
gsVector< unsigned > m_unknownDim
Description of the unknown fields: for each one the target dimension.
Definition: gsPde.h:162
const gsVector< unsigned > & unknownDim() const
Gives the vector of dimensions of the unknowns.
Definition: gsPde.h:101