G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsCDRAssembler.h
Go to the documentation of this file.
1 
14 #pragma once
15 
17 #include <gsPde/gsConvDiffRePde.h>
18 
19 namespace gismo
20 {
21 
22 
27 {
28  enum method
29  {
30  SUPG = 1,
31  none = 0
32  };
33 };
34 
35 
48 template<class T>
50 {
51 public:
53 
54 public:
55 
58 
65  const gsMultiBasis<T> & bases,
66  stabilizerCDR::method flagStabilization = stabilizerCDR::none)
67  {
68  // enrich options in constructor, refresh to apply options
69 
70  // 0: no stabilization
71  // 1: SUPG
73  m_options.addInt("Stabilization", "Choice of stabilization method; 0 := no; 1 := SUPG;", flagStabilization);
74  Base::initialize(pde, bases, m_options);
75  }
76 
85  const gsMultiBasis<T> & bases,
86  dirichlet::strategy dirStrategy,
87  iFace::strategy intStrategy = iFace::glue,
88  stabilizerCDR::method flagStabilization = stabilizerCDR::none)
89  {
91  m_options.setInt("DirichletStrategy", dirStrategy);
92  m_options.setInt("InterfaceStrategy", intStrategy);
93 
94  // 0: no stabilization
95  // 1: SUPG
96  m_options.addInt("Stabilization", "Choice of stabilization method; 0 := no; 1 := SUPG;", flagStabilization);
97 
98  Base::initialize(pde, bases, m_options);
99  }
100 
114  gsMultiBasis<T> const & bases,
115  gsBoundaryConditions<T> const & bconditions,
116  const gsFunction<T> & rhs,
117  const gsFunction<T> & coeff_A,
118  const gsFunction<T> & coeff_b,
119  const gsFunction<T> & coeff_c,
120  dirichlet::strategy dirStrategy = dirichlet::elimination,
121  iFace::strategy intStrategy = iFace::glue,
122  stabilizerCDR::method flagStabilization = stabilizerCDR::none)
123  {
125  m_options.setInt("DirichletStrategy", dirStrategy);
126  m_options.setInt("InterfaceStrategy", intStrategy);
127 
128  // 0: no stabilization
129  // 1: SUPG
130  m_options.addInt("Stabilization", "Choice of stabilization method; 0 := no; 1 := SUPG;", flagStabilization);
131 
132  typename gsPde<T>::Ptr pde(new gsConvDiffRePde<T>
133  (patches, bconditions, &coeff_A, &coeff_b, &coeff_c, &rhs));
134  Base::initialize(pde, bases, m_options);
135  }
136 
138  void assemble();
139 
140 protected:
141 
142  // Members from gsAssembler
143  using Base::m_pde_ptr;
144  using Base::m_bases;
145  using Base::m_ddof;
146  using Base::m_options;
147  using Base::m_system;
148 };
149 
150 } // namespace gismo
151 
152 #ifndef GISMO_BUILD_LIB
153 #include GISMO_HPP_HEADER(gsCDRAssembler.hpp)
154 #endif
Use SUPG.
Definition: gsCDRAssembler.h:30
memory::shared_ptr< gsPde< T > > m_pde_ptr
Definition: gsAssembler.h:276
Do not use a stabilizer.
Definition: gsCDRAssembler.h:31
gsCDRAssembler(gsMultiPatch< T > const &patches, gsMultiBasis< T > const &bases, gsBoundaryConditions< T > const &bconditions, const gsFunction< T > &rhs, const gsFunction< T > &coeff_A, const gsFunction< T > &coeff_b, const gsFunction< T > &coeff_c, dirichlet::strategy dirStrategy=dirichlet::elimination, iFace::strategy intStrategy=iFace::glue, stabilizerCDR::method flagStabilization=stabilizerCDR::none)
Constructor of the assembler object.
Definition: gsCDRAssembler.h:113
gsOptionList m_options
Options.
Definition: gsAssembler.h:285
std::vector< gsMultiBasis< T > > m_bases
Definition: gsAssembler.h:282
const gsMatrix< T > & rhs() const
Returns the left-hand side vector(s) ( multiple right hand sides possible )
Definition: gsAssembler.h:618
void assemble()
Main assembly routine.
Definition: gsCDRAssembler.hpp:37
A function from a n-dimensional domain to an m-dimensional image.
Definition: gsFunction.h:59
void addInt(const std::string &label, const std::string &desc, const index_t &value)
Adds a option named label, with description desc and value value.
Definition: gsOptionList.cpp:201
const gsMultiPatch< T > & patches() const
Return the multipatch.
Definition: gsAssembler.h:601
void setInt(const std::string &label, const index_t &value)
Sets an existing option label to be equal to value.
Definition: gsOptionList.cpp:158
static gsOptionList defaultOptions()
Returns the list of default options for assembly.
Definition: gsCDRAssembler.hpp:29
Holds a set of patch-wise bases and their topology information.
Definition: gsMultiBasis.h:36
gsCDRAssembler(const gsConvDiffRePde< T > &pde, const gsMultiBasis< T > &bases, dirichlet::strategy dirStrategy, iFace::strategy intStrategy=iFace::glue, stabilizerCDR::method flagStabilization=stabilizerCDR::none)
Constructor of the assembler object.
Definition: gsCDRAssembler.h:84
void initialize(const gsPde< T > &pde, const gsStdVectorRef< gsMultiBasis< T > > &bases, const gsOptionList &opt=defaultOptions())
Intitialize function for, sets data fields using the pde, a vector of multi-basis and assembler optio...
Definition: gsAssembler.h:317
A convection-diffusion-reaction PDE, including source term on the right-hand side.
Definition: gsConvDiffRePde.h:35
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition: gsMultiPatch.h:33
gsCDRAssembler(const gsConvDiffRePde< T > &pde, const gsMultiBasis< T > &bases, stabilizerCDR::method flagStabilization=stabilizerCDR::none)
Main Constructor of the assembler object.
Definition: gsCDRAssembler.h:64
const gsPde< T > & pde() const
Return the Pde.
Definition: gsAssembler.h:598
gsSparseSystem< T > m_system
Global sparse linear system.
Definition: gsAssembler.h:290
Provides assembler for the Poisson equation.
Stabililzer for the CDR discretization.
Definition: gsCDRAssembler.h:26
std::vector< gsMatrix< T > > m_ddof
Definition: gsAssembler.h:295
Class containing a set of boundary conditions.
Definition: gsBoundaryConditions.h:341
method
Definition: gsCDRAssembler.h:28
Class which holds a list of parameters/options, and provides easy access to them. ...
Definition: gsOptionList.h:32
Implementation of an (multiple righ-hand side) Poisson solver.
Definition: gsCDRAssembler.h:49
Implementation of an (multiple right-hand side) Poisson assembler.
Definition: gsPoissonAssembler.h:36