G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsCDRAssembler.hpp
Go to the documentation of this file.
1 
16 
17 #include <gsAssembler/gsVisitorPoisson.h> // Stiffness volume integrals
18 #include <gsAssembler/gsVisitorCDR.h> //
19 #include <gsAssembler/gsVisitorNeumann.h> // Neumann boundary integrals
20 #include <gsAssembler/gsVisitorNitsche.h> // Nitsche boundary integrals
21 #include <gsAssembler/gsVisitorDg.h> // Disc. Galerkin interface integrals
22 
23 //#include <gsAssembler/gsAssemblerUtils.h>
24 
25 namespace gismo
26 {
27 
28 template <class T>
30 {
32  options.update( gsVisitorNitsche<T>::defaultOptions(), gsOptionList::addIfUnknown );
33  return options;
34 }
35 
36 template<class T>
38 {
39  GISMO_ASSERT(m_system.initialized(),
40  "Sparse system is not initialized, call initialize() or refresh()");
41 
42  // Reserve sparse system
43  m_system.reserve(m_bases[0], m_options, this->pde().numRhs());
44 
45  // Compute the Dirichlet Degrees of freedom (if needed by m_options)
46  Base::computeDirichletDofs();
47 
48  if (0 == this->numDofs()) // Are there any interior dofs ?
49  {
50  gsWarn << " No internal DOFs. Computed Dirichlet boundary only.\n" << "\n";
51  return;
52  }
53 
54  // Assemble volume integrals
55  Base::template push<gsVisitorCDR<T> >();
56 
57  // Enforce Neumann boundary conditions
58  Base::template push<gsVisitorNeumann<T> >(m_pde_ptr->bc().neumannSides());
59 
60  // If requested, enforce Dirichlet boundary conditions by Nitsche's method
61  if (m_options.getInt("DirichletStrategy") == dirichlet::nitsche)
62  Base::template push<gsVisitorNitsche<T> >(m_pde_ptr->bc().dirichletSides());
63 
64  // If requested, enforce Dirichlet boundary conditions by diagonal penalization
65  else if (m_options.getInt("DirichletStrategy") == dirichlet::penalize)
66  Base::penalizeDirichletDofs();
67 
68  // If we are in in dg (Discontinuous Galerkin) mode: add
69  // interface contributions
70  if (m_options.getInt("InterfaceStrategy") == iFace::dg)
71  gsWarn << "DG option is ignored.\n";
72 
73  // Assembly is done, compress the matrix
74  Base::finalize();
75 }
76 
77 } // namespace gismo
Neumann conditions visitor for elliptic problems.
Visitor for adding the interface conditions for the interior penalty methods of the Poisson problem...
void assemble()
Main assembly routine.
Definition: gsCDRAssembler.hpp:37
Provides assembler and solver options.
#define GISMO_ASSERT(cond, message)
Definition: gsDebug.h:89
#define gsWarn
Definition: gsDebug.h:50
static gsOptionList defaultOptions()
Returns the list of default options for assembly.
Definition: gsCDRAssembler.hpp:29
Weak (Nitsche-type) imposition of the Dirichlet boundary conditions.
Visitor for adding the terms associated to weak (Nitsche-type) imposition of the Dirichlet boundary c...
Definition: gsVisitorNitsche.h:54
void update(const gsOptionList &other, updateType type=ignoreIfUnknown)
Updates the object using the data from other.
Definition: gsOptionList.cpp:253
Poisson equation element visitor.
Visitor for the convection-diffusion-reaction equation.
Class which holds a list of parameters/options, and provides easy access to them. ...
Definition: gsOptionList.h:32
static gsOptionList defaultOptions()
Returns the list of default options for assembly.
Definition: gsAssembler.hpp:30