From: Guido Kanschat Date: Tue, 4 Apr 2000 18:57:32 +0000 (+0000) Subject: test on two grids X-Git-Tag: v8.0.0~20706 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=035c38849c0a48571c8cf04cf147f683deace1a7;p=dealii.git test on two grids git-svn-id: https://svn.dealii.org/trunk@2677 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/fe/show_transfer.cc b/tests/fe/show_transfer.cc index ff5eabb56e..5d588a4058 100644 --- a/tests/fe/show_transfer.cc +++ b/tests/fe/show_transfer.cc @@ -33,12 +33,13 @@ char fname[50]; -#define TEST(el) { el fe; print_matrix(of, tr, fe, #el); } +#define TEST(l,el) { el fe; print_matrix(of, tr, l, fe, #el); } template inline void print_matrix(ostream& of, Triangulation& tr, + unsigned int level, const FiniteElement& finel, const char* name) { @@ -48,8 +49,8 @@ print_matrix(ostream& of, MGTransferPrebuilt transfer; transfer.build_matrices(dof); - unsigned int n_coarse = dof.n_dofs(0); - unsigned int n_fine = dof.n_dofs(1); + unsigned int n_coarse = dof.n_dofs(level-1); + unsigned int n_fine = dof.n_dofs(level); Vector in(n_fine); Vector out(n_coarse); @@ -59,7 +60,7 @@ print_matrix(ostream& of, in = 0.; out = 0.; in(i) = 1.; - transfer.restrict_and_add(1,out,in); + transfer.restrict_and_add(level,out,in); out.print(of, 3, false); } of << endl; @@ -72,19 +73,30 @@ main() Triangulation<2> tr; GridGenerator::hyper_cube(tr, -1., 1.); - tr.refine_global(1); + tr.refine_global(2); ofstream of("transfer.dat"); - TEST(FEQ1<2>); - TEST(FEQ2<2>); - TEST(FEQ3<2>); - TEST(FEQ4<2>); + TEST(1,FEQ1<2>); + TEST(1,FEQ2<2>); + TEST(1,FEQ3<2>); + TEST(1,FEQ4<2>); - TEST(FEDG_Q0<2>); - TEST(FEDG_Q1<2>); - TEST(FEDG_Q2<2>); - TEST(FEDG_Q3<2>); - TEST(FEDG_Q4<2>); + TEST(1,FEDG_Q0<2>); + TEST(1,FEDG_Q1<2>); + TEST(1,FEDG_Q2<2>); + TEST(1,FEDG_Q3<2>); + TEST(1,FEDG_Q4<2>); + + TEST(2,FEQ1<2>); + TEST(2,FEQ2<2>); + TEST(2,FEQ3<2>); + TEST(2,FEQ4<2>); + + TEST(2,FEDG_Q0<2>); + TEST(2,FEDG_Q1<2>); + TEST(2,FEDG_Q2<2>); + TEST(2,FEDG_Q3<2>); + TEST(2,FEDG_Q4<2>); return 0; }