-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSource.cpp
More file actions
50 lines (37 loc) · 1.01 KB
/
Source.cpp
File metadata and controls
50 lines (37 loc) · 1.01 KB
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
//
// Source.cpp
// Helmholtz-potential-evaluation
//
// Created by Eduard on 10/2/23.
//
#include "Source.hpp"
std::ostream& operator<<(std::ostream& os, const Source& aSource){
os << "Coordinate: " << aSource.aCoordinate.x << "\t" << aSource.aCoordinate.y << "\t" << aSource.aCoordinate.z << "\t\t"
<< "Charge: " << aSource.charge << std::endl;
return os;
}
bool Distribution::get_sources(){
std::ifstream dataList;
dataList.open("sources.txt");
while(dataList){
std::string dataString;
std::getline (dataList, dataString);
std::cout<<dataString<<std::endl;
}
return 0;
}
bool Distribution::get_sources_mockup(){
for (int i = 0; i < 10; i++){
Source aSource;
aSource.aCoordinate = Coordinate(i*3.14, i*2.7, i*9.8);
aSource.charge = i;
sourceList.push_back(aSource);
}
return 0;
}
bool Distribution::print_sources(){
for(int i = 0; i<sourceList.size();i++){
std::cout << sourceList.at(i);
}
return 0;
}