system_subset_by_subdomain.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2014 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 
20 #ifndef LIBMESH_SYSTEM_SUBSET_BY_SUBDOMAIN_H
21 #define LIBMESH_SYSTEM_SUBSET_BY_SUBDOMAIN_H
22 
23 // Local Includes
24 #include "libmesh/system_subset.h"
25 #include "libmesh/id_types.h"
27 
28 // C++ includes
29 #include <cstddef>
30 #include <set>
31 
32 namespace libMesh
33 {
34 
35 // Forward Declarations
36 
45 // ------------------------------------------------------------
46 // SystemSubset class definition
48  public ParallelObject
49 {
50 public:
51 
56  class SubdomainSelection : public ReferenceCountedObject<SubdomainSelection>
57  {
58  public:
59 
63  SubdomainSelection (void);
64 
68  virtual ~SubdomainSelection (void);
69 
74  virtual bool operator()(const subdomain_id_type& subdomain_id)const=0;
75 
76  private:
84 
92 
93  }; // subclass \p SubdomainSelection
94 
99  {
100  public:
105  explicit
106  SubdomainSelectionByList (const std::set<subdomain_id_type>& list);
107 
112  virtual bool operator()(const subdomain_id_type& subdomain_id)const;
113 
114  protected:
118  const std::set<subdomain_id_type>& _list;
119  };
120 
129  SystemSubsetBySubdomain (const System& system,
130  const SubdomainSelection& subdomain_selection,
131  const std::set<unsigned int>* const var_nums = NULL);
132 
141  SystemSubsetBySubdomain (const System& system,
142  const std::set<subdomain_id_type>& subdomain_ids,
143  const std::set<unsigned int>* const var_nums = NULL);
144 
148  virtual ~SystemSubsetBySubdomain ();
149 
155  virtual const std::vector<unsigned int>& dof_ids(void)const;
156 
164  void init (const SubdomainSelection& subdomain_selection);
165 
173  void init (const std::set<subdomain_id_type>& subdomain_ids);
174 
175 protected:
176 
181  void set_var_nums (const std::set<unsigned int>* const var_nums);
182 
189  std::set<unsigned int> _var_nums;
190 
194  std::vector<unsigned int> _dof_ids;
195 
196 }; // class SystemSubset
197 
198 } // namespace libMesh
199 
200 #endif // LIBMESH_SYSTEM_SUBSET_BY_SUBDOMAIN_H

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:07 UTC

Hosted By:
SourceForge.net Logo