G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
gsPde.h
Go to the documentation of this file.
1
15#pragma once
16
18#include <gsCore/gsMultiPatch.h>
20
21namespace gismo
22{
23
24
42template<class T>
43class gsPde
44{
45protected:
46 gsPde()
47 {
48 }
49public:
50 typedef memory::shared_ptr<gsPde> Ptr;
51 typedef memory::unique_ptr<gsPde> uPtr;
52
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
159protected:
163
168
169}; // class gsPde
170
172template<class T>
173std::ostream &operator<<(std::ostream &os, const gsPde<T>& pde)
174{
175 return pde.print(os);
176}
177
178} // namespace gismo
Class containing a set of boundary conditions.
Definition gsBoundaryConditions.h:342
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
virtual int numRhs() const
gives the number of rhs functions of the PDEs
Definition gsPde.h:117
virtual std::ostream & print(std::ostream &os) const =0
Print a short description of the PDE.
GISMO_DEPRECATED short_t dim() const
returns the dimension of the domain
Definition gsPde.h:147
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
gsBoundaryConditions< T > & boundaryConditions()
Returns a reference to the Pde boundary conditions.
Definition gsPde.h:79
virtual gsPde< T > * restrictToPatch(unsigned) const
restrictToPatch creats a new PDE object for a single patch np.
Definition gsPde.h:157
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
gsPde(const gsMultiPatch< T > &domain, const gsBoundaryConditions< T > &bc)
Constructor without given exact solution.
Definition gsPde.h:54
gsMultiPatch< T > m_domain
Computational domain.
Definition gsPde.h:165
int numUnknowns() const
Gives the number of unknown fields of the PDEs.
Definition gsPde.h:109
gsBoundaryConditions< T > m_boundary_conditions
Boundary conditions.
Definition gsPde.h:167
A vector with arbitrary coefficient type and fixed or dynamic size.
Definition gsVector.h:37
Provides gsBoundaryConditions class.
#define short_t
Definition gsConfig.h:35
#define index_t
Definition gsConfig.h:32
#define GISMO_NO_IMPLEMENTATION
Definition gsDebug.h:129
#define GISMO_ERROR(message)
Definition gsDebug.h:118
#define gsWarn
Definition gsDebug.h:50
#define GISMO_UNUSED(x)
Definition gsDebug.h:112
#define GISMO_ASSERT(cond, message)
Definition gsDebug.h:89
Provides declaration of the MultiPatch class.
Provides declaration of a gsPiecewiseFunction class.
The G+Smo namespace, containing all definitions for the library.