$extrastylesheet
periodic_boundary_base.h
Go to the documentation of this file.
00001 
00002 // The libMesh Finite Element Library.
00003 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
00004 
00005 // This library is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public
00007 // License as published by the Free Software Foundation; either
00008 // version 2.1 of the License, or (at your option) any later version.
00009 
00010 // This library is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with this library; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 
00019 #ifndef LIBMESH_PERIODIC_BOUNDARY_BASE_H
00020 #define LIBMESH_PERIODIC_BOUNDARY_BASE_H
00021 
00022 // Local Includes -----------------------------------
00023 #include "libmesh/libmesh_config.h"
00024 
00025 #ifdef LIBMESH_ENABLE_PERIODIC
00026 
00027 // Local Includes -----------------------------------
00028 #include "libmesh/point.h"
00029 #include "libmesh/auto_ptr.h"
00030 
00031 // C++ Includes   -----------------------------------
00032 #include <set>
00033 
00034 namespace libMesh {
00035 
00036 // Forward Declarations
00037 class Elem;
00038 class MeshBase;
00039 
00043 class PeriodicBoundaryBase
00044 {
00045 public:
00046   enum TransformationType
00047     { FORWARD=0,
00048       INVERSE=1 };
00049 
00053   boundary_id_type myboundary, pairedboundary;
00054 
00058   PeriodicBoundaryBase();
00059 
00063   PeriodicBoundaryBase(const PeriodicBoundaryBase& other);
00064 
00068   virtual ~PeriodicBoundaryBase() {}
00069 
00075   virtual Point get_corresponding_pos(const Point & pt) const = 0;
00076 
00088   virtual UniquePtr<PeriodicBoundaryBase> clone(TransformationType t = FORWARD) const = 0;
00089 
00090   void set_variable(unsigned int var);
00091 
00092   void merge(const PeriodicBoundaryBase & pb);
00093 
00094   bool is_my_variable(unsigned int var_num) const;
00095 
00096 protected:
00097 
00101   std::set<unsigned int> variables;
00102 };
00103 
00104 } // namespace libmesh
00105 
00106 #endif // LIBMESH_ENABLE_PERIODIC
00107 
00108 #endif // LIBMESH_PERIODIC_BOUNDARY_BASE_H