From 9a04965fe2c86f3653e9a771120b20ae75d446e3 Mon Sep 17 00:00:00 2001 From: wolf Date: Fri, 31 Aug 2001 08:37:33 +0000 Subject: [PATCH] New test. git-svn-id: https://svn.dealii.org/trunk@4925 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/fe/Makefile.in | 3 +- tests/fe/numbering.cc | 114 +++++++++++++++++++++++++++++++++++++ tests/fe/numbering.checked | 39 +++++++++++++ 3 files changed, 155 insertions(+), 1 deletion(-) create mode 100644 tests/fe/numbering.cc create mode 100644 tests/fe/numbering.checked diff --git a/tests/fe/Makefile.in b/tests/fe/Makefile.in index 4f8e48370b..9c3dae06a8 100644 --- a/tests/fe/Makefile.in +++ b/tests/fe/Makefile.in @@ -35,8 +35,9 @@ fe_data_test.exe : fe_data_test.go $(libraries) mapping.exe : mapping.go $(libraries) mapping_c1.exe : mapping_c1.go $(libraries) shapes.exe : shapes.go $(libraries) +numbering.exe : numbering.go $(libraries) -tests = derivatives fe_data_test mapping mapping_c1 shapes +tests = derivatives fe_data_test mapping mapping_c1 shapes numbering ############################################################ diff --git a/tests/fe/numbering.cc b/tests/fe/numbering.cc new file mode 100644 index 0000000000..faa2277643 --- /dev/null +++ b/tests/fe/numbering.cc @@ -0,0 +1,114 @@ +// $Id$ +// Author: Wolfgang Bangerth, 2001 +// +// Check the numbering of finite elements + +#include +#include +#include +#include +#include + + +std::ofstream logfile ("numbering.output"); + + +template +void check (const FE_Q &fe) +{ + Assert (fe.n_components() == 1, ExcInternalError()); + + std::vector hierarchic_to_lexicographic_numbering (fe.dofs_per_cell); + + const unsigned int dofs_per_cell = fe.dofs_per_cell; + // polynomial degree + const unsigned int degree = fe.dofs_per_line+1; + // number of grid points in each direction + const unsigned int n = degree+1; + + switch (dim) + { + case 1: + { + hierarchic_to_lexicographic_numbering[0] = 0; + hierarchic_to_lexicographic_numbering[1] = dofs_per_cell-1; + for (unsigned int i=2; i & + lexicographic_to_hierarchical_numbering = fe.get_renumber(); + for (unsigned int i=0; i +void check_dim () +{ + for (unsigned int degree=1; degree<4; ++degree) + { + FE_Q fe(degree); + check (fe); + }; +}; + + +int main () +{ + logfile.precision (2); + logfile.setf(std::ios::fixed); + deallog.attach(logfile); + deallog.depth_console (0); + + check_dim<1> (); + check_dim<2> (); +}; + + diff --git a/tests/fe/numbering.checked b/tests/fe/numbering.checked new file mode 100644 index 0000000000..446d3561d3 --- /dev/null +++ b/tests/fe/numbering.checked @@ -0,0 +1,39 @@ + +1d, degree=1: 0 0 +1d, degree=1: 1 1 +1d, degree=2: 0 0 +1d, degree=2: 2 2 +1d, degree=2: 1 1 +1d, degree=3: 0 0 +1d, degree=3: 2 3 +1d, degree=3: 3 1 +1d, degree=3: 1 2 +2d, degree=1: 0 0 +2d, degree=1: 1 1 +2d, degree=1: 3 3 +2d, degree=1: 2 2 +2d, degree=2: 0 0 +2d, degree=2: 4 2 +2d, degree=2: 1 8 +2d, degree=2: 7 6 +2d, degree=2: 8 1 +2d, degree=2: 5 5 +2d, degree=2: 3 7 +2d, degree=2: 6 3 +2d, degree=2: 2 4 +2d, degree=3: 0 0 +2d, degree=3: 4 3 +2d, degree=3: 5 15 +2d, degree=3: 1 12 +2d, degree=3: 10 1 +2d, degree=3: 12 2 +2d, degree=3: 13 7 +2d, degree=3: 6 11 +2d, degree=3: 11 13 +2d, degree=3: 14 14 +2d, degree=3: 15 4 +2d, degree=3: 7 8 +2d, degree=3: 3 5 +2d, degree=3: 8 6 +2d, degree=3: 9 9 +2d, degree=3: 2 10 -- 2.39.5