From: Daniel Garcia-Sanchez Date: Sat, 22 Jun 2019 09:39:12 +0000 (+0200) Subject: Add test for std::complex project_boundary_values_curl_conforming_l2 X-Git-Tag: v9.2.0-rc1~1425^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a3684dae2a706cdbbb240f311ea5370bf96a598;p=dealii.git Add test for std::complex project_boundary_values_curl_conforming_l2 --- diff --git a/tests/numerics/project_bv_curl_conf_complex.cc b/tests/numerics/project_bv_curl_conf_complex.cc new file mode 100644 index 0000000000..d958f130c5 --- /dev/null +++ b/tests/numerics/project_bv_curl_conf_complex.cc @@ -0,0 +1,111 @@ +// --------------------------------------------------------------------- +// +// 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 std::complex + +#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); + constraints.close(); + constraints.print(deallog.get_file_stream()); +} + +int +main() +{ + initlog(); + + { + deallog << "Tests with FE_NEdelec:" << std::endl; + + 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); + } + + { + deallog << "Tests with FE_NEdelecSZ:" << std::endl; + + 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_complex.with_complex_values=on.output b/tests/numerics/project_bv_curl_conf_complex.with_complex_values=on.output new file mode 100644 index 0000000000..3480f660e4 --- /dev/null +++ b/tests/numerics/project_bv_curl_conf_complex.with_complex_values=on.output @@ -0,0 +1,423 @@ + +DEAL::Tests with FE_NEdelec: +DEAL::dim=2: + 0 = (1.00000,0.00000) + 1 = 0 + 4 = (0.500000,0.00000) + 5 = 0 + 12 = (1.00000,0.00000) + 13 = 0 + 14 = (0.500000,0.00000) + 15 = 0 + 22 = (1.00000,0.00000) + 23 = 0 + 26 = (0.500000,0.00000) + 27 = 0 + 32 = (1.00000,0.00000) + 33 = 0 + 34 = (0.500000,0.00000) + 35 = 0 +DEAL::dim=3: + 0 = (1.00000,0.00000) + 1 = 0 + 2 = (1.00000,0.00000) + 3 = 0 + 4 = (0.500000,0.00000) + 5 = 0 + 6 = (0.500000,0.00000) + 7 = 0 + 8 = (1.00000,0.00000) + 9 = 0 + 12 = (0.500000,0.00000) + 13 = 0 + 16 = (1.50000,0.00000) + 17 = 0 + 18 = (1.50000,0.00000) + 19 = 0 + 20 = (1.50000,0.00000) + 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,0.00000) + 55 = 0 + 56 = (0.500000,0.00000) + 57 = 0 + 58 = (0.500000,0.00000) + 59 = 0 + 60 = (1.00000,0.00000) + 61 = 0 + 62 = (0.500000,0.00000) + 63 = 0 + 66 = (1.50000,0.00000) + 67 = 0 + 68 = (1.50000,0.00000) + 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,0.00000) + 97 = 0 + 98 = (1.00000,0.00000) + 99 = 0 + 100 = (0.500000,0.00000) + 101 = 0 + 102 = (1.00000,0.00000) + 103 = 0 + 106 = (0.500000,0.00000) + 107 = 0 + 108 = (1.50000,0.00000) + 109 = 0 + 110 = (1.50000,0.00000) + 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,0.00000) + 139 = 0 + 140 = (0.500000,0.00000) + 141 = 0 + 142 = (1.00000,0.00000) + 143 = 0 + 144 = (0.500000,0.00000) + 145 = 0 + 146 = (1.50000,0.00000) + 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,0.00000) + 171 = 0 + 172 = (1.00000,0.00000) + 173 = 0 + 174 = (0.500000,0.00000) + 175 = 0 + 176 = (0.500000,0.00000) + 177 = 0 + 178 = (1.50000,0.00000) + 179 = 0 + 180 = (1.50000,0.00000) + 181 = 0 + 182 = (1.50000,0.00000) + 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,0.00000) + 213 = 0 + 214 = (0.500000,0.00000) + 215 = 0 + 216 = (0.500000,0.00000) + 217 = 0 + 218 = (1.50000,0.00000) + 219 = 0 + 220 = (1.50000,0.00000) + 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,0.00000) + 245 = 0 + 246 = (1.00000,0.00000) + 247 = 0 + 248 = (0.500000,0.00000) + 249 = 0 + 250 = (1.50000,0.00000) + 251 = 0 + 252 = (1.50000,0.00000) + 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,0.00000) + 277 = 0 + 278 = (0.500000,0.00000) + 279 = 0 + 280 = (1.50000,0.00000) + 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::Tests with FE_NEdelecSZ: +DEAL::dim=2: + 0 = (-1.00000,0.00000) + 1 = 0 + 4 = (-0.500000,0.00000) + 5 = 0 + 12 = (-1.00000,0.00000) + 13 = 0 + 14 = (-0.500000,0.00000) + 15 = 0 + 22 = (-1.00000,0.00000) + 23 = 0 + 26 = (-0.500000,0.00000) + 27 = 0 + 32 = (-1.00000,0.00000) + 33 = 0 + 34 = (-0.500000,0.00000) + 35 = 0 +DEAL::dim=3: + 0 = (-1.00000,0.00000) + 1 = 0 + 2 = (-1.00000,0.00000) + 3 = 0 + 4 = (-0.500000,0.00000) + 5 = 0 + 6 = (-0.500000,0.00000) + 7 = 0 + 8 = (-1.00000,0.00000) + 9 = 0 + 12 = (-0.500000,0.00000) + 13 = 0 + 16 = (-1.50000,0.00000) + 17 = 0 + 18 = (-1.50000,0.00000) + 19 = 0 + 20 = (-1.50000,0.00000) + 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,0.00000) + 55 = 0 + 56 = (-0.500000,0.00000) + 57 = 0 + 58 = (-0.500000,0.00000) + 59 = 0 + 60 = (-1.00000,0.00000) + 61 = 0 + 62 = (-0.500000,0.00000) + 63 = 0 + 66 = (-1.50000,0.00000) + 67 = 0 + 68 = (-1.50000,0.00000) + 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,0.00000) + 97 = 0 + 98 = (-1.00000,0.00000) + 99 = 0 + 100 = (-0.500000,0.00000) + 101 = 0 + 102 = (-1.00000,0.00000) + 103 = 0 + 106 = (-0.500000,0.00000) + 107 = 0 + 108 = (-1.50000,0.00000) + 109 = 0 + 110 = (-1.50000,0.00000) + 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,0.00000) + 139 = 0 + 140 = (-0.500000,0.00000) + 141 = 0 + 142 = (-1.00000,0.00000) + 143 = 0 + 144 = (-0.500000,0.00000) + 145 = 0 + 146 = (-1.50000,0.00000) + 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,0.00000) + 171 = 0 + 172 = (-1.00000,0.00000) + 173 = 0 + 174 = (-0.500000,0.00000) + 175 = 0 + 176 = (-0.500000,0.00000) + 177 = 0 + 178 = (-1.50000,0.00000) + 179 = 0 + 180 = (-1.50000,0.00000) + 181 = 0 + 182 = (-1.50000,0.00000) + 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,0.00000) + 213 = 0 + 214 = (-0.500000,0.00000) + 215 = 0 + 216 = (-0.500000,0.00000) + 217 = 0 + 218 = (-1.50000,0.00000) + 219 = 0 + 220 = (-1.50000,0.00000) + 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,0.00000) + 245 = 0 + 246 = (-1.00000,0.00000) + 247 = 0 + 248 = (-0.500000,0.00000) + 249 = 0 + 250 = (-1.50000,0.00000) + 251 = 0 + 252 = (-1.50000,0.00000) + 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,0.00000) + 277 = 0 + 278 = (-0.500000,0.00000) + 279 = 0 + 280 = (-1.50000,0.00000) + 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