G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
gsPoissonAssembler.hpp
Go to the documentation of this file.
1
15#include <gsAssembler/gsVisitorPoisson.h> // Stiffness volume integrals
16#include <gsAssembler/gsVisitorNeumann.h> // Neumann boundary integrals
17#include <gsAssembler/gsVisitorNitsche.h> // Nitsche boundary integrals
18#include <gsAssembler/gsVisitorDg.h> // DG interface integrals
19
20namespace gismo
21{
22
23template <class T>
25{
27 options.update( gsVisitorDg<T>::defaultOptions(), gsOptionList::addIfUnknown );
28 options.update( gsVisitorNitsche<T>::defaultOptions(), gsOptionList::addIfUnknown );
29 return options;
30}
31
32template<class T>
34{
35 // We use predefined helper which initializes the system matrix
36 // rows and columns using the same test and trial space
37 Base::scalarProblemGalerkinRefresh();
38}
39
40template<class T>
42{
43 GISMO_ASSERT(m_system.initialized(),
44 "Sparse system is not initialized, call initialize() or refresh()");
45
46 // Reserve sparse system
47 m_system.reserve(m_bases[0], m_options, this->pde().numRhs());
48
49 // Compute the Dirichlet Degrees of freedom (if needed by m_options)
50 Base::computeDirichletDofs();
51
52 // Clean the sparse system
53 // m_system.setZero(); //<< this call leads to a quite significant performance degrade!
54
55 // Assemble volume integrals
56 Base::template push<gsVisitorPoisson<T> >();
57
58 // Enforce Neumann boundary conditions
59 Base::template push<gsVisitorNeumann<T> >(m_pde_ptr->bc().neumannSides() );
60
61 switch (m_options.getInt("DirichletStrategy"))
62 {
63 case dirichlet::penalize:
64 Base::penalizeDirichletDofs();
65 break;
66 case dirichlet::nitsche:
67 Base::template push<gsVisitorNitsche<T> >(m_pde_ptr->bc().dirichletSides());
68 break;
69 default:
70 break;
71 }
72
73 if ( m_options.getInt("InterfaceStrategy") == iFace::dg )
74 Base::template pushInterface<gsVisitorDg<T> >();
75
76 // Assembly is done, compress the matrix
77 Base::finalize();
78}
79
80
81}// namespace gismo
static gsOptionList defaultOptions()
Returns the list of default options for assembly.
Definition gsAssembler.hpp:30
Class which holds a list of parameters/options, and provides easy access to them.
Definition gsOptionList.h:33
void update(const gsOptionList &other, updateType type=ignoreIfUnknown)
Updates the object using the data from other.
Definition gsOptionList.cpp:253
virtual void refresh()
Creates the mappers and setups the sparse system. to be implemented in derived classes,...
Definition gsPoissonAssembler.hpp:33
virtual void assemble()
Main assemble routine, to be implemented in derived classes.
Definition gsPoissonAssembler.hpp:41
static gsOptionList defaultOptions()
Returns the list of default options for assembly.
Definition gsPoissonAssembler.hpp:24
Visitor for adding the interface conditions for the interior penalty methods of the Poisson problem.
Definition gsVisitorDg.h:52
Visitor for adding the terms associated to weak (Nitsche-type) imposition of the Dirichlet boundary c...
Definition gsVisitorNitsche.h:55
#define GISMO_ASSERT(cond, message)
Definition gsDebug.h:89
Visitor for adding the interface conditions for the interior penalty methods of the Poisson problem.
Neumann conditions visitor for elliptic problems.
Weak (Nitsche-type) imposition of the Dirichlet boundary conditions.
Poisson equation element visitor.
The G+Smo namespace, containing all definitions for the library.