OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
grid.h
Go to the documentation of this file.
1 #ifndef grid_h
2 #define grid_h
3 
4 #include "floatmatrix.h"
5 #include "heap.h"
6 
7 namespace oofem {
32 class Grid
33 {
34 public:
36  Grid(int N, int M);
38  ~Grid();
39 
41  int giveSizeHorizontal() { return n; }
42  int giveSizeVertical() { return m; }
43  int giveSize(int dir);
44 
46  void unFreeze();
47 
49  void setMethod(int o, double i, int c) { order = o; initDiag = i; centDiff = c; }
50 
52  //void setPrescribedField(double *PF);
53  void setPrescribedFieldValue(int i, int j, double val) { F->at(i, j) = val; }
55 
57  void setZeroValues(FloatMatrix *gridCoords);
58  void setSolutionValueAt(int i, int j, double value);
59 
61  double giveSolutionValueAt(int i, int j);
62  void printSolutionAsData();
63 
64 
65 private:
67  int n, m;
68 
70  int order;
71  double initDiag;
72  int centDiff;
73 
76 
79 
82 
84  bool *Frozen;
85 
88 
90  void fastMarch(int &eFlag);
91 
93  double calcTime(int i, int j, double Fij, int ord, int &eFlag);
94 
96  int ij2ind(int i, int j, int m) { return ( ( i - 1 ) + ( j - 1 ) * m ); }
97  int ind2i(int ind, int m) { return 1 + ind - ( ind / m ) * m; }
98  int ind2j(int ind, int m) { return ( ( ind ) / m ) + 1; }
99  bool isInDomain(int i, int j, int m, int n) { return ( ( i >= 1 ) && ( j >= 1 ) && ( i <= m ) && ( j <= n ) ); }
100 };
101 } // end namespace oofem
102 #endif // grid_h
void printSolutionAsData()
Definition: grid.C:216
FloatMatrix * T
Matrix storing the values of the unknown (computed) field (e.g., arrival times)
Definition: grid.h:78
void setMethod(int o, double i, int c)
Set the details of the algorithm to be used.
Definition: grid.h:49
double giveSolutionValueAt(int i, int j)
Output methods.
Definition: grid.C:204
int ind2j(int ind, int m)
Definition: grid.h:98
void unFreeze()
Set all flags to "unfrozen".
Definition: grid.C:95
double calcTime(int i, int j, double Fij, int ord, int &eFlag)
Auxiliary function that evaluates the tentative value at one grid point, exploited by the fast marchi...
Definition: grid.C:303
int centDiff
Definition: grid.h:72
bool solutionAvailable
Flag indicating whether the solution has been computed.
Definition: grid.h:75
FloatMatrix * givePrescribedField()
Definition: grid.h:54
void fastMarch(int &eFlag)
Fast marching method, solving the eikonal equation.
Definition: grid.C:228
int ij2ind(int i, int j, int m)
Utility methods.
Definition: grid.h:96
FloatMatrix * F
Matrix storing the values of the prescribed field (e.g., front velocities)
Definition: grid.h:81
void setZeroValues(FloatMatrix *gridCoords)
Methods setting the values of the unknown field at selected points (e.g., zero times) ...
Definition: grid.C:105
Class that solves certain problems on a regular 2D grid, consisting of n x m nodes.
Definition: grid.h:32
Grid(int N, int M)
Constructor (N = horizontal dimension, M = vertical dimension)
Definition: grid.C:46
int n
Grid dimensions: number of grid nodes horizontally (n) and vertically (m)
Definition: grid.h:67
Class implementing a heap, which is an auxiliary data structure used for efficient sorting and exploi...
Definition: heap.h:12
#define N(p, q)
Definition: mdm.C:367
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
int m
Definition: grid.h:67
int order
Algorithmic parameters.
Definition: grid.h:70
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
void setSolutionValueAt(int i, int j, double value)
Definition: grid.C:196
bool isInDomain(int i, int j, int m, int n)
Definition: grid.h:99
int giveSize(int dir)
Definition: grid.C:70
void setPrescribedFieldValue(int i, int j, double val)
Method setting the values of the prescribed field (e.g., front velocities)
Definition: grid.h:53
int giveSizeVertical()
Definition: grid.h:42
int giveSizeHorizontal()
Size information.
Definition: grid.h:41
double initDiag
Definition: grid.h:71
int ind2i(int ind, int m)
Definition: grid.h:97
the oofem namespace is to define a context or scope in which all oofem names are defined.
Heap * narrowBand
Heap used for efficient sorting and detection of smallest candidate.
Definition: grid.h:87
~Grid()
Destructor.
Definition: grid.C:59
bool * Frozen
Array storing indicators of frozen points (at which the solution is already known) ...
Definition: grid.h:84

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:29 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011