system_subset_by_subdomain.h
Go to the documentation of this file.00001 // The libMesh Finite Element Library. 00002 // Copyright (C) 2002-2012 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner 00003 00004 // This library is free software; you can redistribute it and/or 00005 // modify it under the terms of the GNU Lesser General Public 00006 // License as published by the Free Software Foundation; either 00007 // version 2.1 of the License, or (at your option) any later version. 00008 00009 // This library is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 // Lesser General Public License for more details. 00013 00014 // You should have received a copy of the GNU Lesser General Public 00015 // License along with this library; if not, write to the Free Software 00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 00018 00019 00020 #ifndef LIBMESH_SYSTEM_SUBSET_BY_SUBDOMAIN_H 00021 #define LIBMESH_SYSTEM_SUBSET_BY_SUBDOMAIN_H 00022 00023 // Local Includes 00024 #include "libmesh/system_subset.h" 00025 #include "libmesh/id_types.h" 00026 00027 // C++ includes 00028 #include <cstddef> 00029 #include <set> 00030 00031 namespace libMesh 00032 { 00033 00034 // Forward Declarations 00035 00044 // ------------------------------------------------------------ 00045 // SystemSubset class definition 00046 class SystemSubsetBySubdomain : public SystemSubset 00047 { 00048 public: 00049 00054 class SubdomainSelection : public ReferenceCountedObject<SubdomainSelection> 00055 { 00056 public: 00057 00061 SubdomainSelection (void); 00062 00066 virtual ~SubdomainSelection (void); 00067 00072 virtual bool operator()(const subdomain_id_type& subdomain_id)const=0; 00073 00074 private: 00081 SubdomainSelection(const SubdomainSelection&); 00082 00089 SubdomainSelection& operator=(const SubdomainSelection&); 00090 00091 }; // subclass \p SubdomainSelection 00092 00096 class SubdomainSelectionByList : public SubdomainSelection 00097 { 00098 public: 00103 explicit 00104 SubdomainSelectionByList (const std::set<subdomain_id_type>& list); 00105 00110 virtual bool operator()(const subdomain_id_type& subdomain_id)const; 00111 00112 protected: 00116 const std::set<subdomain_id_type>& _list; 00117 }; 00118 00127 SystemSubsetBySubdomain (const System& system, 00128 const SubdomainSelection& subdomain_selection, 00129 const std::set<unsigned int>* const var_nums = NULL); 00130 00139 SystemSubsetBySubdomain (const System& system, 00140 const std::set<subdomain_id_type>& subdomain_ids, 00141 const std::set<unsigned int>* const var_nums = NULL); 00142 00146 virtual ~SystemSubsetBySubdomain (); 00147 00153 virtual const std::vector<unsigned int>& dof_ids(void)const; 00154 00162 void init (const SubdomainSelection& subdomain_selection); 00163 00171 void init (const std::set<subdomain_id_type>& subdomain_ids); 00172 00173 protected: 00174 00179 void set_var_nums (const std::set<unsigned int>* const var_nums); 00180 00187 std::set<unsigned int> _var_nums; 00188 00192 std::vector<unsigned int> _dof_ids; 00193 00194 }; // class SystemSubset 00195 00196 } // namespace libMesh 00197 00198 #endif // LIBMESH_SYSTEM_SUBSET_BY_SUBDOMAIN_H 00199
Site Created By: libMesh Developers
Last modified: February 05 2013 19:54:48 UTC
Hosted By: