Commit 3235d40a authored by JasonPries's avatar JasonPries

Setup test for mesh compilation

parent ab0789a3
#ifndef OERSTED_TEST_LIBRARY_INTEGRATION_H
#define OERSTED_TEST_LIBRARY_INTEGRATION_H
#include "gtest.h"
#include "Sketch.hpp"
#include "Mesh.hpp"
#include "Quadrature.hpp"
......
#include "test_Library_Integration.hpp"
\ No newline at end of file
#include "test_Library_Integration.hpp"
class Library_Integration_Circle : public ::testing::Test {
public:
virtual void SetUp() {
sk = Sketch();
auto v0 = sk.new_element<Vertex>(0.0,0.0);
auto v1 = sk.new_element<Vertex>(1.0,0.0);
auto v2 = sk.new_element<Vertex>(1.0*std::cos(M_PI*2.0/3.0),1.0*std::sin(M_PI*2.0/3.0));
auto v3 = sk.new_element<Vertex>(1.0*std::cos(-M_PI*2.0/3.0),1.0*std::sin(-M_PI*2.0/3.0));
auto c0 = sk.new_element<CircularArc>(v1,v2,v0,1.0);
auto c1 = sk.new_element<CircularArc>(v2,v3,v0,1.0);
auto c2 = sk.new_element<CircularArc>(v3,v1,v0,1.0);
auto f0 = sk.new_element<Fixation>(v0);
auto f1 = sk.new_element<Fixation>(v1);
auto f2 = sk.new_element<Fixation>(v2);
auto f3 = sk.new_element<Fixation>(v3);
double_t tol = sk.solve();
EXPECT_LE(tol, FLT_EPSILON);
bool result = sk.build();
EXPECT_TRUE(result);
EXPECT_EQ(sk.size_contours(),1);
}
Sketch sk;
std::string save_dir = "./test/output/Integration/";
};
TEST_F(Library_Integration_Circle, Uniform_Current_Density) {
sk.save_as<SaveMethod::Rasterize>(save_dir, std::string("circle_sketch"));
Mesh me{sk};
me.create();
me.MinimumElementSize = 0.01;
me.MaximumElementSize = 0.1;
me.MinimumElementQuality = 0.5;
me.refine();
me.save_as(save_dir, std::string("circle_mesh"));
//FiniteElementMesh<2, 1> fem{me}; // TODO: Convert refineable mesh to FiniteElementMesh
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment