#ifndef OERSTED_BOUNDARY_H #define OERSTED_BOUNDARY_H #include #include #include template class Boundary { }; template<> class Boundary<2> { public: Boundary(std::vector &&nodes) : CurvePtr{nullptr}, Nodes{nodes} {}; Boundary(std::shared_ptr cptr, std::vector &&nodes) : CurvePtr{cptr}, Nodes{nodes} {}; size_t size() const { return Nodes.size(); }; auto &nodes() { return Nodes; }; auto const &nodes() const { return Nodes; }; auto &node(size_t i) { return Nodes[i]; }; auto const &node(size_t i) const { return Nodes[i]; }; protected: std::shared_ptr CurvePtr; std::vector Nodes; }; /* template class BoundaryPair {}; template <> class BoundaryPair<2> { public: BoundaryPair(std::shared_ptr> first, std::shared_ptr> second) : First{first}, Second{second} {}; std::shared_ptr> const &first() { return First; }; std::shared_ptr> const &second() { return Second; }; protected: std::shared_ptr> First; std::shared_ptr> 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 map) : Map{map} {}; size_t size() const { return Map.size(); }; VariableMap const &map(size_t i) const { return Map[i]; }; std::vector 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 Map; }; #endif //OERSTED_BOUNDARY_H