00001 /* 00002 00003 umesh2dgui, a GUI for umesh2d grid generator 00004 00005 Copyright (C) 2010 Gabriele Dini Ciacci <dark.schneider@iol.it> 00006 Based on a code from Luigi Quartapelle and Massimo Biava 00007 00008 This program is free software; you can redistribute it and/or modify 00009 it under the terms of the GNU General Public License as published by 00010 the Free Software Foundation; either version 2 of the License, or 00011 (at your option) any later version. 00012 00013 This program is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with this program; if not, write to the Free Software 00020 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00021 00022 Created on January 20, 2010, 12:30 PM 00023 */ 00024 00025 #ifndef U2D_DIRICHLETCONDITION_H 00026 #define U2D_DIRICHLETCONDITION_H 00027 00028 #include <iostream> 00029 #include <set> // for std::set 00030 #include <vector> // for std::vector 00031 00032 #include "boost/numeric/mtl/mtl.hpp" 00033 #include "u2d_mesh.h" 00034 00035 00036 using namespace std; 00037 00038 class u2d_DirichletCondition { 00039 public: 00040 u2d_DirichletCondition(); 00041 u2d_DirichletCondition(const u2d_DirichletCondition& orig); 00042 virtual ~u2d_DirichletCondition(); 00043 int setSide(int side_id); 00044 bool isDirichlet(int side_id); 00045 void generateNodes(u2d_Mesh* mesh); 00046 00047 dense_vector<int> dirichlet_nodes; /* Nodes where to enforce Dirichlet condition */ 00048 set<int> dirichlet_unique_nodes; /* *Unique* nodes where to enforce Dirichlet condition */ 00049 private: 00050 void countNodes(u2d_Mesh *mesh); 00051 int dirichlet_nodes_n; 00052 int dirichlet_unique_nodes_n; 00053 std::vector<int> dir_sides; 00054 00055 00056 00057 }; 00058 00059 #endif /* U2D_DIRICHLETCONDITION_H */ 00060