-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataLoader.h
More file actions
57 lines (52 loc) · 1.63 KB
/
Copy pathDataLoader.h
File metadata and controls
57 lines (52 loc) · 1.63 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
51
52
53
54
55
56
57
#pragma once
#include <array>
#include <vector>
#include <map>
#include <fstream>
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include "FiniteElement.h"
#include "Edge.h"
#include "Surface.h"
#include "Defines.h"
using namespace std;
class DataLoader
{
private:
ifstream m_file;
vector<array<double, COORDS_PER_NODE>> m_coords;
vector<FiniteElement> m_elements;
multimap<unsigned int, unsigned int > m_boundary_edges_hash_table;
vector<Edge> m_boundary_edges;
vector<Surface> m_surfaces;
map<unsigned int, array<unsigned int, COORDS_PER_NODE>> m_node_examples;
double m_heat_conduction_coeff;
double m_max_coord;
array<double, COORDS_PER_NODE> m_object_center;
private:
void initHeatConduction();
void initCoords();
void initElements();
void initEdges();
bool initSufaces();
public:
explicit DataLoader(const string& file_path);
~DataLoader();
bool loadData();
const array<double, COORDS_PER_NODE>* getNodeCoord(unsigned int id) const;
const FiniteElement* getElement(unsigned int id) const;
const Edge* getIfBoundary(array<unsigned int, COORDS_PER_NODE>* indices) const;
const Surface* getSurface(unsigned int id) const;
double getHeatConductionCoeff() const;
unsigned int getNodeCount() const;
unsigned int getElementCount() const;
unsigned int getSurfaceCount() const;
double getMaxCoord() const;
vector<unsigned int> getBoundaryNodes() const;
void deleteSomeDataBeforeSolve();
const array<double, COORDS_PER_NODE> *getObjectCenter() const;
public:
static unsigned int generateKey(array<unsigned int, COORDS_PER_NODE>* indices);
};