G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
gsPoissonPde.h
Go to the documentation of this file.
1
15#pragma once
16
17#include <gsPde/gsPde.h>
19
20namespace gismo
21{
22
33template<class T>
34class gsPoissonPde : public gsPde<T>
35{
36
37public:
38
39 gsPoissonPde( ) { }
40
41
45 const gsPiecewiseFunction<T> &rhs,
46 const gsFunction<T> * = NULL)
47 : gsPde<T>(domain,bc), m_rhs(rhs)
48 {
49 m_unknownDim.setOnes(1);
50 }
51
52 int m_compat_dim;
53 // GISMO_DEPRECATED // still used in gsXml < gsPoissonPde<T> >
54 gsPoissonPde(const gsFunction<T> &rhs,
55 int domdim,
56 const gsFunction<T> &)
57 : m_compat_dim(domdim), m_rhs(rhs)
58 {
59 m_unknownDim.setOnes(1);
60
61 }
62 // GISMO_DEPRECATED // still used in gsXml < gsPoissonPde<T> >
63 gsPoissonPde(const gsFunction<T> &rhs,
64 int domdim)
65 : m_compat_dim(domdim), m_rhs(rhs)
66
67 {
68 m_unknownDim.setOnes(1);
69 }
70
71
72 GISMO_DEPRECATED
73 gsPoissonPde(void * unused)
74 {
75 m_rhs=new gsConstantFunction<T>(0);
76 m_unknownDim.setOnes(1);
77 }
78
79
80
84 virtual int numRhs() const
85 {
86 return m_rhs.piece(0).targetDim();
87 }
88
89 const gsFunction<T> * rhs() const { return &m_rhs.piece(0); }
90
91 virtual int numUnknowns() const {return 1;}
92
93 virtual bool isSymmetric () const { gsWarn<<"Function is gsPde::isSymmetric should not be used!!"; return true;}
94
96 virtual std::ostream &print(std::ostream &os) const
97 {
98 os<<"Poisson's equation -\u0394u = f , with:\n";
99 os<<"Source function f= "<< m_rhs <<".\n";
100 return os;
101 }
102
103 virtual gsPde<T>* restrictToPatch(unsigned np) const
104 {
106 m_boundary_conditions.getConditionsForPatch(np,bc);
107 return new gsPoissonPde<T>(m_domain.patch(np),bc,m_rhs);
108 }
109
110protected:
111 using gsPde<T>::m_unknownDim;
112 using gsPde<T>::m_domain;
114
116}; // class gsPoissonPde
117
118} // namespace gismo
Class containing a set of boundary conditions.
Definition gsBoundaryConditions.h:342
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
gsMultiPatch< T > m_domain
Computational domain.
Definition gsPde.h:165
gsBoundaryConditions< T > m_boundary_conditions
Boundary conditions.
Definition gsPde.h:167
A function depending on an index i, typically referring to a patch/sub-domain. On each patch a differ...
Definition gsPiecewiseFunction.h:29
A Poisson PDE.
Definition gsPoissonPde.h:35
gsPoissonPde(const gsMultiPatch< T > &domain, const gsBoundaryConditions< T > &bc, const gsPiecewiseFunction< T > &rhs, const gsFunction< T > *=NULL)
Constructor.
Definition gsPoissonPde.h:43
virtual gsPde< T > * restrictToPatch(unsigned np) const
restrictToPatch creats a new PDE object for a single patch np.
Definition gsPoissonPde.h:103
virtual int numRhs() const
gives the number of rhs functions of the PDEs
Definition gsPoissonPde.h:84
virtual std::ostream & print(std::ostream &os) const
Prints the object as a string.
Definition gsPoissonPde.h:96
#define gsWarn
Definition gsDebug.h:50
Base class of descriptions of a PDE problem.
Provides declaration of a gsPiecewiseFunction class.
The G+Smo namespace, containing all definitions for the library.