From 45c1c465a99400dc825457d6e71e34ed3356bac1 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Wed, 1 Aug 2018 10:00:41 +0200 Subject: [PATCH] Add vtk output of curved mesh. --- tests/data_out/data_out_base_vtk_03.cc | 2 +- tests/data_out/data_out_base_vtk_04.cc | 73 ++++ tests/data_out/data_out_base_vtk_04.output | 424 +++++++++++++++++++++ tests/data_out/data_out_base_vtk_05.cc | 72 ++++ tests/data_out/data_out_base_vtk_05.output | 406 ++++++++++++++++++++ 5 files changed, 976 insertions(+), 1 deletion(-) create mode 100644 tests/data_out/data_out_base_vtk_04.cc create mode 100644 tests/data_out/data_out_base_vtk_04.output create mode 100644 tests/data_out/data_out_base_vtk_05.cc create mode 100644 tests/data_out/data_out_base_vtk_05.output diff --git a/tests/data_out/data_out_base_vtk_03.cc b/tests/data_out/data_out_base_vtk_03.cc index b770a91c8c..cb7729b828 100644 --- a/tests/data_out/data_out_base_vtk_03.cc +++ b/tests/data_out/data_out_base_vtk_03.cc @@ -13,7 +13,7 @@ // // --------------------------------------------------------------------- -// Test high-order Lagrange VTK output for on a unit cube. +// Test high-order Lagrange VTK output on a unit cube. // Added by Alexander Grayver #include diff --git a/tests/data_out/data_out_base_vtk_04.cc b/tests/data_out/data_out_base_vtk_04.cc new file mode 100644 index 0000000000..8f781b8b79 --- /dev/null +++ b/tests/data_out/data_out_base_vtk_04.cc @@ -0,0 +1,73 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 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. +// +// --------------------------------------------------------------------- + +// Test high-order Lagrange VTK output on a 2D shell + +#include + +#include + +#include +#include + +#include +#include + +#include +#include + +#include + +#include "../tests.h" + +template +void +check(std::ostream &log, unsigned cell_order) +{ + Triangulation triangulation; + GridGenerator::hyper_shell(triangulation, Point(), 0.5, 1, 6); + triangulation.refine_global(1); + + FE_Q fe(cell_order); + DoFHandler dof_handler(triangulation); + dof_handler.distribute_dofs(fe); + + Vector vec(dof_handler.n_dofs()); + MappingQGeneric mapping(cell_order); + + VectorTools::interpolate(mapping, + dof_handler, + Functions::SquareFunction(), + vec); + + DataOutBase::VtkFlags flags; + flags.write_higher_order_cells = true; + + DataOut data_out; + data_out.set_flags(flags); + data_out.attach_dof_handler(dof_handler); + data_out.add_data_vector(vec, "square_function"); + data_out.build_patches(mapping, cell_order, DataOut::curved_inner_cells); + data_out.write_vtk(log); +} + +int +main() +{ + initlog(); + + unsigned cell_order = 3; + check<2>(deallog.get_file_stream(), cell_order); +} diff --git a/tests/data_out/data_out_base_vtk_04.output b/tests/data_out/data_out_base_vtk_04.output new file mode 100644 index 0000000000..4a0c81a11d --- /dev/null +++ b/tests/data_out/data_out_base_vtk_04.output @@ -0,0 +1,424 @@ + +# vtk DataFile Version 3.0 +#This file was generated +ASCII +DATASET UNSTRUCTURED_GRID + +POINTS 384 double +1.00000 0.00000 0 +0.984793 0.173644 0 +0.939678 0.342016 0 +0.866025 0.500000 0 +0.916667 0.00000 0 +0.902727 0.159174 0 +0.861371 0.313515 0 +0.793857 0.458333 0 +0.833333 0.00000 0 +0.820661 0.144704 0 +0.783065 0.285013 0 +0.721688 0.416667 0 +0.750000 0.00000 0 +0.738595 0.130233 0 +0.704758 0.256512 0 +0.649519 0.375000 0 +0.866025 0.500000 0 +0.766033 0.642777 0 +0.642777 0.766033 0 +0.500000 0.866025 0 +0.793857 0.458333 0 +0.702197 0.589212 0 +0.589212 0.702197 0 +0.458333 0.793857 0 +0.721688 0.416667 0 +0.638361 0.535647 0 +0.535647 0.638361 0 +0.416667 0.721688 0 +0.649519 0.375000 0 +0.574525 0.482083 0 +0.482083 0.574525 0 +0.375000 0.649519 0 +0.750000 0.00000 0 +0.738595 0.130233 0 +0.704758 0.256512 0 +0.649519 0.375000 0 +0.666667 0.00000 0 +0.656529 0.115763 0 +0.626452 0.228011 0 +0.577350 0.333333 0 +0.583333 0.00000 0 +0.574462 0.101293 0 +0.548145 0.199509 0 +0.505181 0.291667 0 +0.500000 0.00000 0 +0.492396 0.0868222 0 +0.469839 0.171008 0 +0.433013 0.250000 0 +0.649519 0.375000 0 +0.574525 0.482083 0 +0.482083 0.574525 0 +0.375000 0.649519 0 +0.577350 0.333333 0 +0.510689 0.428518 0 +0.428518 0.510689 0 +0.333333 0.577350 0 +0.505181 0.291667 0 +0.446853 0.374953 0 +0.374953 0.446853 0 +0.291667 0.505181 0 +0.433013 0.250000 0 +0.383017 0.321388 0 +0.321388 0.383017 0 +0.250000 0.433013 0 +0.500000 0.866025 0 +0.342016 0.939678 0 +0.173644 0.984793 0 +2.22045e-16 1.00000 0 +0.458333 0.793857 0 +0.313515 0.861371 0 +0.159174 0.902727 0 +4.32209e-16 0.916667 0 +0.416667 0.721688 0 +0.285013 0.783065 0 +0.144704 0.820661 0 +2.43177e-16 0.833333 0 +0.375000 0.649519 0 +0.256512 0.704758 0 +0.130233 0.738595 0 +3.60822e-16 0.750000 0 +2.22045e-16 1.00000 0 +-0.173644 0.984793 0 +-0.342016 0.939678 0 +-0.500000 0.866025 0 +4.32209e-16 0.916667 0 +-0.159174 0.902727 0 +-0.313515 0.861371 0 +-0.458333 0.793857 0 +2.43177e-16 0.833333 0 +-0.144704 0.820661 0 +-0.285013 0.783065 0 +-0.416667 0.721688 0 +3.60822e-16 0.750000 0 +-0.130233 0.738595 0 +-0.256512 0.704758 0 +-0.375000 0.649519 0 +0.375000 0.649519 0 +0.256512 0.704758 0 +0.130233 0.738595 0 +3.60822e-16 0.750000 0 +0.333333 0.577350 0 +0.228011 0.626452 0 +0.115763 0.656529 0 +3.31382e-16 0.666667 0 +0.291667 0.505181 0 +0.199509 0.548145 0 +0.101293 0.574462 0 +2.94661e-16 0.583333 0 +0.250000 0.433013 0 +0.171008 0.469839 0 +0.0868222 0.492396 0 +1.11022e-16 0.500000 0 +3.60822e-16 0.750000 0 +-0.130233 0.738595 0 +-0.256512 0.704758 0 +-0.375000 0.649519 0 +3.31382e-16 0.666667 0 +-0.115763 0.656529 0 +-0.228011 0.626452 0 +-0.333333 0.577350 0 +2.94661e-16 0.583333 0 +-0.101293 0.574462 0 +-0.199509 0.548145 0 +-0.291667 0.505181 0 +1.11022e-16 0.500000 0 +-0.0868222 0.492396 0 +-0.171008 0.469839 0 +-0.250000 0.433013 0 +-0.500000 0.866025 0 +-0.642777 0.766033 0 +-0.766033 0.642777 0 +-0.866025 0.500000 0 +-0.458333 0.793857 0 +-0.589212 0.702197 0 +-0.702197 0.589212 0 +-0.793857 0.458333 0 +-0.416667 0.721688 0 +-0.535647 0.638361 0 +-0.638361 0.535647 0 +-0.721688 0.416667 0 +-0.375000 0.649519 0 +-0.482083 0.574525 0 +-0.574525 0.482083 0 +-0.649519 0.375000 0 +-0.866025 0.500000 0 +-0.939678 0.342016 0 +-0.984793 0.173644 0 +-1.00000 1.11022e-16 0 +-0.793857 0.458333 0 +-0.861371 0.313515 0 +-0.902727 0.159174 0 +-0.916667 1.11022e-16 0 +-0.721688 0.416667 0 +-0.783065 0.285013 0 +-0.820661 0.144704 0 +-0.833333 1.11022e-16 0 +-0.649519 0.375000 0 +-0.704758 0.256512 0 +-0.738595 0.130233 0 +-0.750000 1.11022e-16 0 +-0.375000 0.649519 0 +-0.482083 0.574525 0 +-0.574525 0.482083 0 +-0.649519 0.375000 0 +-0.333333 0.577350 0 +-0.428518 0.510689 0 +-0.510689 0.428518 0 +-0.577350 0.333333 0 +-0.291667 0.505181 0 +-0.374953 0.446853 0 +-0.446853 0.374953 0 +-0.505181 0.291667 0 +-0.250000 0.433013 0 +-0.321388 0.383017 0 +-0.383017 0.321388 0 +-0.433013 0.250000 0 +-0.649519 0.375000 0 +-0.704758 0.256512 0 +-0.738595 0.130233 0 +-0.750000 1.11022e-16 0 +-0.577350 0.333333 0 +-0.626452 0.228011 0 +-0.656529 0.115763 0 +-0.666667 1.05225e-16 0 +-0.505181 0.291667 0 +-0.548145 0.199509 0 +-0.574462 0.101293 0 +-0.583333 6.13083e-17 0 +-0.433013 0.250000 0 +-0.469839 0.171008 0 +-0.492396 0.0868222 0 +-0.500000 5.55112e-17 0 +-1.00000 1.11022e-16 0 +-0.984793 -0.173644 0 +-0.939678 -0.342016 0 +-0.866025 -0.500000 0 +-0.916667 1.11022e-16 0 +-0.902727 -0.159174 0 +-0.861371 -0.313515 0 +-0.793857 -0.458333 0 +-0.833333 1.11022e-16 0 +-0.820661 -0.144704 0 +-0.783065 -0.285013 0 +-0.721688 -0.416667 0 +-0.750000 1.11022e-16 0 +-0.738595 -0.130233 0 +-0.704758 -0.256512 0 +-0.649519 -0.375000 0 +-0.866025 -0.500000 0 +-0.766033 -0.642777 0 +-0.642777 -0.766033 0 +-0.500000 -0.866025 0 +-0.793857 -0.458333 0 +-0.702197 -0.589212 0 +-0.589212 -0.702197 0 +-0.458333 -0.793857 0 +-0.721688 -0.416667 0 +-0.638361 -0.535647 0 +-0.535647 -0.638361 0 +-0.416667 -0.721688 0 +-0.649519 -0.375000 0 +-0.574525 -0.482083 0 +-0.482083 -0.574525 0 +-0.375000 -0.649519 0 +-0.750000 1.11022e-16 0 +-0.738595 -0.130233 0 +-0.704758 -0.256512 0 +-0.649519 -0.375000 0 +-0.666667 1.05225e-16 0 +-0.656529 -0.115763 0 +-0.626452 -0.228011 0 +-0.577350 -0.333333 0 +-0.583333 6.13083e-17 0 +-0.574462 -0.101293 0 +-0.548145 -0.199509 0 +-0.505181 -0.291667 0 +-0.500000 5.55112e-17 0 +-0.492396 -0.0868222 0 +-0.469839 -0.171008 0 +-0.433013 -0.250000 0 +-0.649519 -0.375000 0 +-0.574525 -0.482083 0 +-0.482083 -0.574525 0 +-0.375000 -0.649519 0 +-0.577350 -0.333333 0 +-0.510689 -0.428518 0 +-0.428518 -0.510689 0 +-0.333333 -0.577350 0 +-0.505181 -0.291667 0 +-0.446853 -0.374953 0 +-0.374953 -0.446853 0 +-0.291667 -0.505181 0 +-0.433013 -0.250000 0 +-0.383017 -0.321388 0 +-0.321388 -0.383017 0 +-0.250000 -0.433013 0 +-0.500000 -0.866025 0 +-0.342016 -0.939678 0 +-0.173644 -0.984793 0 +-2.22045e-16 -1.00000 0 +-0.458333 -0.793857 0 +-0.313515 -0.861371 0 +-0.159174 -0.902727 0 +-1.64477e-16 -0.916667 0 +-0.416667 -0.721688 0 +-0.285013 -0.783065 0 +-0.144704 -0.820661 0 +-1.68589e-16 -0.833333 0 +-0.375000 -0.649519 0 +-0.256512 -0.704758 0 +-0.130233 -0.738595 0 +-1.11022e-16 -0.750000 0 +-1.38778e-16 -1.00000 0 +0.173644 -0.984793 0 +0.342016 -0.939678 0 +0.500000 -0.866025 0 +-1.70645e-16 -0.916667 0 +0.159174 -0.902727 0 +0.313515 -0.861371 0 +0.458333 -0.793857 0 +-1.71673e-16 -0.833333 0 +0.144704 -0.820661 0 +0.285013 -0.783065 0 +0.416667 -0.721688 0 +-1.11022e-16 -0.750000 0 +0.130233 -0.738595 0 +0.256512 -0.704758 0 +0.375000 -0.649519 0 +-0.375000 -0.649519 0 +-0.256512 -0.704758 0 +-0.130233 -0.738595 0 +-1.11022e-16 -0.750000 0 +-0.333333 -0.577350 0 +-0.228011 -0.626452 0 +-0.115763 -0.656529 0 +-1.11022e-16 -0.666667 0 +-0.291667 -0.505181 0 +-0.199509 -0.548145 0 +-0.101293 -0.574462 0 +-1.11022e-16 -0.583333 0 +-0.250000 -0.433013 0 +-0.171008 -0.469839 0 +-0.0868222 -0.492396 0 +-1.11022e-16 -0.500000 0 +-1.11022e-16 -0.750000 0 +0.130233 -0.738595 0 +0.256512 -0.704758 0 +0.375000 -0.649519 0 +-1.12564e-16 -0.666667 0 +0.115763 -0.656529 0 +0.228011 -0.626452 0 +0.333333 -0.577350 0 +-1.14106e-16 -0.583333 0 +0.101293 -0.574462 0 +0.199509 -0.548145 0 +0.291667 -0.505181 0 +-6.93889e-17 -0.500000 0 +0.0868222 -0.492396 0 +0.171008 -0.469839 0 +0.250000 -0.433013 0 +0.500000 -0.866025 0 +0.642777 -0.766033 0 +0.766033 -0.642777 0 +0.866025 -0.500000 0 +0.458333 -0.793857 0 +0.589212 -0.702197 0 +0.702197 -0.589212 0 +0.793857 -0.458333 0 +0.416667 -0.721688 0 +0.535647 -0.638361 0 +0.638361 -0.535647 0 +0.721688 -0.416667 0 +0.375000 -0.649519 0 +0.482083 -0.574525 0 +0.574525 -0.482083 0 +0.649519 -0.375000 0 +0.866025 -0.500000 0 +0.939678 -0.342016 0 +0.984793 -0.173644 0 +1.00000 0.00000 0 +0.793857 -0.458333 0 +0.861371 -0.313515 0 +0.902727 -0.159174 0 +0.916667 0.00000 0 +0.721688 -0.416667 0 +0.783065 -0.285013 0 +0.820661 -0.144704 0 +0.833333 0.00000 0 +0.649519 -0.375000 0 +0.704758 -0.256512 0 +0.738595 -0.130233 0 +0.750000 0.00000 0 +0.375000 -0.649519 0 +0.482083 -0.574525 0 +0.574525 -0.482083 0 +0.649519 -0.375000 0 +0.333333 -0.577350 0 +0.428518 -0.510689 0 +0.510689 -0.428518 0 +0.577350 -0.333333 0 +0.291667 -0.505181 0 +0.374953 -0.446853 0 +0.446853 -0.374953 0 +0.505181 -0.291667 0 +0.250000 -0.433013 0 +0.321388 -0.383017 0 +0.383017 -0.321388 0 +0.433013 -0.250000 0 +0.649519 -0.375000 0 +0.704758 -0.256512 0 +0.738595 -0.130233 0 +0.750000 0.00000 0 +0.577350 -0.333333 0 +0.626452 -0.228011 0 +0.656529 -0.115763 0 +0.666667 0.00000 0 +0.505181 -0.291667 0 +0.548145 -0.199509 0 +0.574462 -0.101293 0 +0.583333 0.00000 0 +0.433013 -0.250000 0 +0.469839 -0.171008 0 +0.492396 -0.0868222 0 +0.500000 0.00000 0 + +CELLS 24 408 +16 0 3 15 12 1 2 7 11 13 14 4 8 5 6 9 10 +16 16 19 31 28 17 18 23 27 29 30 20 24 21 22 25 26 +16 32 35 47 44 33 34 39 43 45 46 36 40 37 38 41 42 +16 48 51 63 60 49 50 55 59 61 62 52 56 53 54 57 58 +16 64 67 79 76 65 66 71 75 77 78 68 72 69 70 73 74 +16 80 83 95 92 81 82 87 91 93 94 84 88 85 86 89 90 +16 96 99 111 108 97 98 103 107 109 110 100 104 101 102 105 106 +16 112 115 127 124 113 114 119 123 125 126 116 120 117 118 121 122 +16 128 131 143 140 129 130 135 139 141 142 132 136 133 134 137 138 +16 144 147 159 156 145 146 151 155 157 158 148 152 149 150 153 154 +16 160 163 175 172 161 162 167 171 173 174 164 168 165 166 169 170 +16 176 179 191 188 177 178 183 187 189 190 180 184 181 182 185 186 +16 192 195 207 204 193 194 199 203 205 206 196 200 197 198 201 202 +16 208 211 223 220 209 210 215 219 221 222 212 216 213 214 217 218 +16 224 227 239 236 225 226 231 235 237 238 228 232 229 230 233 234 +16 240 243 255 252 241 242 247 251 253 254 244 248 245 246 249 250 +16 256 259 271 268 257 258 263 267 269 270 260 264 261 262 265 266 +16 272 275 287 284 273 274 279 283 285 286 276 280 277 278 281 282 +16 288 291 303 300 289 290 295 299 301 302 292 296 293 294 297 298 +16 304 307 319 316 305 306 311 315 317 318 308 312 309 310 313 314 +16 320 323 335 332 321 322 327 331 333 334 324 328 325 326 329 330 +16 336 339 351 348 337 338 343 347 349 350 340 344 341 342 345 346 +16 352 355 367 364 353 354 359 363 365 366 356 360 357 358 361 362 +16 368 371 383 380 369 370 375 379 381 382 372 376 373 374 377 378 + +CELL_TYPES 24 + 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 +POINT_DATA 384 +SCALARS square_function double 1 +LOOKUP_TABLE default +1.00000 1.00000 1.00000 1.00000 0.840278 0.840278 0.840278 0.840278 0.694444 0.694444 0.694444 0.694444 0.562500 0.562500 0.562500 0.562500 1.00000 1.00000 1.00000 1.00000 0.840278 0.840278 0.840278 0.840278 0.694444 0.694444 0.694444 0.694444 0.562500 0.562500 0.562500 0.562500 0.562500 0.562500 0.562500 0.562500 0.444444 0.444444 0.444444 0.444444 0.340278 0.340278 0.340278 0.340278 0.250000 0.250000 0.250000 0.250000 0.562500 0.562500 0.562500 0.562500 0.444444 0.444444 0.444444 0.444444 0.340278 0.340278 0.340278 0.340278 0.250000 0.250000 0.250000 0.250000 1.00000 1.00000 1.00000 1.00000 0.840278 0.840278 0.840278 0.840278 0.694444 0.694444 0.694444 0.694444 0.562500 0.562500 0.562500 0.562500 1.00000 1.00000 1.00000 1.00000 0.840278 0.840278 0.840278 0.840278 0.694444 0.694444 0.694444 0.694444 0.562500 0.562500 0.562500 0.562500 0.562500 0.562500 0.562500 0.562500 0.444444 0.444444 0.444444 0.444444 0.340278 0.340278 0.340278 0.340278 0.250000 0.250000 0.250000 0.250000 0.562500 0.562500 0.562500 0.562500 0.444444 0.444444 0.444444 0.444444 0.340278 0.340278 0.340278 0.340278 0.250000 0.250000 0.250000 0.250000 1.00000 1.00000 1.00000 1.00000 0.840278 0.840278 0.840278 0.840278 0.694444 0.694444 0.694444 0.694444 0.562500 0.562500 0.562500 0.562500 1.00000 1.00000 1.00000 1.00000 0.840278 0.840278 0.840278 0.840278 0.694444 0.694444 0.694444 0.694444 0.562500 0.562500 0.562500 0.562500 0.562500 0.562500 0.562500 0.562500 0.444444 0.444444 0.444444 0.444444 0.340278 0.340278 0.340278 0.340278 0.250000 0.250000 0.250000 0.250000 0.562500 0.562500 0.562500 0.562500 0.444444 0.444444 0.444444 0.444444 0.340278 0.340278 0.340278 0.340278 0.250000 0.250000 0.250000 0.250000 1.00000 1.00000 1.00000 1.00000 0.840278 0.840278 0.840278 0.840278 0.694444 0.694444 0.694444 0.694444 0.562500 0.562500 0.562500 0.562500 1.00000 1.00000 1.00000 1.00000 0.840278 0.840278 0.840278 0.840278 0.694444 0.694444 0.694444 0.694444 0.562500 0.562500 0.562500 0.562500 0.562500 0.562500 0.562500 0.562500 0.444444 0.444444 0.444444 0.444444 0.340278 0.340278 0.340278 0.340278 0.250000 0.250000 0.250000 0.250000 0.562500 0.562500 0.562500 0.562500 0.444444 0.444444 0.444444 0.444444 0.340278 0.340278 0.340278 0.340278 0.250000 0.250000 0.250000 0.250000 1.00000 1.00000 1.00000 1.00000 0.840278 0.840278 0.840278 0.840278 0.694444 0.694444 0.694444 0.694444 0.562500 0.562500 0.562500 0.562500 1.00000 1.00000 1.00000 1.00000 0.840278 0.840278 0.840278 0.840278 0.694444 0.694444 0.694444 0.694444 0.562500 0.562500 0.562500 0.562500 0.562500 0.562500 0.562500 0.562500 0.444444 0.444444 0.444444 0.444444 0.340278 0.340278 0.340278 0.340278 0.250000 0.250000 0.250000 0.250000 0.562500 0.562500 0.562500 0.562500 0.444444 0.444444 0.444444 0.444444 0.340278 0.340278 0.340278 0.340278 0.250000 0.250000 0.250000 0.250000 1.00000 1.00000 1.00000 1.00000 0.840278 0.840278 0.840278 0.840278 0.694444 0.694444 0.694444 0.694444 0.562500 0.562500 0.562500 0.562500 1.00000 1.00000 1.00000 1.00000 0.840278 0.840278 0.840278 0.840278 0.694444 0.694444 0.694444 0.694444 0.562500 0.562500 0.562500 0.562500 0.562500 0.562500 0.562500 0.562500 0.444444 0.444444 0.444444 0.444444 0.340278 0.340278 0.340278 0.340278 0.250000 0.250000 0.250000 0.250000 0.562500 0.562500 0.562500 0.562500 0.444444 0.444444 0.444444 0.444444 0.340278 0.340278 0.340278 0.340278 0.250000 0.250000 0.250000 0.250000 diff --git a/tests/data_out/data_out_base_vtk_05.cc b/tests/data_out/data_out_base_vtk_05.cc new file mode 100644 index 0000000000..57fa59fd27 --- /dev/null +++ b/tests/data_out/data_out_base_vtk_05.cc @@ -0,0 +1,72 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 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. +// +// --------------------------------------------------------------------- + +// Test high-order Lagrange VTK output on a 3D shell + +#include + +#include + +#include +#include + +#include +#include + +#include +#include + +#include + +#include "../tests.h" + +template +void +check(std::ostream &log, unsigned cell_order) +{ + Triangulation triangulation; + GridGenerator::hyper_shell(triangulation, Point(1, 0, 0), 0.5, 1, 6); + + FE_Q fe(cell_order); + DoFHandler dof_handler(triangulation); + dof_handler.distribute_dofs(fe); + + Vector vec(dof_handler.n_dofs()); + MappingQGeneric mapping(cell_order); + + VectorTools::interpolate(mapping, + dof_handler, + Functions::SquareFunction(), + vec); + + DataOutBase::VtkFlags flags; + flags.write_higher_order_cells = true; + + DataOut data_out; + data_out.set_flags(flags); + data_out.attach_dof_handler(dof_handler); + data_out.add_data_vector(vec, "square_function"); + data_out.build_patches(mapping, cell_order, DataOut::curved_inner_cells); + data_out.write_vtk(log); +} + +int +main() +{ + initlog(); + + unsigned cell_order = 3; + check<3>(deallog.get_file_stream(), cell_order); +} diff --git a/tests/data_out/data_out_base_vtk_05.output b/tests/data_out/data_out_base_vtk_05.output new file mode 100644 index 0000000000..cb2d254f35 --- /dev/null +++ b/tests/data_out/data_out_base_vtk_05.output @@ -0,0 +1,406 @@ + +# vtk DataFile Version 3.0 +#This file was generated +ASCII +DATASET UNSTRUCTURED_GRID + +POINTS 384 double +0.422650 -0.577350 -0.577350 +0.796295 -0.691949 -0.691949 +1.20370 -0.691949 -0.691949 +1.57735 -0.577350 -0.577350 +0.308051 -0.203705 -0.691949 +0.742851 -0.257149 -0.926819 +1.25715 -0.257149 -0.926819 +1.69195 -0.203705 -0.691949 +0.308051 0.203705 -0.691949 +0.742851 0.257149 -0.926819 +1.25715 0.257149 -0.926819 +1.69195 0.203705 -0.691949 +0.422650 0.577350 -0.577350 +0.796295 0.691949 -0.691949 +1.20370 0.691949 -0.691949 +1.57735 0.577350 -0.577350 +0.518875 -0.481125 -0.481125 +0.830246 -0.576624 -0.576624 +1.16975 -0.576624 -0.576624 +1.48113 -0.481125 -0.481125 +0.423376 -0.169754 -0.576624 +0.785709 -0.214291 -0.772350 +1.21429 -0.214291 -0.772350 +1.57662 -0.169754 -0.576624 +0.423376 0.169754 -0.576624 +0.785709 0.214291 -0.772350 +1.21429 0.214291 -0.772350 +1.57662 0.169754 -0.576624 +0.518875 0.481125 -0.481125 +0.830246 0.576624 -0.576624 +1.16975 0.576624 -0.576624 +1.48113 0.481125 -0.481125 +0.615100 -0.384900 -0.384900 +0.864197 -0.461299 -0.461299 +1.13580 -0.461299 -0.461299 +1.38490 -0.384900 -0.384900 +0.538701 -0.135803 -0.461299 +0.828567 -0.171433 -0.617880 +1.17143 -0.171433 -0.617880 +1.46130 -0.135803 -0.461299 +0.538701 0.135803 -0.461299 +0.828567 0.171433 -0.617880 +1.17143 0.171433 -0.617880 +1.46130 0.135803 -0.461299 +0.615100 0.384900 -0.384900 +0.864197 0.461299 -0.461299 +1.13580 0.461299 -0.461299 +1.38490 0.384900 -0.384900 +0.711325 -0.288675 -0.288675 +0.898148 -0.345975 -0.345975 +1.10185 -0.345975 -0.345975 +1.28868 -0.288675 -0.288675 +0.654025 -0.101852 -0.345975 +0.871426 -0.128574 -0.463410 +1.12857 -0.128574 -0.463410 +1.34597 -0.101852 -0.345975 +0.654025 0.101852 -0.345975 +0.871426 0.128574 -0.463410 +1.12857 0.128574 -0.463410 +1.34597 0.101852 -0.345975 +0.711325 0.288675 -0.288675 +0.898148 0.345975 -0.345975 +1.10185 0.345975 -0.345975 +1.28868 0.288675 -0.288675 +1.57735 -0.577350 -0.577350 +1.69195 -0.203705 -0.691949 +1.69195 0.203705 -0.691949 +1.57735 0.577350 -0.577350 +1.48113 -0.481125 -0.481125 +1.57662 -0.169754 -0.576624 +1.57662 0.169754 -0.576624 +1.48113 0.481125 -0.481125 +1.38490 -0.384900 -0.384900 +1.46130 -0.135803 -0.461299 +1.46130 0.135803 -0.461299 +1.38490 0.384900 -0.384900 +1.28868 -0.288675 -0.288675 +1.34597 -0.101852 -0.345975 +1.34597 0.101852 -0.345975 +1.28868 0.288675 -0.288675 +1.69195 -0.691949 -0.203705 +1.92682 -0.257149 -0.257149 +1.92682 0.257149 -0.257149 +1.69195 0.691949 -0.203705 +1.57662 -0.576624 -0.169754 +1.77235 -0.214291 -0.214291 +1.77235 0.214291 -0.214291 +1.57662 0.576624 -0.169754 +1.46130 -0.461299 -0.135803 +1.61788 -0.171433 -0.171433 +1.61788 0.171433 -0.171433 +1.46130 0.461299 -0.135803 +1.34597 -0.345975 -0.101852 +1.46341 -0.128574 -0.128574 +1.46341 0.128574 -0.128574 +1.34597 0.345975 -0.101852 +1.69195 -0.691949 0.203705 +1.92682 -0.257149 0.257149 +1.92682 0.257149 0.257149 +1.69195 0.691949 0.203705 +1.57662 -0.576624 0.169754 +1.77235 -0.214291 0.214291 +1.77235 0.214291 0.214291 +1.57662 0.576624 0.169754 +1.46130 -0.461299 0.135803 +1.61788 -0.171433 0.171433 +1.61788 0.171433 0.171433 +1.46130 0.461299 0.135803 +1.34597 -0.345975 0.101852 +1.46341 -0.128574 0.128574 +1.46341 0.128574 0.128574 +1.34597 0.345975 0.101852 +1.57735 -0.577350 0.577350 +1.69195 -0.203705 0.691949 +1.69195 0.203705 0.691949 +1.57735 0.577350 0.577350 +1.48113 -0.481125 0.481125 +1.57662 -0.169754 0.576624 +1.57662 0.169754 0.576624 +1.48113 0.481125 0.481125 +1.38490 -0.384900 0.384900 +1.46130 -0.135803 0.461299 +1.46130 0.135803 0.461299 +1.38490 0.384900 0.384900 +1.28868 -0.288675 0.288675 +1.34597 -0.101852 0.345975 +1.34597 0.101852 0.345975 +1.28868 0.288675 0.288675 +0.422650 -0.577350 0.577350 +0.796295 -0.691949 0.691949 +1.20370 -0.691949 0.691949 +1.57735 -0.577350 0.577350 +0.518875 -0.481125 0.481125 +0.830246 -0.576624 0.576624 +1.16975 -0.576624 0.576624 +1.48113 -0.481125 0.481125 +0.615100 -0.384900 0.384900 +0.864197 -0.461299 0.461299 +1.13580 -0.461299 0.461299 +1.38490 -0.384900 0.384900 +0.711325 -0.288675 0.288675 +0.898148 -0.345975 0.345975 +1.10185 -0.345975 0.345975 +1.28868 -0.288675 0.288675 +0.308051 -0.203705 0.691949 +0.742851 -0.257149 0.926819 +1.25715 -0.257149 0.926819 +1.69195 -0.203705 0.691949 +0.423376 -0.169754 0.576624 +0.785709 -0.214291 0.772350 +1.21429 -0.214291 0.772350 +1.57662 -0.169754 0.576624 +0.538701 -0.135803 0.461299 +0.828567 -0.171433 0.617880 +1.17143 -0.171433 0.617880 +1.46130 -0.135803 0.461299 +0.654025 -0.101852 0.345975 +0.871426 -0.128574 0.463410 +1.12857 -0.128574 0.463410 +1.34597 -0.101852 0.345975 +0.308051 0.203705 0.691949 +0.742851 0.257149 0.926819 +1.25715 0.257149 0.926819 +1.69195 0.203705 0.691949 +0.423376 0.169754 0.576624 +0.785709 0.214291 0.772350 +1.21429 0.214291 0.772350 +1.57662 0.169754 0.576624 +0.538701 0.135803 0.461299 +0.828567 0.171433 0.617880 +1.17143 0.171433 0.617880 +1.46130 0.135803 0.461299 +0.654025 0.101852 0.345975 +0.871426 0.128574 0.463410 +1.12857 0.128574 0.463410 +1.34597 0.101852 0.345975 +0.422650 0.577350 0.577350 +0.796295 0.691949 0.691949 +1.20370 0.691949 0.691949 +1.57735 0.577350 0.577350 +0.518875 0.481125 0.481125 +0.830246 0.576624 0.576624 +1.16975 0.576624 0.576624 +1.48113 0.481125 0.481125 +0.615100 0.384900 0.384900 +0.864197 0.461299 0.461299 +1.13580 0.461299 0.461299 +1.38490 0.384900 0.384900 +0.711325 0.288675 0.288675 +0.898148 0.345975 0.345975 +1.10185 0.345975 0.345975 +1.28868 0.288675 0.288675 +0.422650 -0.577350 -0.577350 +0.518875 -0.481125 -0.481125 +0.615100 -0.384900 -0.384900 +0.711325 -0.288675 -0.288675 +0.308051 -0.203705 -0.691949 +0.423376 -0.169754 -0.576624 +0.538701 -0.135803 -0.461299 +0.654025 -0.101852 -0.345975 +0.308051 0.203705 -0.691949 +0.423376 0.169754 -0.576624 +0.538701 0.135803 -0.461299 +0.654025 0.101852 -0.345975 +0.422650 0.577350 -0.577350 +0.518875 0.481125 -0.481125 +0.615100 0.384900 -0.384900 +0.711325 0.288675 -0.288675 +0.308051 -0.691949 -0.203705 +0.423376 -0.576624 -0.169754 +0.538701 -0.461299 -0.135803 +0.654025 -0.345975 -0.101852 +0.0731806 -0.257149 -0.257149 +0.227650 -0.214291 -0.214291 +0.382120 -0.171433 -0.171433 +0.536590 -0.128574 -0.128574 +0.0731806 0.257149 -0.257149 +0.227650 0.214291 -0.214291 +0.382120 0.171433 -0.171433 +0.536590 0.128574 -0.128574 +0.308051 0.691949 -0.203705 +0.423376 0.576624 -0.169754 +0.538701 0.461299 -0.135803 +0.654025 0.345975 -0.101852 +0.308051 -0.691949 0.203705 +0.423376 -0.576624 0.169754 +0.538701 -0.461299 0.135803 +0.654025 -0.345975 0.101852 +0.0731806 -0.257149 0.257149 +0.227650 -0.214291 0.214291 +0.382120 -0.171433 0.171433 +0.536590 -0.128574 0.128574 +0.0731806 0.257149 0.257149 +0.227650 0.214291 0.214291 +0.382120 0.171433 0.171433 +0.536590 0.128574 0.128574 +0.308051 0.691949 0.203705 +0.423376 0.576624 0.169754 +0.538701 0.461299 0.135803 +0.654025 0.345975 0.101852 +0.422650 -0.577350 0.577350 +0.518875 -0.481125 0.481125 +0.615100 -0.384900 0.384900 +0.711325 -0.288675 0.288675 +0.308051 -0.203705 0.691949 +0.423376 -0.169754 0.576624 +0.538701 -0.135803 0.461299 +0.654025 -0.101852 0.345975 +0.308051 0.203705 0.691949 +0.423376 0.169754 0.576624 +0.538701 0.135803 0.461299 +0.654025 0.101852 0.345975 +0.422650 0.577350 0.577350 +0.518875 0.481125 0.481125 +0.615100 0.384900 0.384900 +0.711325 0.288675 0.288675 +0.422650 -0.577350 -0.577350 +0.796295 -0.691949 -0.691949 +1.20370 -0.691949 -0.691949 +1.57735 -0.577350 -0.577350 +0.518875 -0.481125 -0.481125 +0.830246 -0.576624 -0.576624 +1.16975 -0.576624 -0.576624 +1.48113 -0.481125 -0.481125 +0.615100 -0.384900 -0.384900 +0.864197 -0.461299 -0.461299 +1.13580 -0.461299 -0.461299 +1.38490 -0.384900 -0.384900 +0.711325 -0.288675 -0.288675 +0.898148 -0.345975 -0.345975 +1.10185 -0.345975 -0.345975 +1.28868 -0.288675 -0.288675 +0.308051 -0.691949 -0.203705 +0.742851 -0.926819 -0.257149 +1.25715 -0.926819 -0.257149 +1.69195 -0.691949 -0.203705 +0.423376 -0.576624 -0.169754 +0.785709 -0.772350 -0.214291 +1.21429 -0.772350 -0.214291 +1.57662 -0.576624 -0.169754 +0.538701 -0.461299 -0.135803 +0.828567 -0.617880 -0.171433 +1.17143 -0.617880 -0.171433 +1.46130 -0.461299 -0.135803 +0.654025 -0.345975 -0.101852 +0.871426 -0.463410 -0.128574 +1.12857 -0.463410 -0.128574 +1.34597 -0.345975 -0.101852 +0.308051 -0.691949 0.203705 +0.742851 -0.926819 0.257149 +1.25715 -0.926819 0.257149 +1.69195 -0.691949 0.203705 +0.423376 -0.576624 0.169754 +0.785709 -0.772350 0.214291 +1.21429 -0.772350 0.214291 +1.57662 -0.576624 0.169754 +0.538701 -0.461299 0.135803 +0.828567 -0.617880 0.171433 +1.17143 -0.617880 0.171433 +1.46130 -0.461299 0.135803 +0.654025 -0.345975 0.101852 +0.871426 -0.463410 0.128574 +1.12857 -0.463410 0.128574 +1.34597 -0.345975 0.101852 +0.422650 -0.577350 0.577350 +0.796295 -0.691949 0.691949 +1.20370 -0.691949 0.691949 +1.57735 -0.577350 0.577350 +0.518875 -0.481125 0.481125 +0.830246 -0.576624 0.576624 +1.16975 -0.576624 0.576624 +1.48113 -0.481125 0.481125 +0.615100 -0.384900 0.384900 +0.864197 -0.461299 0.461299 +1.13580 -0.461299 0.461299 +1.38490 -0.384900 0.384900 +0.711325 -0.288675 0.288675 +0.898148 -0.345975 0.345975 +1.10185 -0.345975 0.345975 +1.28868 -0.288675 0.288675 +0.422650 0.577350 -0.577350 +0.518875 0.481125 -0.481125 +0.615100 0.384900 -0.384900 +0.711325 0.288675 -0.288675 +0.796295 0.691949 -0.691949 +0.830246 0.576624 -0.576624 +0.864197 0.461299 -0.461299 +0.898148 0.345975 -0.345975 +1.20370 0.691949 -0.691949 +1.16975 0.576624 -0.576624 +1.13580 0.461299 -0.461299 +1.10185 0.345975 -0.345975 +1.57735 0.577350 -0.577350 +1.48113 0.481125 -0.481125 +1.38490 0.384900 -0.384900 +1.28868 0.288675 -0.288675 +0.308051 0.691949 -0.203705 +0.423376 0.576624 -0.169754 +0.538701 0.461299 -0.135803 +0.654025 0.345975 -0.101852 +0.742851 0.926819 -0.257149 +0.785709 0.772350 -0.214291 +0.828567 0.617880 -0.171433 +0.871426 0.463410 -0.128574 +1.25715 0.926819 -0.257149 +1.21429 0.772350 -0.214291 +1.17143 0.617880 -0.171433 +1.12857 0.463410 -0.128574 +1.69195 0.691949 -0.203705 +1.57662 0.576624 -0.169754 +1.46130 0.461299 -0.135803 +1.34597 0.345975 -0.101852 +0.308051 0.691949 0.203705 +0.423376 0.576624 0.169754 +0.538701 0.461299 0.135803 +0.654025 0.345975 0.101852 +0.742851 0.926819 0.257149 +0.785709 0.772350 0.214291 +0.828567 0.617880 0.171433 +0.871426 0.463410 0.128574 +1.25715 0.926819 0.257149 +1.21429 0.772350 0.214291 +1.17143 0.617880 0.171433 +1.12857 0.463410 0.128574 +1.69195 0.691949 0.203705 +1.57662 0.576624 0.169754 +1.46130 0.461299 0.135803 +1.34597 0.345975 0.101852 +0.422650 0.577350 0.577350 +0.518875 0.481125 0.481125 +0.615100 0.384900 0.384900 +0.711325 0.288675 0.288675 +0.796295 0.691949 0.691949 +0.830246 0.576624 0.576624 +0.864197 0.461299 0.461299 +0.898148 0.345975 0.345975 +1.20370 0.691949 0.691949 +1.16975 0.576624 0.576624 +1.13580 0.461299 0.461299 +1.10185 0.345975 0.345975 +1.57735 0.577350 0.577350 +1.48113 0.481125 0.481125 +1.38490 0.384900 0.384900 +1.28868 0.288675 0.288675 + +CELLS 6 390 +64 0 3 15 12 48 51 63 60 1 2 7 11 13 14 4 8 49 50 55 59 61 62 52 56 16 32 19 35 28 44 31 47 20 24 36 40 23 27 39 43 17 18 33 34 29 30 45 46 5 6 9 10 53 54 57 58 21 22 25 26 37 38 41 42 +64 64 67 79 76 112 115 127 124 65 66 71 75 77 78 68 72 113 114 119 123 125 126 116 120 80 96 83 99 92 108 95 111 84 88 100 104 87 91 103 107 81 82 97 98 93 94 109 110 69 70 73 74 117 118 121 122 85 86 89 90 101 102 105 106 +64 128 131 143 140 176 179 191 188 129 130 135 139 141 142 132 136 177 178 183 187 189 190 180 184 144 160 147 163 156 172 159 175 148 152 164 168 151 155 167 171 145 146 161 162 157 158 173 174 133 134 137 138 181 182 185 186 149 150 153 154 165 166 169 170 +64 192 195 207 204 240 243 255 252 193 194 199 203 205 206 196 200 241 242 247 251 253 254 244 248 208 224 211 227 220 236 223 239 212 216 228 232 215 219 231 235 209 210 225 226 221 222 237 238 197 198 201 202 245 246 249 250 213 214 217 218 229 230 233 234 +64 256 259 271 268 304 307 319 316 257 258 263 267 269 270 260 264 305 306 311 315 317 318 308 312 272 288 275 291 284 300 287 303 276 280 292 296 279 283 295 299 273 274 289 290 285 286 301 302 261 262 265 266 309 310 313 314 277 278 281 282 293 294 297 298 +64 320 323 335 332 368 371 383 380 321 322 327 331 333 334 324 328 369 370 375 379 381 382 372 376 336 352 339 355 348 364 351 367 340 344 356 360 343 347 359 363 337 338 353 354 349 350 365 366 325 326 329 330 373 374 377 378 341 342 345 346 357 358 361 362 + +CELL_TYPES 6 + 72 72 72 72 72 72 +POINT_DATA 384 +SCALARS square_function double 1 +LOOKUP_TABLE default +0.845299 1.59259 2.40741 3.15470 0.616102 1.48570 2.51430 3.38390 0.616102 1.48570 2.51430 3.38390 0.845299 1.59259 2.40741 3.15470 0.732194 1.35494 2.03395 2.65669 0.541196 1.26586 2.12303 2.84769 0.541196 1.26586 2.12303 2.84769 0.732194 1.35494 2.03395 2.65669 0.674644 1.17284 1.71605 2.21424 0.521846 1.10158 1.78731 2.36704 0.521846 1.10158 1.78731 2.36704 0.674644 1.17284 1.71605 2.21424 0.672650 1.04630 1.45370 1.82735 0.558051 0.992851 1.50715 1.94195 0.558051 0.992851 1.50715 1.94195 0.672650 1.04630 1.45370 1.82735 3.15470 3.38390 3.38390 3.15470 2.65669 2.84769 2.84769 2.65669 2.21424 2.36704 2.36704 2.21424 1.82735 1.94195 1.94195 1.82735 3.38390 3.85364 3.85364 3.38390 2.84769 3.23914 3.23914 2.84769 2.36704 2.68020 2.68020 2.36704 1.94195 2.17682 2.17682 1.94195 3.38390 3.85364 3.85364 3.38390 2.84769 3.23914 3.23914 2.84769 2.36704 2.68020 2.68020 2.36704 1.94195 2.17682 2.17682 1.94195 3.15470 3.38390 3.38390 3.15470 2.65669 2.84769 2.84769 2.65669 2.21424 2.36704 2.36704 2.21424 1.82735 1.94195 1.94195 1.82735 0.845299 1.59259 2.40741 3.15470 0.732194 1.35494 2.03395 2.65669 0.674644 1.17284 1.71605 2.21424 0.672650 1.04630 1.45370 1.82735 0.616102 1.48570 2.51430 3.38390 0.541196 1.26586 2.12303 2.84769 0.521846 1.10158 1.78731 2.36704 0.558051 0.992851 1.50715 1.94195 0.616102 1.48570 2.51430 3.38390 0.541196 1.26586 2.12303 2.84769 0.521846 1.10158 1.78731 2.36704 0.558051 0.992851 1.50715 1.94195 0.845299 1.59259 2.40741 3.15470 0.732194 1.35494 2.03395 2.65669 0.674644 1.17284 1.71605 2.21424 0.672650 1.04630 1.45370 1.82735 0.845299 0.732194 0.674644 0.672650 0.616102 0.541196 0.521846 0.558051 0.616102 0.541196 0.521846 0.558051 0.845299 0.732194 0.674644 0.672650 0.616102 0.541196 0.521846 0.558051 0.146361 0.149745 0.208685 0.323181 0.146361 0.149745 0.208685 0.323181 0.616102 0.541196 0.521846 0.558051 0.616102 0.541196 0.521846 0.558051 0.146361 0.149745 0.208685 0.323181 0.146361 0.149745 0.208685 0.323181 0.616102 0.541196 0.521846 0.558051 0.845299 0.732194 0.674644 0.672650 0.616102 0.541196 0.521846 0.558051 0.616102 0.541196 0.521846 0.558051 0.845299 0.732194 0.674644 0.672650 0.845299 1.59259 2.40741 3.15470 0.732194 1.35494 2.03395 2.65669 0.674644 1.17284 1.71605 2.21424 0.672650 1.04630 1.45370 1.82735 0.616102 1.48570 2.51430 3.38390 0.541196 1.26586 2.12303 2.84769 0.521846 1.10158 1.78731 2.36704 0.558051 0.992851 1.50715 1.94195 0.616102 1.48570 2.51430 3.38390 0.541196 1.26586 2.12303 2.84769 0.521846 1.10158 1.78731 2.36704 0.558051 0.992851 1.50715 1.94195 0.845299 1.59259 2.40741 3.15470 0.732194 1.35494 2.03395 2.65669 0.674644 1.17284 1.71605 2.21424 0.672650 1.04630 1.45370 1.82735 0.845299 0.732194 0.674644 0.672650 1.59259 1.35494 1.17284 1.04630 2.40741 2.03395 1.71605 1.45370 3.15470 2.65669 2.21424 1.82735 0.616102 0.541196 0.521846 0.558051 1.48570 1.26586 1.10158 0.992851 2.51430 2.12303 1.78731 1.50715 3.38390 2.84769 2.36704 1.94195 0.616102 0.541196 0.521846 0.558051 1.48570 1.26586 1.10158 0.992851 2.51430 2.12303 1.78731 1.50715 3.38390 2.84769 2.36704 1.94195 0.845299 0.732194 0.674644 0.672650 1.59259 1.35494 1.17284 1.04630 2.40741 2.03395 1.71605 1.45370 3.15470 2.65669 2.21424 1.82735 -- 2.39.5