#include <CurrMap.h>
|
| | CurrMap (const std::string &filename, double xnorm) |
| | ~CurrMap () |
| int | GetNx () const |
| float | GetXmin () const |
| float | GetXmax () const |
| float | GetDx () const |
| int | GetNy () const |
| float | GetYmin () const |
| float | GetYmax () const |
| float | GetDy () const |
| float | GetGap (int ix, int iy) const |
| float | GetCurr0 (int ix, int iy) const |
| float | GetCurr1 (int ix, int iy) const |
| float | GetCurr2 (int ix, int iy) const |
| void | GetAll (double x, double y, double *gap, double *curr0, double *curr1, double *curr2) const |
Definition at line 10 of file CurrMap.h.
◆ CurrMap() [1/2]
| CurrMap::CurrMap |
( |
const std::string & | filename, |
|
|
double | xnorm ) |
Definition at line 10 of file CurrMap.cxx.
11{
12
13
14
15
16
26
31
32
34 if(fp){
36 fgets(line,80,fp);
38
42
47
49 {
50 for (
int j=0; j<
m_ny;j++) {
55 }
56 }
57
58 int ix,iy;
59 float gap,cur1,cur2,cur3;
60 while (fgets(line,80,fp)) {
61 sscanf(&line[0],"%d%d%f%f%f%f",&ix,&iy,&gap,&cur1,&cur2,&cur3);
62 if(ix >= 0 && ix < m_nx && iy >= 0 && iy <
m_ny){
67 }
68 }
69 }
70 else{
71 std::cout << "Error in CurrMap::CurrMap: nx or ny out of limits." << std::endl;
72 }
73 fclose(fp);
74 }
75 else{
76
77 std::cout << "Error in CurrMap::CurrMap: The file could not be open." << std::endl;
78 }
79
80
81}
gap(flags, cells_name, *args, **kw)
◆ ~CurrMap()
◆ CurrMap() [2/2]
| CurrMap::CurrMap |
( |
const CurrMap & | | ) |
|
|
private |
◆ GetAll()
| void CurrMap::GetAll |
( |
double | x, |
|
|
double | y, |
|
|
double * | gap, |
|
|
double * | curr0, |
|
|
double * | curr1, |
|
|
double * | curr2 ) const |
Definition at line 93 of file CurrMap.cxx.
94{
96 *curr0=0;
97 *curr1=0;
98 *curr2=0;
99
105
106 int ix,iy;
109
110 if ( (ix+1) <
m_nx && (iy+1) <
m_ny) {
120
122 for (
int i=0;
i<2;
i++) {
123 for (int j=0;j<2;j++) {
132 }
133 }
134 }
135 if (sumw>0.) {
137 *curr0 = *curr0/
sumw;
138 *curr1 = *curr1/
sumw;
139 *curr2 = *curr2/
sumw;
140 }
141 else {
142
143 int jy=-1;
144 int jx=-1;
145 int idistm=100;
146 for (int iiy=iy-7;iiy<iy+8;iiy++) {
147 for (int iix=ix-7;iix<ix+8;iix++) {
148 if (iiy>=0 && iiy<m_ny && iix>=0 && iix<
m_nx) {
150 int idist=(iix-ix)*(iix-ix)+(iiy-iy)*(iiy-iy);
151 if(idist<idistm) {
152 idistm=idist;
153 jx=iix;
154 jy=iiy;
155 }
156 }
157 }
158 }
159 }
160 if (idistm<100 && jx>=0 && jy>=0) {
165 } else {
167 *curr0=0;
168 *curr1=0;
169 *curr2=0;
170 }
171 }
172 }
173 else {
174
183 if (
m_curr0[n]<1e-6 && (ix-1) >0 && (iy-1) >0 )
n=ix-1+(iy-1)*
m_nx;
188 }
189}
◆ GetCurr0()
| float CurrMap::GetCurr0 |
( |
int | ix, |
|
|
int | iy ) const |
|
inline |
◆ GetCurr1()
| float CurrMap::GetCurr1 |
( |
int | ix, |
|
|
int | iy ) const |
|
inline |
◆ GetCurr2()
| float CurrMap::GetCurr2 |
( |
int | ix, |
|
|
int | iy ) const |
|
inline |
◆ GetDx()
| float CurrMap::GetDx |
( |
| ) |
const |
|
inline |
◆ GetDy()
| float CurrMap::GetDy |
( |
| ) |
const |
|
inline |
◆ GetGap()
| float CurrMap::GetGap |
( |
int | ix, |
|
|
int | iy ) const |
|
inline |
◆ GetNx()
| int CurrMap::GetNx |
( |
| ) |
const |
|
inline |
◆ GetNy()
| int CurrMap::GetNy |
( |
| ) |
const |
|
inline |
◆ GetXmax()
| float CurrMap::GetXmax |
( |
| ) |
const |
|
inline |
◆ GetXmin()
| float CurrMap::GetXmin |
( |
| ) |
const |
|
inline |
◆ GetYmax()
| float CurrMap::GetYmax |
( |
| ) |
const |
|
inline |
◆ GetYmin()
| float CurrMap::GetYmin |
( |
| ) |
const |
|
inline |
◆ operator=()
◆ m_curr0
◆ m_curr1
◆ m_curr2
◆ m_dx
◆ m_dy
◆ m_gap
◆ m_norm
◆ m_nx
◆ m_ny
◆ m_xmax
◆ m_xmin
◆ m_ymax
◆ m_ymin
The documentation for this class was generated from the following files: