Region.h 966 Bytes
Newer Older
1 2 3
#ifndef OERSTED_REGION_H
#define OERSTED_REGION_H

JasonPries's avatar
JasonPries committed
4 5
#include <vector>

JasonPries's avatar
JasonPries committed
6 7
#include "MaterialProperties.h"

8
template<size_t Dimension>
JasonPries's avatar
JasonPries committed
9 10
class Region {
};
11 12

template<>
JasonPries's avatar
JasonPries committed
13
class Region<2> { // TODO: Rename Triangles to Elements?
14
public:
15
    Region() : Material{Air()} {};
JasonPries's avatar
JasonPries committed
16 17
    Region(std::vector<size_t> elements) : Elements{elements}, Material{Air()} {};
    Region(std::vector<size_t> elements, MaterialProperties material) : Elements{elements}, Material{material} {};
18

JasonPries's avatar
JasonPries committed
19
    std::vector<size_t> const &elements() const { return Elements; };
JasonPries's avatar
JasonPries committed
20

JasonPries's avatar
JasonPries committed
21
    size_t const &element(size_t i) const { return Elements[i]; };
JasonPries's avatar
JasonPries committed
22

JasonPries's avatar
JasonPries committed
23 24 25 26
    MaterialProperties &material() { return Material; }; // non-const because internal state of the material may be altered

    void material(MaterialProperties mat) { Material = mat; };

27 28
    void push_back(size_t element) { Elements.push_back(element); };

29
protected:
JasonPries's avatar
JasonPries committed
30
    std::vector<size_t> Elements;
JasonPries's avatar
JasonPries committed
31 32

    MaterialProperties Material;
33 34 35
};

#endif //OERSTED_REGION_H