G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsBiharmonicExprAssembler.h
Go to the documentation of this file.
1 
14 #pragma once
15 
18 
19 namespace gismo
20 {
21 
22 template <class T>
23 class gsBiharmonicExprAssembler
24 {
25 public:
26 
35 gsBiharmonicExprAssembler( const gsMultiPatch<T> & mp,
36  const gsMultiBasis<T> & mb,
37  const gsFunctionSet<T> & force,
38  const gsBoundaryConditions<T> & bcs
39  );
40 
42 gsBiharmonicExprAssembler() { }
43 
45 gsBiharmonicExprAssembler( const gsBiharmonicExprAssembler& other )
46 {
47  operator=(other);
48 }
49 
51 gsBiharmonicExprAssembler( gsBiharmonicExprAssembler&& other )
52 {
53  operator=(give(other));
54 }
55 
57 gsBiharmonicExprAssembler& operator= ( const gsBiharmonicExprAssembler& other );
58 
60 gsBiharmonicExprAssembler& operator= ( gsBiharmonicExprAssembler&& other );
61 
62 protected:
63 
64  void _defaultOptions();
65 
66  void _getOptions();
67 
68  void _initialize();
69 
70  void _setup(const expr::gsFeSpace<T> & u);
71 
72 public:
73 
75  void setSpaceBasis(const gsFunctionSet<T> & spaceBasis);
76 
78  void assembleMass();
79 
81  void assemble();
82 
84  void assembleLHS();
85 
87  void assembleRHS();
88 
89  const gsSparseMatrix<T> & matrix() const { return m_assembler.matrix(); }
90  const gsMatrix<T> & rhs() const { return m_assembler.rhs(); }
91 
92  T penalty() const { return m_penalty; };
93  index_t numDofs() const { return m_assembler.numDofs(); };
94 
96  T l2error(gsMatrix<T> & solVector, const gsFunctionSet<T> & exact);
97 
99  T h1error(gsMatrix<T> & solVector, const gsFunctionSet<T> & exact);
100 
102  T h2error(gsMatrix<T> & solVector, const gsFunctionSet<T> & exact);
103 
105  std::tuple<T,T,T> errors(gsMatrix<T> & solVector, const gsFunctionSet<T> & exact);
106 
108  T interfaceError(gsMatrix<T> & solVector, const gsFunctionSet<T> & exact);
109 
111  gsOptionList & options() {return m_options;}
112 
114  void setOptions(gsOptionList & options);
115 
117  void constructSolution(gsMatrix<T> & solVector);
118 
120  typename gsFunctionSet<T>::Ptr getSolution() const;
121 
122 private:
123 
124  // template <typename basisT>
125  void _setMapperForBiharmonic(const gsBoundaryConditions<T> & bc,
126  const gsFunctionSet<T> & bb2,
127  gsDofMapper & mapper);
128 
129  void _getDirichletNeumannValuesL2Projection(const gsMultiPatch<T> & mp,
130  const gsMultiBasis<T> & dbasis,
131  const gsBoundaryConditions<T> & bc,
132  const gsFunctionSet<T> & bb2,
133  const expr::gsFeSpace<T> & u);
134 
135  void _computeStabilityParameter(const gsMultiPatch<T> & mp,
136  const gsMultiBasis<T> & dbasis,
137  gsMatrix<T> & mu_interfaces);
138 
139 protected:
140 
141  typedef typename gsExprAssembler<T>::geometryMap geometryMap;
142  typedef typename gsExprAssembler<T>::space space;
143  typedef typename gsExprAssembler<T>::solution solution;
144  typedef typename gsExprAssembler<T>::element element;
145 
146  mutable T m_penalty;
147  mutable T m_lambda;
148  mutable bool m_second;
149  mutable index_t m_continuity;
150 
151  gsExprAssembler<T> m_assembler;
152  gsExprEvaluator<T> m_evaluator;
153 
154  gsMultiPatch<T> m_patches;
155  mutable gsMultiBasis<T> m_basis;
156  const gsFunctionSet<T> * m_spaceBasis;
157  const gsFunctionSet<T> * m_force;
158  gsBoundaryConditions<T> m_bcs;
159 
160  mutable gsMappedSpline<2,T> m_mspline;
161  mutable gsMultiPatch<T> m_sol;
162 
163  mutable gsOptionList m_options;
164 
165 
166  // gsFunctionExpr<T> m_ms;
167 
168  }; // class gsBiharmonicExprAssembler
169 
170 #ifdef GISMO_WITH_PYBIND11
171 
175  void pybind11_init_gsBiharmonicExprAssembler(pybind11::module &m);
176 
177 #endif // GISMO_WITH_PYBIND11
178 
179 } // namespace gismo
180 
181 
184 
185 
186 #ifndef GISMO_BUILD_LIB
187 #include GISMO_HPP_HEADER(gsBiharmonicExprAssembler.hpp)
188 #endif
S give(S &x)
Definition: gsMemory.h:266
#define index_t
Definition: gsConfig.h:32
Generic expressions evaluator.
Generic expressions matrix assembly.