dirichlet_boundaries.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_DIRICHLET_BOUNDARIES_H 00021 #define LIBMESH_DIRICHLET_BOUNDARIES_H 00022 00023 #include "libmesh/libmesh_config.h" 00024 00025 #ifdef LIBMESH_ENABLE_DIRICHLET 00026 00027 // Local Includes ----------------------------------- 00028 #include "libmesh/function_base.h" 00029 #include "libmesh/id_types.h" 00030 #include "libmesh/vector_value.h" 00031 00032 // C++ Includes ----------------------------------- 00033 #include <algorithm> 00034 #include <cstddef> 00035 #include <iterator> 00036 #include <set> 00037 #include <string> 00038 #include <vector> 00039 00040 namespace libMesh 00041 { 00042 00043 class DirichletBoundary 00044 { 00045 public: 00046 DirichletBoundary(const std::set<boundary_id_type> &b_in, 00047 const std::vector<unsigned int>& variables_in, 00048 const FunctionBase<Number> *f_in, 00049 const FunctionBase<Gradient> *g_in = NULL) : 00050 b(b_in), 00051 variables(variables_in), 00052 f(f_in ? f_in->clone() : AutoPtr<FunctionBase<Number> >(NULL)), 00053 g(g_in ? g_in->clone() : AutoPtr<FunctionBase<Gradient> >(NULL)) 00054 { 00055 libmesh_assert(f.get()); 00056 f->init(); 00057 if (g.get()) 00058 g->init(); 00059 } 00060 00061 DirichletBoundary (const DirichletBoundary &dirichlet_in) : 00062 b(dirichlet_in.b), 00063 variables(dirichlet_in.variables), 00064 f(dirichlet_in.f.get() ? dirichlet_in.f->clone() : AutoPtr<FunctionBase<Number> >(NULL)), 00065 g(dirichlet_in.g.get() ? dirichlet_in.g->clone() : AutoPtr<FunctionBase<Gradient> >(NULL)) 00066 { 00067 libmesh_assert(f.get()); 00068 f->init(); 00069 if (g.get()) 00070 g->init(); 00071 } 00072 00073 std::set<boundary_id_type> b; 00074 std::vector<unsigned int> variables; 00075 AutoPtr<FunctionBase<Number> > f; 00076 AutoPtr<FunctionBase<Gradient> > g; 00077 }; 00078 00079 00085 class DirichletBoundaries : public std::vector<DirichletBoundary *> 00086 { 00087 public: 00088 DirichletBoundaries() {} 00089 00090 ~DirichletBoundaries(); 00091 }; 00092 00093 } // namespace libMesh 00094 00095 #endif // LIBMESH_ENABLE_DIRICHLET 00096 00097 #endif // LIBMESH_DIRICHLET_BOUNDARIES_H
Site Created By: libMesh Developers
Last modified: February 05 2013 19:54:46 UTC
Hosted By: