libMesh
condensed_eigen_system.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2019 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 #ifndef LIBMESH_CONDENSED_EIGEN_SYSTEM_H
20 #define LIBMESH_CONDENSED_EIGEN_SYSTEM_H
21 
22 #include "libmesh/libmesh_config.h"
23 
24 // Currently, the EigenSystem should only be available
25 // if SLEPc support is enabled.
26 #if defined(LIBMESH_HAVE_SLEPC)
27 
28 // Local Includes
29 #include "libmesh/eigen_system.h"
30 #include "libmesh/sparse_matrix.h"
31 
32 namespace libMesh
33 {
34 
47 {
48 public:
49 
55  const std::string & name_in,
56  const unsigned int number_in);
57 
62 
67 
71  sys_type & system () { return *this; }
72 
85  void initialize_condensed_dofs(const std::set<dof_id_type> &
86  global_condensed_dofs_set =
87  std::set<dof_id_type>());
88 
93 
99  virtual void solve() override;
100 
107  virtual std::pair<Real, Real> get_eigenpair(dof_id_type i) override;
108 
112  std::unique_ptr<SparseMatrix<Number>> condensed_matrix_A;
113 
117  std::unique_ptr<SparseMatrix<Number>> condensed_matrix_B;
118 
124  std::vector<dof_id_type> local_non_condensed_dofs_vector;
125 
126 private:
127 
133 };
134 
135 
136 } // namespace libMesh
137 
138 
139 #endif // LIBMESH_HAVE_SLEPC
140 
141 #endif // LIBMESH_CONDENSED_EIGEN_SYSTEM_H
libMesh::CondensedEigenSystem::condensed_matrix_B
std::unique_ptr< SparseMatrix< Number > > condensed_matrix_B
A second (condensed) system matrix for generalized eigenvalue problems.
Definition: condensed_eigen_system.h:117
libMesh::dof_id_type
uint8_t dof_id_type
Definition: id_types.h:67
libMesh::CondensedEigenSystem::solve
virtual void solve() override
Override to solve the condensed eigenproblem with the dofs in local_non_condensed_dofs_vector strippe...
Definition: condensed_eigen_system.C:91
libMesh
The libMesh namespace provides an interface to certain functionality in the library.
Definition: factoryfunction.C:55
libMesh::CondensedEigenSystem::system
sys_type & system()
Definition: condensed_eigen_system.h:71
libMesh::CondensedEigenSystem::get_eigenpair
virtual std::pair< Real, Real > get_eigenpair(dof_id_type i) override
Override get_eigenpair() to retrieve the eigenpair for the condensed eigensolve.
Definition: condensed_eigen_system.C:177
libMesh::CondensedEigenSystem::CondensedEigenSystem
CondensedEigenSystem(EquationSystems &es, const std::string &name_in, const unsigned int number_in)
Constructor.
Definition: condensed_eigen_system.C:36
libMesh::CondensedEigenSystem
This class extends EigenSystem to allow a simple way of solving (standard or generalized) eigenvalue ...
Definition: condensed_eigen_system.h:46
libMesh::CondensedEigenSystem::initialize_condensed_dofs
void initialize_condensed_dofs(const std::set< dof_id_type > &global_condensed_dofs_set=std::set< dof_id_type >())
Loop over the dofs on each processor to initialize the list of non-condensed dofs.
Definition: condensed_eigen_system.C:47
libMesh::EquationSystems
This is the EquationSystems class.
Definition: equation_systems.h:74
libMesh::CondensedEigenSystem::local_non_condensed_dofs_vector
std::vector< dof_id_type > local_non_condensed_dofs_vector
Vector storing the local dof indices that will not be condensed.
Definition: condensed_eigen_system.h:124
libMesh::CondensedEigenSystem::sys_type
CondensedEigenSystem sys_type
The type of system.
Definition: condensed_eigen_system.h:61
libMesh::CondensedEigenSystem::Parent
EigenSystem Parent
The type of the parent.
Definition: condensed_eigen_system.h:66
libMesh::EigenSystem
Manages consistently variables, degrees of freedom, and coefficient vectors for eigenvalue problems.
Definition: eigen_system.h:55
libMesh::CondensedEigenSystem::condensed_matrix_A
std::unique_ptr< SparseMatrix< Number > > condensed_matrix_A
The (condensed) system matrix for standard eigenvalue problems.
Definition: condensed_eigen_system.h:112
libMesh::CondensedEigenSystem::condensed_dofs_initialized
bool condensed_dofs_initialized
A private flag to indicate whether the condensed dofs have been initialized.
Definition: condensed_eigen_system.h:132
libMesh::CondensedEigenSystem::n_global_non_condensed_dofs
dof_id_type n_global_non_condensed_dofs() const
Definition: condensed_eigen_system.C:74