G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
gsPoissonAssembler.h
Go to the documentation of this file.
1
14#pragma once
15
17#include <gsPde/gsPoissonPde.h>
18
19
20namespace gismo
21{
22
35template <class T>
37{
38public:
39 typedef gsAssembler<T> Base;
40
41public:
42
45
47 { }
48
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
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) );
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 using Base::assemble;
123 virtual void assemble();
124
129 gsEigen::SparseSelfAdjointView< typename gsSparseMatrix<T>::Base, Lower> fullMatrix()
130 {
131 return m_system.matrix().template selfadjointView<Lower>();
132 }
133
134
135protected:
136
137 // Members from gsAssembler
138 using Base::m_pde_ptr;
139 using Base::m_bases;
140 using Base::m_ddof;
141 using Base::m_options;
142 using Base::m_system;
143};
144
145
146} // namespace gismo
147
148
149#ifndef GISMO_BUILD_LIB
150#include GISMO_HPP_HEADER(gsPoissonAssembler.hpp)
151#endif
The assembler class provides generic routines for volume and boundary integrals that are used for for...
Definition gsAssembler.h:266
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
const gsMatrix< T > & rhs() const
Returns the left-hand side vector(s) ( multiple right hand sides possible )
Definition gsAssembler.h:618
gsSparseSystem< T > m_system
Global sparse linear system.
Definition gsAssembler.h:290
std::vector< gsMultiBasis< T > > m_bases
Definition gsAssembler.h:282
gsOptionList m_options
Options.
Definition gsAssembler.h:285
virtual void assemble()
Main assemble routine, to be implemented in derived classes.
Definition gsAssembler.hpp:51
const gsPde< T > & pde() const
Return the Pde.
Definition gsAssembler.h:598
memory::shared_ptr< gsPde< T > > m_pde_ptr
Definition gsAssembler.h:276
std::vector< gsMatrix< T > > m_ddof
Definition gsAssembler.h:295
const gsMultiPatch< T > & patches() const
Return the multipatch.
Definition gsAssembler.h:601
Class containing a set of boundary conditions.
Definition gsBoundaryConditions.h:342
A function from a n-dimensional domain to an m-dimensional image.
Definition gsFunction.h:60
Holds a set of patch-wise bases and their topology information.
Definition gsMultiBasis.h:37
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition gsMultiPatch.h:100
Class which holds a list of parameters/options, and provides easy access to them.
Definition gsOptionList.h:33
void setInt(const std::string &label, const index_t &value)
Sets an existing option label to be equal to value.
Definition gsOptionList.cpp:158
Implementation of an (multiple right-hand side) Poisson assembler.
Definition gsPoissonAssembler.h:37
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
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,...
Definition gsPoissonAssembler.hpp:33
gsPoissonAssembler(const gsPoissonPde< T > &pde, const gsMultiBasis< T > &bases)
Main Constructor of the assembler object.
Definition gsPoissonAssembler.h:54
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
gsOptionList m_options
Options.
Definition gsAssembler.h:285
virtual gsAssembler< T > * clone() const
Clone this Assembler, making a deep copy.
Definition gsPoissonAssembler.h:108
virtual void assemble()
Main assemble routine, to be implemented in derived classes.
Definition gsPoissonAssembler.hpp:41
gsEigen::SparseSelfAdjointView< typename gsSparseMatrix< T >::Base, Lower > fullMatrix()
Definition gsPoissonAssembler.h:129
static gsOptionList defaultOptions()
Returns the list of default options for assembly.
Definition gsPoissonAssembler.hpp:24
A Poisson PDE.
Definition gsPoissonPde.h:35
const gsSparseMatrix< T > & matrix() const
Access the system Matrix.
Definition gsSparseSystem.h:394
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
Provides generic assembler routines.
Describes a Poisson PDE.
The G+Smo namespace, containing all definitions for the library.