Commit 9cd34359 by JasonPries

### Nightly Commit

```Started implementation of Magnetostatic solver
Work on Dirichlet boundary conditions (magnetic insulation)```
parent 45453ece
 ... ... @@ -3,6 +3,7 @@ discretization eigen linearize supremum tangency verticies ... ...
 ... ... @@ -5,7 +5,7 @@ set(SOURCE_FILES #./src/PhysicsCommon.h ./src/Condition.h ./src/Condition.cpp ./src/Forcing.h ./src/Forcing.cpp ./src/FiniteElementMesh.h ./src/FiniteElementMesh.cpp ... ...
 #ifndef OERSTED_PHYSICS_HPP #define OERSTED_PHYSICS_HPP //#include "../src/PhysicsCommon.h" //#include "../src/Physics.h" //#include "../src/Discretization.h" //#include "../src/Operator.h" #include "../src/Condition.h" #include "../src/Boundary.h" #include "../src/BoundaryCondition.h" #include "../src/FiniteElementMesh.h" #include "../src/Forcing.h" #include "../src/MatrixGroup.h" #include "../src/Node.h" #include "../src/Physics.h" ... ...
 #include "Boundary.h"
 #ifndef OERSTED_BOUNDARY_H #define OERSTED_BOUNDARY_H template class Boundary { }; template<> class Boundary<2> { public: Boundary(std::vector nodes) : Nodes{nodes} {}; std::vector const &nodes() const { return Nodes; }; size_t const &node(size_t i) const { return Nodes[i]; }; protected: std::vector Nodes; }; #endif //OERSTED_BOUNDARY_H
 #include "BoundaryCondition.h"
 #ifndef OERSTED_BOUNDARYCONDITION_H #define OERSTED_BOUNDARYCONDITION_H #include #include #include #include #include "MatrixGroup.h" #include "QuadratureRule.h" #include "FiniteElementMesh.h" class BoundaryCondition { public: BoundaryCondition(std::vector boundaries) : Boundaries{boundaries} {}; virtual ~BoundaryCondition(){}; virtual void apply(std::vector> &triplets) const = 0; virtual void reduce(std::set> &index) const = 0; protected: std::vector Boundaries; }; template class ZeroDirichlet : public BoundaryCondition{}; template class ZeroDirichlet<2,ElementOrder,QuadratureOrder> : public BoundaryCondition { public: ZeroDirichlet(std::vector boundaries, FiniteElementMesh<2,ElementOrder> const &domain) : BoundaryCondition{boundaries} { for(size_t i : boundaries) { for(size_t j : domain.boundary(i).nodes()) { Nodes.push_back(j); } } }; void apply(std::vector> &triplets) const override {}; void reduce(std::set> &index) const override { for (size_t i = 0; i != Nodes.size(); ++i) { index.insert(Nodes[i]); } }; protected: std::vector Nodes; }; #endif //OERSTED_BOUNDARYCONDITION_H
 // // Created by jpries on 1/2/17. // #include "Condition.h"
 // // Created by jpries on 12/20/16. // #include "FiniteElementMesh.h"
 ... ... @@ -17,7 +17,7 @@ class FiniteElementMesh<2,Order> { public: FiniteElementMesh() {}; FiniteElementMesh(std::vector nodes, std::vector> tris, std::vector> r) : Nodes(nodes), Triangles(tris), Regions(r) {}; FiniteElementMesh(std::vector nodes, std::vector> tris, std::vector> r, std::vector> b) : Nodes(nodes), Triangles(tris), Regions(r), Boundaries(b) {}; std::vector const &nodes() const { return Nodes; }; ... ... @@ -25,12 +25,16 @@ public: std::vector> const ®ions() const { return Regions; }; std::vector> const &boundaries() const { return Boundaries; }; XY const &node(size_t i) const { return Nodes[i]; }; Triangle const &triangle(size_t i) const { return Triangles[i]; }; Region<2> const ®ion(size_t i) const { return Regions[i]; }; Boundary<2> const &boundary(size_t i) const { return Boundaries[i]; }; template DiagonalMatrixGroup::size> determinant() const { DiagonalMatrixGroup::size> mat(Triangles.size()); ... ... @@ -69,6 +73,7 @@ protected: std::vector> Triangles; std::vector> Regions; // Contains vector of size_t referencing Triangles (and later Quadrilaterals) std::vector> Boundaries; }; #endif //OERSTED_FINITEELEMENTMESH_H
 #include "Forcing.h"