G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
gsStokesPde.h
1
2#pragma once
3
4#include <gsPde/gsPde.h>
5
6namespace gismo
7{
8
9
10template <class T> class gsFunction;
11
22template<class T>
23class gsStokesPde : public gsPde<T>
24{
25protected:
26 gsStokesPde( ) { }
27 gsStokesPde(const gsStokesPde & o) :
28 gsStokesPde(o.m_domain,o.m_boundary_conditions, o.m_force, o.m_source, o.m_viscosity)
29 { }
30
31 using gsPde<T>::m_domain;
32 using gsPde<T>::m_unknownDim;
33
34public:
38 const gsFunction<T> *force,
39 const gsFunction<T> *source = NULL,
40 const T viscosity = 1
41 )
42 : gsPde<T>(domain,bc), m_viscosity(viscosity)
43 {
44 m_force = force ? force->clone().release() : NULL;
45 m_source = source ? source->clone().release() : NULL;
46
47 m_unknownDim.resize(2);
48 m_unknownDim[0] = m_domain.dim();
49 m_unknownDim[1] = 1;
50 }
51
52 ~gsStokesPde( )
53 {
54 delete m_force;
55 delete m_source;
56 }
57
58 const gsFunction<T>* rhs() const
59 { return m_force; }
60 const gsFunction<T>* force() const
61 { return m_force; }
62 const gsFunction<T>* source() const
63 { return m_source; }
64
65 T viscosity() const { return m_viscosity; }
66
67
69 std::ostream &print(std::ostream &os) const
70 {
71 os<<"Stokes's equation:\n"
72 <<"-\u0394u-\u2207p = f,\n"
73 <<" \u2207\u00B7u=0"
74 <<"with:\n";
75 if ( m_force )
76 os<<"Force function f= "<< *m_force <<".\n";
77 if ( m_source )
78 os<<"Source function g= "<< *m_source <<".\n";
79 return os;
80 }
82 bool check()
83 {
84 return true;
85 }
86protected:
87 const gsFunction<T> * m_force;
88 const gsFunction<T> * m_source;
89
90 T m_viscosity;
91}; // class gsStokesPde
92
93} // namespace gismo
Class containing a set of boundary conditions.
Definition gsBoundaryConditions.h:342
uPtr clone()
Clone methode. Produceds a deep copy inside a uPtr.
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 stationary Stokes PDE.
Definition gsStokesPde.h:24
std::ostream & print(std::ostream &os) const
Prints the object as a string.
Definition gsStokesPde.h:69
bool check()
Consistency check.
Definition gsStokesPde.h:82
Base class of descriptions of a PDE problem.
The G+Smo namespace, containing all definitions for the library.