G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsPoissonAssembler.h
Go to the documentation of this file.
1 
14 #pragma once
15 
17 #include <gsPde/gsPoissonPde.h>
18 
19 
20 namespace gismo
21 {
22 
35 template <class T>
37 {
38 public:
39  typedef gsAssembler<T> Base;
40 
41 public:
42 
45 
47  { }
48 
55  const gsMultiBasis<T> & bases)
56  {
58  Base::initialize(pde, bases, m_options);
59  }
60 
61 
70  const gsMultiBasis<T> & bases,
71  dirichlet::strategy dirStrategy,
72  iFace::strategy intStrategy = iFace::glue)
73  {
75  m_options.setInt("DirichletStrategy", dirStrategy);
76  m_options.setInt("InterfaceStrategy", intStrategy);
77 
78  Base::initialize(pde, bases, m_options);
79  }
80 
94  gsMultiBasis<T> const & basis,
95  gsBoundaryConditions<T> const & bconditions,
96  const gsFunction<T> & rhs,
97  dirichlet::strategy dirStrategy = dirichlet::elimination,
98  iFace::strategy intStrategy = iFace::glue)
99  {
101  m_options.setInt("DirichletStrategy", dirStrategy);
102  m_options.setInt("InterfaceStrategy", intStrategy);
103 
104  typename gsPde<T>::Ptr pde( new gsPoissonPde<T>(patches,bconditions,rhs) );
105  Base::initialize(pde, basis, m_options);
106  }
107 
108  virtual gsAssembler<T>* clone() const
109  {
110  return new gsPoissonAssembler<T>(*this);
111  }
112 
113  virtual gsAssembler<T>* create() const
114  {
115  return new gsPoissonAssembler<T>();
116  }
117 
118  // Refresh routine
119  virtual void refresh();
120 
121  // Main assembly routine
122  virtual void assemble();
123 
128  gsEigen::SparseSelfAdjointView< typename gsSparseMatrix<T>::Base, Lower> fullMatrix()
129  {
130  return m_system.matrix().template selfadjointView<Lower>();
131  }
132 
133 
134 protected:
135 
136  // Members from gsAssembler
137  using Base::m_pde_ptr;
138  using Base::m_bases;
139  using Base::m_ddof;
140  using Base::m_options;
141  using Base::m_system;
142 };
143 
144 
145 } // namespace gismo
146 
147 
148 #ifndef GISMO_BUILD_LIB
149 #include GISMO_HPP_HEADER(gsPoissonAssembler.hpp)
150 #endif
Describes a Poisson PDE.
memory::shared_ptr< gsPde< T > > m_pde_ptr
Definition: gsAssembler.h:276
virtual gsAssembler< T > * clone() const
Clone this Assembler, making a deep copy.
Definition: gsPoissonAssembler.h:108
Provides generic assembler routines.
gsOptionList m_options
Options.
Definition: gsAssembler.h:285
std::vector< gsMultiBasis< T > > m_bases
Definition: gsAssembler.h:282
gsEigen::SparseSelfAdjointView< typename gsSparseMatrix< T >::Base, Lower > fullMatrix()
Definition: gsPoissonAssembler.h:128
const gsMatrix< T > & rhs() const
Returns the left-hand side vector(s) ( multiple right hand sides possible )
Definition: gsAssembler.h:618
A function from a n-dimensional domain to an m-dimensional image.
Definition: gsFunction.h:59
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
const gsSparseMatrix< T > & matrix() const
Access the system Matrix.
Definition: gsSparseSystem.h:394
Holds a set of patch-wise bases and their topology information.
Definition: gsMultiBasis.h:36
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
static gsOptionList defaultOptions()
Returns the list of default options for assembly.
Definition: gsPoissonAssembler.hpp:24
gsPoissonAssembler(gsMultiPatch< T > const &patches, gsMultiBasis< T > const &basis, gsBoundaryConditions< T > const &bconditions, const gsFunction< T > &rhs, dirichlet::strategy dirStrategy=dirichlet::elimination, iFace::strategy intStrategy=iFace::glue)
Constructor of the assembler object.
Definition: gsPoissonAssembler.h:93
A Poisson PDE.
Definition: gsPoissonPde.h:34
gsPoissonAssembler(const gsPoissonPde< T > &pde, const gsMultiBasis< T > &bases)
Main Constructor of the assembler object.
Definition: gsPoissonAssembler.h:54
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition: gsMultiPatch.h:33
const gsPde< T > & pde() const
Return the Pde.
Definition: gsAssembler.h:598
gsSparseSystem< T > m_system
Global sparse linear system.
Definition: gsAssembler.h:290
virtual void refresh()
Creates the mappers and setups the sparse system. to be implemented in derived classes, see scalarProblemGalerkinRefresh() for a possible implementation.
Definition: gsPoissonAssembler.hpp:33
std::vector< gsMatrix< T > > m_ddof
Definition: gsAssembler.h:295
virtual void assemble()
Main assemble routine, to be implemented in derived classes.
Definition: gsPoissonAssembler.hpp:41
Class containing a set of boundary conditions.
Definition: gsBoundaryConditions.h:341
gsPoissonAssembler(const gsPoissonPde< T > &pde, const gsMultiBasis< T > &bases, dirichlet::strategy dirStrategy, iFace::strategy intStrategy=iFace::glue)
Main Constructor of the assembler object.
Definition: gsPoissonAssembler.h:69
virtual gsAssembler< T > * create() const
Create an empty Assembler of the derived type and return a pointer to it. Call the initialize functio...
Definition: gsPoissonAssembler.h:113
Class which holds a list of parameters/options, and provides easy access to them. ...
Definition: gsOptionList.h:32
The assembler class provides generic routines for volume and boundary integrals that are used for for...
Definition: gsAssembler.h:265
Implementation of an (multiple right-hand side) Poisson assembler.
Definition: gsPoissonAssembler.h:36