00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef SUNDANCE_ATOCPOINTLOCATOR_H
00032 #define SUNDANCE_ATOCPOINTLOCATOR_H
00033
00034 #include "SundanceDefs.hpp"
00035 #include "SundanceMesh.hpp"
00036 #include "SundanceExpr.hpp"
00037 #include "SundanceCellFilter.hpp"
00038
00039 namespace Sundance
00040 {
00041 using namespace Sundance;
00042 using namespace Sundance;
00043 using namespace Sundance;
00044 using namespace Sundance;
00045 using namespace Sundance;
00046 using namespace Teuchos;
00047
00048
00049
00050
00051
00052
00053
00054 class AToCPointLocator
00055 {
00056 public:
00057
00058 AToCPointLocator(const Mesh& mesh,
00059 const CellFilter& subdomain,
00060 const std::vector<int>& nx);
00061
00062
00063
00064
00065 int getGridIndex(const double* x) const ;
00066
00067
00068 int guessCell(const double* x) const
00069 {return (*table_)[getGridIndex(x)];}
00070
00071
00072 int findEnclosingCell(int initialGuessLID, const double* x) const ;
00073
00074
00075
00076 int findEnclosingCell(int initialGuessLID, const double* x,
00077 double* localCoords) const ;
00078
00079
00080 void fillMaximalNeighbors(int cellLID, const int* facetLID) const ;
00081
00082
00083 bool cellContainsPoint(int cellLID,
00084 const double* x,
00085 const int* facetLID) const ;
00086
00087
00088
00089 bool cellContainsPoint(int cellLID,
00090 const double* x,
00091 const int* facetLID,
00092 double* localCoords) const ;
00093
00094
00095 const Mesh& mesh() const {return mesh_;}
00096
00097
00098 const CellFilter& subdomain() const {return subdomain_;}
00099
00100
00101
00102
00103 static Point makePoint(int dim, const double* x) ;
00104 private:
00105
00106
00107
00108 void getGridRange(const Mesh& mesh, int cellDim, int cellLID,
00109 Array<int>& lowIndex, Array<int>& highIndex) const;
00110
00111
00112
00113
00114 int dim_;
00115 Mesh mesh_;
00116 int nFacets_;
00117 std::vector<int> nx_;
00118 Array<double> low_;
00119 Array<double> high_;
00120 Array<double> dx_;
00121 RCP<Array<int> > table_;
00122 CellFilter subdomain_;
00123 mutable Array<RCP<Set<int> > > neighborSet_;
00124 };
00125 }
00126
00127
00128 #endif