Boundary.h 2.06 KB
Newer Older
JasonPries's avatar
JasonPries committed
1 2 3
#ifndef OERSTED_BOUNDARY_H
#define OERSTED_BOUNDARY_H

4 5 6
#include <vector>
#include <cstddef>

7 8
#include <Sketch.hpp>

JasonPries's avatar
JasonPries committed
9 10 11 12 13 14 15
template<size_t Dimension>
class Boundary {
};

template<>
class Boundary<2> {
public:
16 17 18
    Boundary(std::vector<size_t> &&nodes) : CurvePtr{nullptr}, Nodes{nodes} {};

    Boundary(std::shared_ptr<Curve const> cptr, std::vector<size_t> &&nodes) : CurvePtr{cptr}, Nodes{nodes} {};
JasonPries's avatar
JasonPries committed
19

JasonPries's avatar
JasonPries committed
20 21 22 23
    size_t size() const { return Nodes.size(); };

    std::vector<size_t> &nodes() { return Nodes; };

JasonPries's avatar
JasonPries committed
24 25
    std::vector<size_t> const &nodes() const { return Nodes; };

JasonPries's avatar
JasonPries committed
26 27
    size_t node(size_t i) { return Nodes[i]; };

JasonPries's avatar
JasonPries committed
28 29
    size_t const &node(size_t i) const { return Nodes[i]; };

JasonPries's avatar
JasonPries committed
30

JasonPries's avatar
JasonPries committed
31
protected:
32
    std::shared_ptr<Curve const> CurvePtr;
JasonPries's avatar
JasonPries committed
33 34 35
    std::vector<size_t> Nodes;
};

JasonPries's avatar
JasonPries committed
36
/*
JasonPries's avatar
JasonPries committed
37
template <size_t Dimension>
JasonPries's avatar
JasonPries committed
38
class BoundaryPair {};
JasonPries's avatar
JasonPries committed
39

JasonPries's avatar
JasonPries committed
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 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
template <>
class BoundaryPair<2> {
public:
    BoundaryPair(std::shared_ptr<Boundary<2>> first, std::shared_ptr<Boundary<2>> second) : First{first}, Second{second} {};

    std::shared_ptr<Boundary<2>> const &first() { return First; };

    std::shared_ptr<Boundary<2>> const &second() { return Second; };

protected:
    std::shared_ptr<Boundary<2>> First;
    std::shared_ptr<Boundary<2>> Second;
};
*/

class VariableMap {
public:
    VariableMap(size_t first, size_t second, double value) : First{first}, Second{second}, Value{value} {};

    size_t first() const { return First; };

    size_t second() const { return Second; };

    double value() const { return Value; };

protected:
    size_t First;
    size_t Second;
    double Value;
};

class BoundaryMap {
public:
    BoundaryMap(std::vector<VariableMap> map) : Map{map} {};

    size_t size() const { return Map.size(); };

    VariableMap const &map(size_t i) const { return Map[i]; };

    std::vector<VariableMap> const &map() const { return Map; };

    size_t first(size_t i) const { return Map[i].first(); };

    size_t second(size_t i) const { return Map[i].second(); };

    double value(size_t i) const { return Map[i].value(); };

protected:
    std::vector<VariableMap> Map;
JasonPries's avatar
JasonPries committed
89 90
};

JasonPries's avatar
JasonPries committed
91
#endif //OERSTED_BOUNDARY_H