00001 // This file is part of ff3d - http://www.freefem.org/ff3d 00002 // Copyright (C) 2001, 2002, 2003 Stéphane Del Pino 00003 00004 // This program is free software; you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation; either version 2, or (at your option) 00007 // any later version. 00008 00009 // This program 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 00012 // GNU General Public License for more details. 00013 00014 // You should have received a copy of the GNU General Public License 00015 // along with this program; if not, write to the Free Software Foundation, 00016 // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 00018 // $Id: SurfElem.hpp,v 1.7 2007/06/09 10:37:06 delpinux Exp $ 00019 00020 // This is the base class used to deal with Surfacic Elements 00021 00022 #ifndef SURF_ELEM_HPP 00023 #define SURF_ELEM_HPP 00024 00025 #include <Cell.hpp> 00026 00027 #include <limits> 00028 00039 class SurfElem 00040 : public Cell 00041 { 00042 protected: 00047 const Cell* __motherCell; 00048 size_t __motherCellFaceNumber; 00049 00050 public: 00055 const Cell& mother() const 00056 { 00057 ASSERT(__motherCell!=0); 00058 return *__motherCell; 00059 } 00060 00065 size_t motherCellFaceNumber() const 00066 { 00067 ASSERT(__motherCell!=0); 00068 return __motherCellFaceNumber; 00069 } 00070 00075 void setMother(const Cell* cell, 00076 const size_t faceNumber) 00077 { 00078 __motherCell = cell; 00079 __motherCellFaceNumber = faceNumber; 00080 } 00081 00089 inline const SurfElem& operator = (const SurfElem& S) 00090 { 00091 Cell::operator=(S); 00092 __motherCell = S.__motherCell; 00093 __motherCellFaceNumber = S.__motherCellFaceNumber; 00094 00095 return *this; 00096 } 00097 00104 virtual const TinyVector<3,real_t> normal() const = 0; 00105 00106 SurfElem(const size_t& numberOfVertices, 00107 const size_t& reference = 0) 00108 : Cell(numberOfVertices, reference), 00109 __motherCell(0), 00110 __motherCellFaceNumber(std::numeric_limits<size_t>::max()) 00111 { 00112 ; 00113 } 00114 00115 SurfElem(const SurfElem& s) 00116 : Cell(s), 00117 __motherCell(s.__motherCell), 00118 __motherCellFaceNumber(s.__motherCellFaceNumber) 00119 { 00120 ; 00121 } 00122 00124 virtual ~SurfElem() 00125 { 00126 ; 00127 } 00128 }; 00129 00130 00131 #endif // SURF_ELEM_HPP
1.5.6