#ifndef OERSTED_FINITEELEMENTMESH_H #define OERSTED_FINITEELEMENTMESH_H #include #include "Eigen" #include "Node.h" #include "Triangle.h" template class QuadratureDerivatives { private: SmallVector Value[Q]; }; template class QuadratureDerivatives<2, Q> { public: double dx(size_t i) { return d[i].x(); }; double dy(size_t i) { return d[i].y(); }; private: XY d[Q]; }; template class QuadratureDerivatives<3, Q> { public: double dx(size_t i) { return d[i].x(); }; double dy(size_t i) { return d[i].y(); }; double dz(size_t i) { return d[i].z(); }; private: XYZ d[Q]; }; template class FiniteElementMesh {}; template class FiniteElementMesh<2,P> { public: FiniteElementMesh() {}; FiniteElementMesh(std::vector nodes, std::vector> tris) : Nodes(nodes), Triangles(tris) {}; std::vector const nodes() const { return Nodes; }; std::vector> const triangles() const { return Triangles; }; template SparseMatrixGroup::size> basis() const { SparseMatrixGroup::size> mat(Nodes.size(), Triangles.size(), Triangle

::N); for (size_t i = 0; i != Triangles.size(); ++i) { Triangles[i].basis(mat, Nodes, i); } return mat; }; template DerivativeMatrixGroup::size> derivative() const { DerivativeMatrixGroup::size> df(Nodes.size(), Triangles.size(), Triangle

::N); for (size_t i = 0; i!= Triangles.size();++i) { Triangles[i].derivative(df, Nodes, i); } return df; } protected: std::vector Nodes; std::vector> Triangles; }; #endif //OERSTED_FINITEELEMENTMESH_H