G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
gsConvDiffRePde.h
1
14#pragma once
15
16#include <gsPde/gsPde.h>
17
18
19namespace gismo
20{
21
22template <class T>
23class gsFunction;
24
34template <class T>
35class gsConvDiffRePde : public gsPde<T>
36{
37protected:
38 using gsPde<T>::m_unknownDim;
39
40public:
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 }
88private:
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}
Class containing a set of boundary conditions.
Definition gsBoundaryConditions.h:342
A convection-diffusion-reaction PDE, including source term on the right-hand side.
Definition gsConvDiffRePde.h:36
virtual bool isSymmetric() const
Definition gsConvDiffRePde.h:72
std::ostream & print(std::ostream &os) const
Print a short description of the PDE.
Definition gsConvDiffRePde.h:79
A function from a n-dimensional domain to an m-dimensional image.
Definition gsFunction.h:60
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition gsMultiPatch.h:100
Abstract class representing a PDE (partial differential equation).
Definition gsPde.h:44
gsMultiPatch< T > & domain()
Returns a reference to the Pde domain.
Definition gsPde.h:66
gsVector< unsigned > m_unknownDim
Description of the unknown fields: for each one the target dimension.
Definition gsPde.h:162
Base class of descriptions of a PDE problem.
The G+Smo namespace, containing all definitions for the library.