00001 /**************************************************************************** 00002 * * 00003 * Program: FDDlib * 00004 * Version: 1.1 * 00005 * * 00006 * Copyright (C) 2002 - 2004 by Eric Miller and Dana Brooks * 00007 * All rights reserved. * 00008 * * 00009 * This software is Version 1.1 of the fddlib tomography toolbox. * 00010 * It is not to be redistributed or used for any commercial purpose * 00011 * without the prior written consent of the authors and Northeastern * 00012 * University. * 00013 * * 00014 * This software is provided as is, and any express or implied warranties, * 00015 * including but not limited to the implied warranty of merchantability * 00016 * and the implied warranty of fitness for a particular purpose, are dis- * 00017 * claimed. In no event shall the authors or Northeastern University be * 00018 * liable for any direct, indirect, incidental, special, exemplary, or * 00019 * consequential damages (including but not limited to procurement of * 00020 * substitute goods or services; loss of use, data, or profits; or busi- * 00021 * ness interruption) however caused and on any theory of liability, * 00022 * whether in contract, strict liability, or tort (including negligence or * 00023 * otherwise) arising in any way from the use of this software, even if * 00024 * advised of the possibility of such damage. * 00025 * * 00026 * Portions of this code benefit from ideas from Kyle Guilbert, Greg * 00027 * Boverman, Derek Uluski, David Kaeli, and Jennifer Black * 00028 * * 00029 ****************************************************************************/ 00030 00031 #ifndef _BCMIXED2D_H_ 00032 #define _BCMIXED2D_H_ 00033 00034 #include "SparseRowMatrix.h" 00035 #include "BoundaryCondition2D.h" 00036 #include "ArbitraryCartesianGrid2D.h" 00037 #include "CartesianNode2D.h" 00038 #include <string> 00039 00040 // Minimum value for each component of normal vector 00041 #define BC_NORMTOL 1.0e-10 00042 00043 namespace FDDlib { 00044 00049 class BCMixed2D : public BoundaryCondition2D { 00050 protected: 00051 00053 struct s_neighbordata { 00055 CartesianNode2D* n_node; 00057 bool n_borderNode; 00059 int n_linearIndex; 00060 }; 00061 00066 bool activeAndInternal(const s_neighbordata& ndata) const; 00067 00069 double a_; 00070 00072 const static int UNKNOWN_VALUE = -10; 00073 00075 void resetData(std::vector<s_neighbordata>& datavec) const; 00076 00077 public: 00081 BCMixed2D(double a); 00082 00087 virtual void apply(const ArbitraryCartesianGrid2D& grid, 00088 SparseRowMatrix<double>& A) const throw(std::string); 00089 00091 double getA() const; 00092 00094 void setA(double a); 00095 00096 }; 00097 } 00098 00099 #endif
1.2.18