-
Notifications
You must be signed in to change notification settings - Fork 3
/
feed.cpp
36 lines (30 loc) · 1009 Bytes
/
feed.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
#include "feed.h"
#include "solve.h"
const int SOURCE_GROUP_TAG = 286;
int feed_index;
int find_feed_index() {
msh_segment feed_segment;
// std::cout << mesh.segment.size() << std::endl;
for(int i = 0; i < mesh.segment_num; i++) {
// std::cout << mesh.segment[i].physical_tag << std::endl;
if(mesh.segment[i].physical_tag == SOURCE_GROUP_TAG) {
feed_segment = mesh.segment[i];
break;
}
}
for(int i = 0; i < edge_basis.size(); i++) {
if((edge_basis[i][0] == feed_segment.node_number_list[0] &&
edge_basis[i][1] == feed_segment.node_number_list[1]) ||
(edge_basis[i][0] == feed_segment.node_number_list[1] &&
edge_basis[i][1] == feed_segment.node_number_list[0])) {
return i;
}
}
return -1;
}
void set_feed_index() {
feed_index = find_feed_index();
if(feed_index < 0) {
std::cout << "The feed is not properly configured.." << std::endl;
}
}