-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmulti_value_cell.cpp
66 lines (55 loc) · 1.68 KB
/
multi_value_cell.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include"non_uniform_grid.h"
#include"findneighbor.h"
#include<set>
#include<map>
#include<cstddef>
extern OctCell *bodygrid;
//extern PXYZ Circle[NPOINTCIRCLE+1];
//const PXYZ *const wallpoint = Circle;
//const int NumberAirfoilPoint=NPOINTCIRCLE;
//const int HalfNumberAirfoilPoint=NumberAirfoilPoint / 2;
//const int n_sharp_point=HalfNumberAirfoilPoint;
void find_sol_refp(OctCell *pp[],OctCell *parent);
//PXYZ sharp_point=wallpoint[n_sharp_point];
extern set<OctCell*>mvalue_set;
void insert_cell2(OctCell *pp, set<OctCell*> &grid)
{
if(pp->reflag==0){
if(pp->flag%2==0)grid.insert(pp);
}
else {
for(int m=0; m<4;++m)
insert_cell2(pp->children[m], grid);
}
}
//这里只是找到可能有多值点情况的
void find_multivalue_cell(const PXYZ &sharppoint)
{
double hcx, hcy;
OctCell *cellflow=NULL;
OctCell *in_this_cell=NULL;
OctCell *ppvec[9]={NULL};
// PXYZ point;
// point=wallpoint[n_sharp_point];
mvalue_set.clear();
for(int i=1;i<=Nx*Ny;++i){
cellflow=bodygrid+i;
hcx=cellflow->dx;
hcy=cellflow->dy;
if(sharppoint.x < cellflow->xc1 + 0.5 * hcx + ERRS
&& sharppoint.x > cellflow->xc1 - 0.5 * hcx - ERRS
&& sharppoint.y < cellflow->yc1 + 0.5 * hcy + ERRS
&& sharppoint.y > cellflow->yc1 - 0.5 * hcy - ERRS){
in_this_cell=cellflow;
break;
}
}
find_sol_refp(ppvec,in_this_cell);
ppvec[8]=in_this_cell;
for(int i=0; i<9;++i)
insert_cell2(ppvec[i],mvalue_set);
for(set<OctCell*>::iterator it_set=mvalue_set.begin();
it_set!=mvalue_set.end();++it_set) {
(*it_set)->mvflg=true;
}
}