Commit e4b6f785 authored by Fabian's avatar Fabian
Browse files

Removed unneeded files

parent d561bd2c
......@@ -3,8 +3,6 @@ project(BacherlorsThesis)
# Require at least cmake version 3.0.1
cmake_minimum_required(VERSION 3.0.1)
# TODO some unit tests may be nice
# Setting C++ version (using C++11)
if(CMAKE_VERSION VERSION_GREATER 3.1.0 OR CMAKE_VERSION VERSION_EQUAL 3.1.0)
set(CMAKE_CXX_STANDARD 11)
......
add_subdirectory(TestCase1)
add_subdirectory(TestCase0)
add_subdirectory(Example_LinearLagr_2D)
add_subdirectory(Example_QuadraticLagr_2D)
add_subdirectory(Example_hpLagr_2D)
FILE(GLOB SRC *.hpp *.cpp)
add_executable_betl(TestCase0 ${SRC})
cl__1 = 1;
Point(1) = {0, 0, 0, 1};
Point(2) = {-1, 0, 0, 1};
Point(3) = {0, 1, 0, 1};
Point(4) = {1, 0, 0, 1};
Point(5) = {0, -1, 0, 1};
Circle(1) = {2, 1, 3};
Circle(2) = {3, 1, 4};
Circle(3) = {4, 1, 5};
Circle(4) = {5, 1, 2};
Line Loop(5) = {4, 3, 2, 1};
Plane Surface(6) = {5};
cl__1 = 1;
Point(1) = {0, 0, 0, 1};
Point(2) = {1, 0, 0, 1};
Point(3) = {1, 1, 0, 1};
Point(4) = {0, 1, 0, 1};
Point(5) = {0, 0, 1, 1};
Point(6) = {1, 0, 1, 1};
Point(7) = {1, 1, 1, 1};
Point(8) = {0, 1, 1, 1};
Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {3, 4};
Line(4) = {4, 1};
Line(7) = {8, 4};
Line(8) = {7, 3};
Line(9) = {7, 8};
Line(10) = {8, 5};
Line(11) = {6, 7};
Line(12) = {5, 6};
Line(13) = {6, 2};
Line(14) = {5, 1};
Line Loop(6) = {1, 2, 3, 4};
Plane Surface(6) = {6};
Line Loop(16) = {4, -14, -10, 7};
Plane Surface(16) = {16};
Line Loop(18) = {7, -3, -8, 9};
Plane Surface(18) = {18};
Line Loop(20) = {11, 8, -2, -13};
Plane Surface(20) = {20};
Line Loop(22) = {11, 9, 10, 12};
Plane Surface(22) = {22};
Line Loop(24) = {12, 13, -1, -14};
Plane Surface(24) = {24};
Surface Loop(25) = {18, 16, 6, 24, 22, 20};
Volume(26) = {25};
$MeshFormat
2.2 0 8
$EndMeshFormat
$Nodes
14
1 0 0 0
2 1 0 0
3 1 1 0
4 0 1 0
5 0 0 1
6 1 0 1
7 1 1 1
8 0 1 1
9 0.5 0.5 0
10 0 0.5 0.5
11 0.5 1 0.5
12 1 0.5 0.5
13 0.5 0.5 1
14 0.5 0 0.5
$EndNodes
$Elements
68
1 15 2 0 1 1
2 15 2 0 2 2
3 15 2 0 3 3
4 15 2 0 4 4
5 15 2 0 5 5
6 15 2 0 6 6
7 15 2 0 7 7
8 15 2 0 8 8
9 1 2 0 1 1 2
10 1 2 0 2 2 3
11 1 2 0 3 3 4
12 1 2 0 4 4 1
13 1 2 0 7 8 4
14 1 2 0 8 7 3
15 1 2 0 9 7 8
16 1 2 0 10 8 5
17 1 2 0 11 6 7
18 1 2 0 12 5 6
19 1 2 0 13 6 2
20 1 2 0 14 5 1
21 2 2 0 6 1 2 9
22 2 2 0 6 1 9 4
23 2 2 0 6 2 3 9
24 2 2 0 6 3 4 9
25 2 2 0 16 1 10 4
26 2 2 0 16 1 5 10
27 2 2 0 16 4 10 8
28 2 2 0 16 5 8 10
29 2 2 0 18 4 3 11
30 2 2 0 18 11 3 7
31 2 2 0 18 8 4 11
32 2 2 0 18 11 7 8
33 2 2 0 20 3 2 12
34 2 2 0 20 12 2 6
35 2 2 0 20 7 3 12
36 2 2 0 20 12 6 7
37 2 2 0 22 6 13 5
38 2 2 0 22 13 8 5
39 2 2 0 22 7 13 6
40 2 2 0 22 8 13 7
41 2 2 0 24 2 1 14
42 2 2 0 24 14 1 5
43 2 2 0 24 6 2 14
44 2 2 0 24 14 5 6
45 4 2 0 26 13 10 11 12
46 4 2 0 26 11 10 9 12
47 4 2 0 26 9 10 14 12
48 4 2 0 26 10 13 14 12
49 4 2 0 26 9 1 2 14
50 4 2 0 26 6 5 13 14
51 4 2 0 26 13 8 7 11
52 4 2 0 26 4 8 10 11
53 4 2 0 26 8 5 10 13
54 4 2 0 26 5 1 10 14
55 4 2 0 26 6 2 14 12
56 4 2 0 26 6 13 7 12
57 4 2 0 26 7 11 3 12
58 4 2 0 26 1 4 10 9
59 4 2 0 26 11 4 3 9
60 4 2 0 26 3 9 2 12
61 4 2 0 26 10 8 13 11
62 4 2 0 26 10 4 11 9
63 4 2 0 26 5 10 13 14
64 4 2 0 26 10 1 9 14
65 4 2 0 26 7 13 11 12
66 4 2 0 26 13 6 14 12
67 4 2 0 26 3 11 9 12
68 4 2 0 26 2 9 14 12
$EndElements
2 ----0---- 1
\ /
* 0 1 0 *
* \ / *
2 2 0 3 2
* / \ *
* 1 3 0 *
/ \
1 ----3---- 1
#define NDEBUG
// System includes --------------------------------------------------------------------
#include <iostream>
#include <iomanip>
#include <memory>
#include <fstream>
// ETH includes -----------------------------------------------------------------------
#include <input_interface/input_interface.hpp>
#include <grid_utils/grid_view_factory.hpp>
#include <eth_base/ref_el_types_i.hpp>
//#include <eth_base/timer.hpp>
// BETL2 includes ---------------------------------------------------------------------
#include <cmdl_parser/cmdl_parser.hpp>
#include <gmsh_input/gmsh_input.hpp>
//#include <gmsh_input/grid_elements_identifier.hpp>
#include <grid/grid_creator.hpp>
//#include <grid/element_typeinfo.hpp>
//#include <fe/boundary_dof_marker.hpp>
#include <fe/fe_enumerators.hpp>
#include <ex/ex_dof_handler.hpp>
//#include <fe/intersections_dof_marker.hpp>
//#include <fe/boundary_dof_marker.hpp>
//#include <quadrature/quadrature_list.hpp>
//#include <functional/dof_interpolator.hpp>
//#include <functional/analytical_grid_function.hpp>
//#include <functional/grid_function_operations.hpp>
//#include <functional/interpolation_grid_function.hpp>
//#include <utils/element_metrics.hpp>
// Eigen includes
//#include <Eigen/Sparse>
//#include <Eigen/Dense>
// Test includes ---------------------------------------------------------------------
//#include "../Testing/ExFEBasis.hpp"
template<class FE_SPACE, class GRIDVIEW>
void info(const FE_SPACE& fe_space, const GRIDVIEW& gv) {
auto& set = gv.indexSet();
for(const auto& el : fe_space) {
std::cout << el.refElType() << " Element No. = " << set.index(el) << std::endl;
for(const auto map : fe_space.indices(el)) {
std::cout << std::setw(15) << "gloIdx = " << map.global()
<< std::setw(10) << ", locIdx = " << map.local() << std::endl;
}
}
std::cout << "No. of DoFs=" << fe_space.numDofs() << '\n';
}
int main(int argc, char* argv[]) {
// Initializing the grid (input taken from command line)
const std::string basename = betl2::parseCommandLine(argc, argv);
// const std::string basename = "../Examples/RefinedMeshes/squareTria_4";
// const std::string basename = "../Examples/TestCase0/square";
typedef betl2::input::gmsh::Input input_t;
typedef betl2::input::InputInterface<input_t> inpInterface_t;
input_t input(basename);
inpInterface_t inpInterface(input);
std::cout << "Reading input data" << input << std::endl;
// Create BETL grid
// Using leaf View
const eth::grid::GridViewTypes view = eth::grid::GridViewTypes::LeafView;
typedef betl2::volume2dGrid::hybrid::Grid grid_t;
typedef grid_t::gridTraits_t gridTraits_t;
typedef typename eth::grid::GridView<gridTraits_t::template viewTraits_t<view> >
gridView_t;
typedef betl2::GridCreator<grid_t,view> gridCreator_t;
typedef gridCreator_t::gridFactory_t gridFactory_t;
const gridFactory_t gridFactory = gridCreator_t()(input);
const gridView_t gridView = gridFactory.getView();
// setTagMapper(gridView);
/////// Testing TestFEBasis
betl2::fe::ex::FEBasis<gridFactory_t> febasis(gridFactory);
/*
int i = -1;
for(auto& e : gridView.template entities<0>()) {
++i;
if(i == 0)
febasis.setMult(e, 3);
if(i == 1)
febasis.setMult(e, 2);
if(i == 2)
febasis.setMult(e, 3);
if(i == 3)
febasis.setMult(e, 1);
}
i = -1;
for(auto& e : gridView.template entities<1>()) {
++i;
if(i == 0)
febasis.setMult(e, 3);
if(i == 1)
febasis.setMult(e, 2);
if(i == 2)
febasis.setMult(e, 1);
if(i == 3)
febasis.setMult(e, 2);
}
i = -1;
for(auto& e : gridView.template entities<2>()) {
++i;
if(i == 0)
febasis.setMult(e, 1);
if(i == 1)
febasis.setMult(e, 1);
if(i == 2)
febasis.setMult(e, 1);
if(i == 3)
febasis.setMult(e, 2);
}
*/
for(auto& e : gridView.template entities<0>()) {
if( e.refElType() == eth::base::RefElType::QUAD)
{
std::cout << "Quad 1\n";
febasis.setMult(e, 13);
std::cout << "Quad 2\n";
}
else
{
std::cout << "Tria 1\n";
febasis.setMult(e, 1);
std::cout << "Tria 2\n";
}
}
for(auto& e : gridView.template entities<0>()) {
if( e.refElType() == eth::base::RefElType::QUAD)
{
std::cout << "Quad 1\n";
std::cout << febasis.multiplicity(e);
std::cout << "Quad 2\n";
}
else
{
std::cout << "Tria 1\n";
std::cout << febasis.multiplicity(e);
std::cout << "Tria 2\n";
}
}
//std::cout << gridTraits_t::dimMesh << '\n' << gridTraits_t::dimWorld << '\n';
/*
for(auto& e : gridView.template entities<0>())
std::cout << febasis.numDofs(e) << '\n';
*/
//////
// FESpace and DofHandler
// typedef betl2::fe::FEBasis<betl2::fe::Linear,
// betl2::fe::FEBasisType::Lagrange> febasis_t;
typedef betl2::fe::ex::DofHandler<
betl2::fe::ex::FEBasis<gridFactory_t>,
// febasis_t, betl2::fe::FESContinuity::Continuous,
gridFactory_t> DH_t;
DH_t dh;
dh.distributeDofs(gridFactory, febasis);
// dh.distributeDofs(gridFactory);
// betl2::fe::BoundaryDofMarker< DH_t::fespace_t > markerFull( dh.fespace());
// markerFull.mark( gridFactory); // this call modifies the fespace!!!
// Extract the constrained space
// const auto& interior_fes = markerFull.interiorFESpace( );
// const auto& boundary_fes = markerFull.boundaryFESpace( );
// Get FESpace
const auto& fe_space = dh.fespace();
// Print info
info(fe_space, gridView);
// std::cout << "\n\n";
// info(boundary_fes, gridView);
std::cout << "Terminated successfully\n";
return 0;
}
gridsize = 0.1;
Point(1) = {0, 0, 0, gridsize};
Point(2) = {1, 0, 0, gridsize};
Point(3) = {1, 1, 0, gridsize};
Point(4) = {0, 1, 0, gridsize};
Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {3, 4};
Line(4) = {4, 1};
Line Loop(8) = {1,2,3,4};
Plane Surface(9) = {8};
/*
// This is for a quadilateral mesh
Transfinite Line{1, 2, 3, 4} = gridsize;
Transfinite Surface{9};
Recombine Surface{9};
*/
// This just creates a hybrid mesh that minimizes the elements
// It will mainly end up with quadilaterals (and few if any triangles)
//Recombine Surface{9};
This diff is collapsed.
FILE(GLOB SRC *.hpp *.cpp)
add_executable_betl(TestCase1 ${SRC})
This diff is collapsed.
cl__1 = 1;
Point(1) = {0, 0, 0, 1};
Point(2) = {10, 0, 0, 1};
Point(3) = {10, 2, 0, 1};
Point(4) = {10, 10, 0, 1};
Point(5) = {0, 10, 0, 1};
Point(6) = {0, 3, 0, 1};
Point(7) = {3, 3, 0, 1};
Point(8) = {3, 2, 0, 1};
Point(9) = {0, 2, 0, 1};
Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {3, 4};
Line(4) = {4, 5};
Line(5) = {5, 6};
Line(6) = {6, 7};
Line(7) = {7, 8};
Line(8) = {8, 9};
Line(9) = {9, 1};
Line(10) = {3, 8};
Line Loop(10) = {3, 4, 5, 6, 7, -10};
Line Loop(11) = {1, 2, 10, 8, 9};
Plane Surface(12) = {10};
Plane Surface(13) = {11};
Physical Surface("Vacuum") = {12};
Physical Surface("Material") = {13};
Physical Line("Dirichlet_Boundary") = {1, 2, 3, 4, 6, 7, 8};
Physical Line("Source") = {6, 7, 8};
$MeshFormat
2.2 0 8
$EndMeshFormat
$PhysicalNames
4
1 3 "Dirichlet_Boundary"
1 4 "Source"
2 1 "Vacuum"
2 2 "Material"
$EndPhysicalNames
$Nodes
151
1 0 0 0
2 10 0 0
3 10 2 0
4 10 10 0
5 0 10 0
6 0 3 0
7 3 3 0
8 3 2 0
9 0 2 0
10 0.9999999999991893 0 0
11 1.999999999996827 0 0
12 2.99999999999391 0 0
13 3.999999999991027 0 0
14 4.999999999992411 0 0
15 5.999999999993932 0 0
16 6.999999999995455 0 0
17 7.999999999996978 0 0
18 8.99999999999849 0 0
19 10 0.999999999997388 0
20 10 3.000000000001389 0
21 10 4.000000000002689 0
22 10 4.999999999998614 0
23 10 5.999999999994625 0
24 10 7.000000000001388 0
25 10 8.00000000000815 0
26 10 9.000000000004162 0
27 8.999999999999998 10 0
28 7.999999999999996 10 0
29 6.999999999999994 10 0
30 5.999999999999991 10 0
31 4.999999999999989 10 0
32 3.999999999999988 10 0
33 2.999999999999985 10 0
34 1.999999999999982 10 0
35 0.9999999999999911 10 0
36 0 9.000000000003469 0
37 0 8.000000000014371 0
38 0 7.00000000001293 0
39 0 6.000000000005047 0
40 0 5.000000000003166 0
41 0 4.000000000001585 0
42 0.9999999999960245 3 0
43 1.999999999996158 3 0
44 2.000000000001941 2 0
45 1.00000000000281 2 0
46 0 1.000000000004118 0
47 9.000000000003469 2 0
48 8.000000000014371 2 0
49 7.00000000001293 2 0
50 6.000000000005047 2 0
51 5.000000000003166 2 0
52 4.000000000001585 2 0
53 5.610065731614519 5.973762852143041 0
54 2.949152773576361 7.195912013291315 0
55 7.527275866961337 4.458234147709717 0
56 7.570175438597691 7.570175438595939 0
57 3.719450033534971 5.045674044265462 0
58 4.805256430692676 7.972553774610899 0
59 5.383990844542328 4.080699327120229 0
60 1.998428383919888 5.591547010051502 0
61 1.649370000752236 8.38106502654143 0
62 8.381983619167583 5.952653951433925 0
63 6.256370701534465 8.512792875673572 0
64 3.429773270897304 8.550456951620118 0
65 4.254703451764664 6.417260928478974 0
66 8.362040299067822 3.389179240096524 0
67 8.599860446572194 8.599860446570526 0
68 1.516911360879619 6.79371806906505 0
69 2.514474444933656 4.202610035006024 0
70 6.732050849350875 3.313956195202977 0
71 4.367454112747065 3.674770053617936 0
72 6.865950090208239 5.526951423964299 0
73 6.316320413322542 7.131999727798577 0
74 1.211667271714259 4.417841382593251 0
75 8.769558611923763 4.90689821392264 0
76 8.815207437446306 7.171111581031695 0
77 4.99403247369435 5.138201100108367 0
78 7.406216139485295 8.685542959438729 0
79 2.84916530562938 5.886001755141958 0
80 6.527642833906233 4.581443414396769 0
81 4.470308908302205 8.960782347991154 0
82 2.539799384544057 9.064476710225994 0
83 4.958903222666221 3.059910294098027 0
84 5.249835017729398 6.885541999543592 0
85 3.922956516457256 7.41126648799538 0
86 7.500155704162211 2.806194290802208 0
87 7.287169178928225 6.540981879585573 0
88 5.596653808458474 9.198503949330632 0
89 1.000550105537562 8.999449894462437 0
90 0.9914958177711375 5.33772266624986 0
91 0.9508518932555347 7.526925475462162 0
92 2.672279092656517 8.052058585155226 0
93 5.869320500733336 2.953924200732102 0
94 9.291242581402395 5.67400302940065 0
95 2.317721640335759 6.484420695930506 0
96 3.888500694283547 2.888500694283371 0
97 5.738147531662944 7.797614533482591 0
98 7.759830505781325 5.247083950235874 0
99 3.374016990602328 3.948249555979512 0
100 9.175733250396435 4.006193951412918 0
101 9.190491110300231 7.997296754625337 0
102 6.451848129895644 9.279367956888587 0
103 5.915524076982581 5.236622730256203 0
104 9.252938611429842 6.487348505348333 0
105 0.7753711267792252 6.344090944734584 0
106 6.389458682233013 6.28795070833015 0
107 2.859250920645389 5.027020304388467 0
108 9.161645875345956 2.839802811342452 0
109 9.153452897408847 9.13740685216556 0
110 2.009381126909338 7.405683310907614 0
111 3.499999999999986 9.344247876238736 0
112 4.313738837403545 5.526260455634369 0
113 1.764532803485835 3.81083003080908 0
114 6.783069932361933 7.788331357855797 0
115 8.286134554368264 4.190244528645856 0
116 8.317645139860781 7.829185976482418 0
117 4.322107193338462 4.523568035465541 0
118 3.394243474457248 6.509995113561915 0
119 0.7464321429197563 3.764254577068684 0
120 8.130365827580665 9.227283911793338 0
121 1.735097694274813 9.265160518151971 0
122 8.412577897687122 2.617437670761279 0
123 4.119717745016579 8.254487752169448 0
124 1.9174461536305 4.719619722075227 0
125 7.33874983952111 3.772074473799762 0
126 4.89400138755982 6.009738247667816 0
127 6.593953898911934 2.61378988952248 0
128 8.179378353930796 6.782472760939187 0
129 6.306970337387245 3.82431856816623 0
130 1.486174093498103 6.128682270533731 0
131 0.5428795126271242 4.500000000002377 0
132 0.6541231896154552 8.372228829883992 0
133 3.323484259310451 7.810229337629179 0
134 2.583233461988562 3.585397747948559 0
135 4.500000000002376 2.511364973687661 0
136 5.363500503779483 8.452007914080045 0
137 3.565092003905867 5.735368766911858 0
138 7.124934819851161 4.947616826553721 0
139 0.5005498032557684 9.499450196745961 0
140 8.570153061229991 0.9936224489809784 0
141 2.486111111108124 0.979166666666151 0
142 4.499999999996762 0.9999999999979183 0
143 6.50000000000899 1.00000000000437 0
144 1.397073412698163 1.014632936507686 0
145 5.500000000000051 1.000000000000381 0
146 7.511692176876451 0.9989370748308914 0
147 3.497685185181901 0.9965277777773449 0
148 9.28944466166716 1.265937237038238 0
149 0.6792036056387318 0.7024970581034777 0
150 0.6066308438906595 1.363855872246589 0
151 9.371919544579127 0.6519119372033209 0
$EndNodes
$Elements
298
1 1 2 3 1 1 10
2 1 2 3 1 10 11
3 1 2 3 1 11 12
4 1 2 3 1 12 13
5 1 2 3 1 13 14
6 1 2 3 1 14 15
7 1 2 3 1 15 16
8 1 2 3 1 16 17
9 1 2 3 1 17 18
10 1 2 3 1 18 2
11 1 2 3 2 2 19
12 1 2 3 2 19 3
13 1 2 3 3 3 20
14 1 2 3 3 20 21
15 1 2 3 3 21 22
16 1 2 3 3 22 23
17 1 2 3 3 23 24
18 1 2 3 3 24 25
19 1 2 3 3 25 26
20 1 2 3 3 26 4
21 1 2 3 4 4 27
22 1 2 3 4 27 28
23 1 2 3 4 28 29
24 1 2 3 4 29 30
25 1 2 3 4 30 31
26 1 2 3 4 31 32
27 1 2 3 4 32 33
28 1 2 3 4 33 34
29 1 2 3 4 34 35
30 1 2 3 4 35 5
31 1 2 3 6 6 42
32 1 2 4 6 6 42
33 1 2 3 6 42 43