FiniteElementMesh.h 1.11 KB
Newer Older
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
58
59
#ifndef OERSTED_FINITEELEMENTMESH_H
#define OERSTED_FINITEELEMENTMESH_H

#include <vector>

#include "Eigen"

#include "Node.h"
#include "Triangle.h"

template<size_t M, size_t Q>
class QuadratureDerivatives {
private:
    SmallVector<M> Value[Q];
};

template<size_t Q>
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<size_t Q>
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<size_t M, size_t N>
class FiniteElementMesh {
};

template<size_t P>
class FiniteElementMesh<2, P> {
public:
    FiniteElementMesh(std::vector<XY> nodes, std::vector<Triangle<P>> tris) : Nodes(nodes), Triangles(tris) {};

    std::vector<XY> const nodes() { return Nodes; };

    std::vector<Triangle<P>> const triangles() { return Triangles; };

protected:
    std::vector<XY> Nodes;
    std::vector<Triangle<P>> Triangles;
};

#endif //OERSTED_FINITEELEMENTMESH_H