G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsConvDiffRePde.h
1 
14 #pragma once
15 
16 #include <gsPde/gsPde.h>
17 
18 
19 namespace gismo
20 {
21 
22 template <class T>
23 class gsFunction;
24 
34 template <class T>
35 class gsConvDiffRePde : public gsPde<T>
36 {
37 protected:
39 
40 public:
42  const gsMultiPatch<T> &domain,
43  const gsBoundaryConditions<T> &bc,
44  const gsFunction<T> *diff, const gsFunction<T> *conv, const gsFunction<T> *reac, const gsFunction<T> *rhs)
45  : gsPde<T>(domain,bc),
46  m_diff(diff), m_conv(conv), m_reac(reac), m_rhs(rhs)
47  {
48  m_unknownDim.setOnes(1);
49 
50  // todo: check dims of coefs
51 
52  }
53 
54  // COMPATIBILITY CONSTRUCTOR, DO NOT USE
56  const gsFunction<T> *diff, const gsFunction<T> *conv, const gsFunction<T> *reac, const gsFunction<T> *rhs)
57  : m_diff(diff), m_conv(conv), m_reac(reac), m_rhs(rhs)
58  {
59  m_unknownDim.setOnes(1);
60  }
61 
63  {
64  /*
65  delete m_diff;
66  delete m_conv;
67  delete m_reac;
68  delete m_rhs;
69  */
70  }
71 
72  virtual bool isSymmetric () const { /*gsWarn<<"Function is gsPde::isSymmetric should not be used!!";*/ return false;}
73 
74  const gsFunction<T>* diffusion() const { return m_diff; }
75  const gsFunction<T>* convection() const { return m_conv; }
76  const gsFunction<T>* reaction() const { return m_reac; }
77  const gsFunction<T>* rhs() const { return m_rhs; }
78 
79  std::ostream &print(std::ostream &os) const
80  {
81  os << "Convection-diffusion-reaction equation, with:\n";
82  if (m_diff) os << " Diffusion term: " << *m_diff << "\n";
83  if (m_conv) os << " Convection term: " << *m_conv << "\n";
84  if (m_reac) os << " Reaction term: " << *m_reac << "\n";
85  if (m_rhs) os << " Source function: " << *m_rhs <<"\n";
86  return os;
87  }
88 private:
89  const gsFunction<T>* m_diff;
90  const gsFunction<T>* m_conv;
91  const gsFunction<T>* m_reac;
92  const gsFunction<T>* m_rhs;
93 };
94 
95 }
gsMultiPatch< T > & domain()
Returns a reference to the Pde domain.
Definition: gsPde.h:66
virtual bool isSymmetric() const
Definition: gsConvDiffRePde.h:72
Abstract class representing a PDE (partial differential equation).
Definition: gsPde.h:43
A function from a n-dimensional domain to an m-dimensional image.
Definition: gsFunction.h:59
std::ostream & print(std::ostream &os) const
Print a short description of the PDE.
Definition: gsConvDiffRePde.h:79
Base class of descriptions of a PDE problem.
A convection-diffusion-reaction PDE, including source term on the right-hand side.
Definition: gsConvDiffRePde.h:35
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition: gsMultiPatch.h:33
Class containing a set of boundary conditions.
Definition: gsBoundaryConditions.h:341
gsVector< unsigned > m_unknownDim
Description of the unknown fields: for each one the target dimension.
Definition: gsPde.h:162