OOFEM 3.0
Loading...
Searching...
No Matches
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
7namespace oofem {
31
32class Grid
33{
34public:
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);
63
64
65private:
67 int n, m;
68
70 int order;
71 double initDiag;
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
#define N(a, b)
~Grid()
Destructor.
Definition grid.C:56
FloatMatrix T
Matrix storing the values of the unknown (computed) field (e.g., arrival times).
Definition grid.h:78
bool solutionAvailable
Flag indicating whether the solution has been computed.
Definition grid.h:75
int ij2ind(int _i, int _j, int _m)
Utility methods.
Definition grid.h:96
double giveSolutionValueAt(int i, int j)
Output methods.
Definition grid.C:199
bool isInDomain(int i, int j, int _m, int _n)
Definition grid.h:99
int ind2i(int ind, int _m)
Definition grid.h:97
void setPrescribedFieldValue(int i, int j, double val)
Method setting the values of the prescribed field (e.g., front velocities).
Definition grid.h:53
void fastMarch(int &eFlag)
Fast marching method, solving the eikonal equation.
Definition grid.C:223
void unFreeze()
Set all flags to "unfrozen".
Definition grid.C:90
Heap * narrowBand
Heap used for efficient sorting and detection of smallest candidate.
Definition grid.h:87
int giveSizeVertical()
Definition grid.h:42
int centDiff
Definition grid.h:72
double initDiag
Definition grid.h:71
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:297
void setZeroValues(FloatMatrix *gridCoords)
Methods setting the values of the unknown field at selected points (e.g., zero times).
Definition grid.C:100
Grid(int N, int M)
Constructor (N = horizontal dimension, M = vertical dimension).
Definition grid.C:44
FloatMatrix & givePrescribedField()
Definition grid.h:54
void printSolutionAsData()
Definition grid.C:211
int ind2j(int ind, int _m)
Definition grid.h:98
int giveSize(int dir)
Definition grid.C:65
void setSolutionValueAt(int i, int j, double value)
Definition grid.C:191
int giveSizeHorizontal()
Size information.
Definition grid.h:41
void setMethod(int o, double i, int c)
Set the details of the algorithm to be used.
Definition grid.h:49
int m
Definition grid.h:67
int n
Grid dimensions: number of grid nodes horizontally (n) and vertically (m).
Definition grid.h:67
int order
Algorithmic parameters.
Definition grid.h:70
bool * Frozen
Array storing indicators of frozen points (at which the solution is already known).
Definition grid.h:84
FloatMatrix F
Matrix storing the values of the prescribed field (e.g., front velocities).
Definition grid.h:81

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011