From eaefc321671510d1b65153edef834f9eb50c0a6c Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 14 Nov 2013 20:38:31 +0000 Subject: [PATCH] Avoid instantiating FE_FaceQ and FE_FaceP in 1d. git-svn-id: https://svn.dealii.org/trunk@31661 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/fe/fe_data_test.cc | 120 +++++++++++++++++++++------------------ 1 file changed, 65 insertions(+), 55 deletions(-) diff --git a/tests/fe/fe_data_test.cc b/tests/fe/fe_data_test.cc index 40abc11a96..7d00b83826 100644 --- a/tests/fe/fe_data_test.cc +++ b/tests/fe/fe_data_test.cc @@ -40,6 +40,70 @@ //TODO: Find support_on_face problems for test-no. > 7 //TODO: Check support_on_face in 3D + +template +void test_2d_3d (std::vector *> &fe_datas) +{ + // Face Q elements + fe_datas.push_back(new FE_FaceQ (0)); + deallog << (*fe_datas.rbegin())->get_name() << std::endl; + fe_datas.push_back(new FE_FaceQ (1)); + deallog << (*fe_datas.rbegin())->get_name() << std::endl; + fe_datas.push_back(new FE_FaceQ (3)); + deallog << (*fe_datas.rbegin())->get_name() << std::endl; + // Face P elements + fe_datas.push_back(new FE_FaceP (0)); + deallog << (*fe_datas.rbegin())->get_name() << std::endl; + fe_datas.push_back(new FE_FaceP (1)); + deallog << (*fe_datas.rbegin())->get_name() << std::endl; + fe_datas.push_back(new FE_FaceP (3)); + deallog << (*fe_datas.rbegin())->get_name() << std::endl; + // Vector DG elements + fe_datas.push_back( + new FE_DGRaviartThomas(0)); + deallog << (*fe_datas.rbegin())->get_name() << std::endl; + fe_datas.push_back( + new FE_DGRaviartThomas(1)); + deallog << (*fe_datas.rbegin())->get_name() << std::endl; + fe_datas.push_back( + new FE_DGNedelec(0)); + deallog << (*fe_datas.rbegin())->get_name() << std::endl; + fe_datas.push_back( + new FE_DGNedelec(1)); + deallog << (*fe_datas.rbegin())->get_name() << std::endl; + + // Hdiv elements + FE_RaviartThomas *rt0 = new FE_RaviartThomas(0); + fe_datas.push_back(rt0); + deallog << (*fe_datas.rbegin())->get_name() << std::endl; + + FE_RaviartThomas *rt1 = new FE_RaviartThomas(1); + fe_datas.push_back(rt1); + deallog << (*fe_datas.rbegin())->get_name() << std::endl; + + fe_datas.push_back(new FE_RaviartThomas(2)); + deallog << (*fe_datas.rbegin())->get_name() << std::endl; + fe_datas.push_back(new FESystem(*rt1, 1, + FE_DGQ (1), 1)); + deallog << (*fe_datas.rbegin())->get_name() << std::endl; + + // Hcurl elements + FE_Nedelec *ned0 = new FE_Nedelec(0); + fe_datas.push_back(ned0); + deallog << (*fe_datas.rbegin())->get_name() << std::endl; + FE_Nedelec *ned1 = new FE_Nedelec(1); + fe_datas.push_back(ned1); + deallog << (*fe_datas.rbegin())->get_name() << std::endl; +} + + + +void test_2d_3d (std::vector *> &fe_datas) +{} + + + + template void test_fe_datas() { @@ -74,59 +138,8 @@ void test_fe_datas() // Check vector elements in 2d and higher only - if (dim>1) - { - // Face Q elements - fe_datas.push_back(new FE_FaceQ (0)); - deallog << (*fe_datas.rbegin())->get_name() << std::endl; - fe_datas.push_back(new FE_FaceQ (1)); - deallog << (*fe_datas.rbegin())->get_name() << std::endl; - fe_datas.push_back(new FE_FaceQ (3)); - deallog << (*fe_datas.rbegin())->get_name() << std::endl; - // Face P elements - fe_datas.push_back(new FE_FaceP (0)); - deallog << (*fe_datas.rbegin())->get_name() << std::endl; - fe_datas.push_back(new FE_FaceP (1)); - deallog << (*fe_datas.rbegin())->get_name() << std::endl; - fe_datas.push_back(new FE_FaceP (3)); - deallog << (*fe_datas.rbegin())->get_name() << std::endl; - // Vector DG elements - fe_datas.push_back( - new FE_DGRaviartThomas(0)); - deallog << (*fe_datas.rbegin())->get_name() << std::endl; - fe_datas.push_back( - new FE_DGRaviartThomas(1)); - deallog << (*fe_datas.rbegin())->get_name() << std::endl; - fe_datas.push_back( - new FE_DGNedelec(0)); - deallog << (*fe_datas.rbegin())->get_name() << std::endl; - fe_datas.push_back( - new FE_DGNedelec(1)); - deallog << (*fe_datas.rbegin())->get_name() << std::endl; + test_2d_3d (fe_datas); - // Hdiv elements - FE_RaviartThomas *rt0 = new FE_RaviartThomas(0); - fe_datas.push_back(rt0); - deallog << (*fe_datas.rbegin())->get_name() << std::endl; - - FE_RaviartThomas *rt1 = new FE_RaviartThomas(1); - fe_datas.push_back(rt1); - deallog << (*fe_datas.rbegin())->get_name() << std::endl; - - fe_datas.push_back(new FE_RaviartThomas(2)); - deallog << (*fe_datas.rbegin())->get_name() << std::endl; - fe_datas.push_back(new FESystem(*rt1, 1, - FE_DGQ (1), 1)); - deallog << (*fe_datas.rbegin())->get_name() << std::endl; - - // Hcurl elements - FE_Nedelec *ned0 = new FE_Nedelec(0); - fe_datas.push_back(ned0); - deallog << (*fe_datas.rbegin())->get_name() << std::endl; - FE_Nedelec *ned1 = new FE_Nedelec(1); - fe_datas.push_back(ned1); - deallog << (*fe_datas.rbegin())->get_name() << std::endl; - } if (dim==2) { fe_datas.push_back( @@ -265,6 +278,3 @@ int main() test_fe_datas<2>(); test_fe_datas<3>(); } - - - -- 2.39.5