From: Daniel Garcia-Sanchez Date: Mon, 27 Jul 2020 15:46:49 +0000 (+0200) Subject: Add test for the hp variant of project_boundary_values_curl_conforming_l2() X-Git-Tag: v9.3.0-rc1~1236^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c4d370267b333cecbb51ba784fc090c96249da5;p=dealii.git Add test for the hp variant of project_boundary_values_curl_conforming_l2() --- diff --git a/tests/numerics/project_bv_curl_conf_05.cc b/tests/numerics/project_bv_curl_conf_05.cc new file mode 100644 index 0000000000..973c4b8267 --- /dev/null +++ b/tests/numerics/project_bv_curl_conf_05.cc @@ -0,0 +1,113 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2013 - 2018 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE.md at +// the top level directory of deal.II. +// +// --------------------------------------------------------------------- +// +// Same as project_bv_curl_conf.cc for hp + +#include + +#include + +#include +#include + +#include +#include + +#include + +#include +#include + +#include "../tests.h" + +template +class BoundaryFunction : public Function +{ +public: + BoundaryFunction(); + virtual void + vector_value(const Point &p, Vector &values) const; +}; + +template +BoundaryFunction::BoundaryFunction() + : Function(dim) +{} + +template +void +BoundaryFunction::vector_value(const Point &, + Vector &values) const +{ + for (unsigned int d = 0; d < dim; ++d) + values(d) = d + 1.0; +} + +template +void +test_boundary_values(const FiniteElement &fe) +{ + Triangulation triangulation; + + GridGenerator::subdivided_hyper_cube(triangulation, 2); + + DoFHandler dof_handler(triangulation); + + dof_handler.distribute_dofs(fe); + + BoundaryFunction boundary_function; + AffineConstraints constraints; + + constraints.clear(); + VectorTools::project_boundary_values_curl_conforming_l2( + dof_handler, + 0, + boundary_function, + 0, + constraints, + hp::StaticMappingQ1::mapping_collection); + constraints.close(); + constraints.print(deallog.get_file_stream()); +} + +int +main() +{ + initlog(); + + { + FE_Nedelec<2> fe_2(1); + + deallog << "dim=2:" << std::endl; + test_boundary_values(fe_2); + + FE_Nedelec<3> fe_3(1); + + deallog << "dim=3:" << std::endl; + test_boundary_values(fe_3); + } + + { + FE_NedelecSZ<2> fe_2(1); + + deallog << "dim=2:" << std::endl; + test_boundary_values(fe_2); + + FE_NedelecSZ<3> fe_3(1); + + deallog << "dim=3:" << std::endl; + test_boundary_values(fe_3); + } +} diff --git a/tests/numerics/project_bv_curl_conf_05.output b/tests/numerics/project_bv_curl_conf_05.output new file mode 100644 index 0000000000..610200871f --- /dev/null +++ b/tests/numerics/project_bv_curl_conf_05.output @@ -0,0 +1,421 @@ + +DEAL::dim=2: + 0 = 1.00000 + 1 = 0 + 4 = 0.500000 + 5 = 0 + 12 = 1.00000 + 13 = 0 + 14 = 0.500000 + 15 = 0 + 22 = 1.00000 + 23 = 0 + 26 = 0.500000 + 27 = 0 + 32 = 1.00000 + 33 = 0 + 34 = 0.500000 + 35 = 0 +DEAL::dim=3: + 0 = 1.00000 + 1 = 0 + 2 = 1.00000 + 3 = 0 + 4 = 0.500000 + 5 = 0 + 6 = 0.500000 + 7 = 0 + 8 = 1.00000 + 9 = 0 + 12 = 0.500000 + 13 = 0 + 16 = 1.50000 + 17 = 0 + 18 = 1.50000 + 19 = 0 + 20 = 1.50000 + 21 = 0 + 24 = 0 + 25 = 0 + 26 = 0 + 27 = 0 + 32 = 0 + 33 = 0 + 34 = 0 + 35 = 0 + 40 = 0 + 41 = 0 + 42 = 0 + 43 = 0 + 54 = 1.00000 + 55 = 0 + 56 = 0.500000 + 57 = 0 + 58 = 0.500000 + 59 = 0 + 60 = 1.00000 + 61 = 0 + 62 = 0.500000 + 63 = 0 + 66 = 1.50000 + 67 = 0 + 68 = 1.50000 + 69 = 0 + 70 = 0 + 71 = 0 + 72 = 0 + 73 = 0 + 74 = 0 + 75 = 0 + 76 = 0 + 77 = 0 + 82 = 0 + 83 = 0 + 84 = 0 + 85 = 0 + 96 = 1.00000 + 97 = 0 + 98 = 1.00000 + 99 = 0 + 100 = 0.500000 + 101 = 0 + 102 = 1.00000 + 103 = 0 + 106 = 0.500000 + 107 = 0 + 108 = 1.50000 + 109 = 0 + 110 = 1.50000 + 111 = 0 + 112 = 0 + 113 = 0 + 114 = 0 + 115 = 0 + 120 = 0 + 121 = 0 + 122 = 0 + 123 = 0 + 124 = 0 + 125 = 0 + 126 = 0 + 127 = 0 + 138 = 1.00000 + 139 = 0 + 140 = 0.500000 + 141 = 0 + 142 = 1.00000 + 143 = 0 + 144 = 0.500000 + 145 = 0 + 146 = 1.50000 + 147 = 0 + 148 = 0 + 149 = 0 + 150 = 0 + 151 = 0 + 152 = 0 + 153 = 0 + 154 = 0 + 155 = 0 + 156 = 0 + 157 = 0 + 158 = 0 + 159 = 0 + 170 = 1.00000 + 171 = 0 + 172 = 1.00000 + 173 = 0 + 174 = 0.500000 + 175 = 0 + 176 = 0.500000 + 177 = 0 + 178 = 1.50000 + 179 = 0 + 180 = 1.50000 + 181 = 0 + 182 = 1.50000 + 183 = 0 + 186 = 0 + 187 = 0 + 188 = 0 + 189 = 0 + 194 = 0 + 195 = 0 + 196 = 0 + 197 = 0 + 202 = 0 + 203 = 0 + 204 = 0 + 205 = 0 + 212 = 1.00000 + 213 = 0 + 214 = 0.500000 + 215 = 0 + 216 = 0.500000 + 217 = 0 + 218 = 1.50000 + 219 = 0 + 220 = 1.50000 + 221 = 0 + 222 = 0 + 223 = 0 + 224 = 0 + 225 = 0 + 226 = 0 + 227 = 0 + 228 = 0 + 229 = 0 + 234 = 0 + 235 = 0 + 236 = 0 + 237 = 0 + 244 = 1.00000 + 245 = 0 + 246 = 1.00000 + 247 = 0 + 248 = 0.500000 + 249 = 0 + 250 = 1.50000 + 251 = 0 + 252 = 1.50000 + 253 = 0 + 254 = 0 + 255 = 0 + 256 = 0 + 257 = 0 + 262 = 0 + 263 = 0 + 264 = 0 + 265 = 0 + 266 = 0 + 267 = 0 + 268 = 0 + 269 = 0 + 276 = 1.00000 + 277 = 0 + 278 = 0.500000 + 279 = 0 + 280 = 1.50000 + 281 = 0 + 282 = 0 + 283 = 0 + 284 = 0 + 285 = 0 + 286 = 0 + 287 = 0 + 288 = 0 + 289 = 0 + 290 = 0 + 291 = 0 + 292 = 0 + 293 = 0 +DEAL::dim=2: + 0 = -1.00000 + 1 = 0 + 4 = -0.500000 + 5 = 0 + 12 = -1.00000 + 13 = 0 + 14 = -0.500000 + 15 = 0 + 22 = -1.00000 + 23 = 0 + 26 = -0.500000 + 27 = 0 + 32 = -1.00000 + 33 = 0 + 34 = -0.500000 + 35 = 0 +DEAL::dim=3: + 0 = -1.00000 + 1 = 0 + 2 = -1.00000 + 3 = 0 + 4 = -0.500000 + 5 = 0 + 6 = -0.500000 + 7 = 0 + 8 = -1.00000 + 9 = 0 + 12 = -0.500000 + 13 = 0 + 16 = -1.50000 + 17 = 0 + 18 = -1.50000 + 19 = 0 + 20 = -1.50000 + 21 = 0 + 24 = 0 + 25 = 0 + 26 = 0 + 27 = 0 + 32 = 0 + 33 = 0 + 34 = 0 + 35 = 0 + 40 = 0 + 41 = 0 + 42 = 0 + 43 = 0 + 54 = -1.00000 + 55 = 0 + 56 = -0.500000 + 57 = 0 + 58 = -0.500000 + 59 = 0 + 60 = -1.00000 + 61 = 0 + 62 = -0.500000 + 63 = 0 + 66 = -1.50000 + 67 = 0 + 68 = -1.50000 + 69 = 0 + 70 = 0 + 71 = 0 + 72 = 0 + 73 = 0 + 74 = 0 + 75 = 0 + 76 = 0 + 77 = 0 + 82 = 0 + 83 = 0 + 84 = 0 + 85 = 0 + 96 = -1.00000 + 97 = 0 + 98 = -1.00000 + 99 = 0 + 100 = -0.500000 + 101 = 0 + 102 = -1.00000 + 103 = 0 + 106 = -0.500000 + 107 = 0 + 108 = -1.50000 + 109 = 0 + 110 = -1.50000 + 111 = 0 + 112 = 0 + 113 = 0 + 114 = 0 + 115 = 0 + 120 = 0 + 121 = 0 + 122 = 0 + 123 = 0 + 124 = 0 + 125 = 0 + 126 = 0 + 127 = 0 + 138 = -1.00000 + 139 = 0 + 140 = -0.500000 + 141 = 0 + 142 = -1.00000 + 143 = 0 + 144 = -0.500000 + 145 = 0 + 146 = -1.50000 + 147 = 0 + 148 = 0 + 149 = 0 + 150 = 0 + 151 = 0 + 152 = 0 + 153 = 0 + 154 = 0 + 155 = 0 + 156 = 0 + 157 = 0 + 158 = 0 + 159 = 0 + 170 = -1.00000 + 171 = 0 + 172 = -1.00000 + 173 = 0 + 174 = -0.500000 + 175 = 0 + 176 = -0.500000 + 177 = 0 + 178 = -1.50000 + 179 = 0 + 180 = -1.50000 + 181 = 0 + 182 = -1.50000 + 183 = 0 + 186 = 0 + 187 = 0 + 188 = 0 + 189 = 0 + 194 = 0 + 195 = 0 + 196 = 0 + 197 = 0 + 202 = 0 + 203 = 0 + 204 = 0 + 205 = 0 + 212 = -1.00000 + 213 = 0 + 214 = -0.500000 + 215 = 0 + 216 = -0.500000 + 217 = 0 + 218 = -1.50000 + 219 = 0 + 220 = -1.50000 + 221 = 0 + 222 = 0 + 223 = 0 + 224 = 0 + 225 = 0 + 226 = 0 + 227 = 0 + 228 = 0 + 229 = 0 + 234 = 0 + 235 = 0 + 236 = 0 + 237 = 0 + 244 = -1.00000 + 245 = 0 + 246 = -1.00000 + 247 = 0 + 248 = -0.500000 + 249 = 0 + 250 = -1.50000 + 251 = 0 + 252 = -1.50000 + 253 = 0 + 254 = 0 + 255 = 0 + 256 = 0 + 257 = 0 + 262 = 0 + 263 = 0 + 264 = 0 + 265 = 0 + 266 = 0 + 267 = 0 + 268 = 0 + 269 = 0 + 276 = -1.00000 + 277 = 0 + 278 = -0.500000 + 279 = 0 + 280 = -1.50000 + 281 = 0 + 282 = 0 + 283 = 0 + 284 = 0 + 285 = 0 + 286 = 0 + 287 = 0 + 288 = 0 + 289 = 0 + 290 = 0 + 291 = 0 + 292 = 0 + 293 = 0