From: Wolfgang Bangerth Date: Fri, 18 Nov 2022 23:03:09 +0000 (-0700) Subject: Simplify yet more code. X-Git-Tag: v9.5.0-rc1~836^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de9639cd8b4c776b1deb9fe6158320c28d6de6a1;p=dealii.git Simplify yet more code. --- diff --git a/source/base/data_out_base.cc b/source/base/data_out_base.cc index 3eea04099d..30889fd792 100644 --- a/source/base/data_out_base.cc +++ b/source/base/data_out_base.cc @@ -589,22 +589,37 @@ namespace DataOutBase const unsigned int base_entry = index * GeometryInfo::vertices_per_cell; - internal_add_cell(base_entry + 0, start); - if (dim >= 1) + switch (dim) { - internal_add_cell(base_entry + 1, start + d1); - if (dim >= 2) - { - internal_add_cell(base_entry + 2, start + d2 + d1); - internal_add_cell(base_entry + 3, start + d2); - if (dim >= 3) - { - internal_add_cell(base_entry + 4, start + d3); - internal_add_cell(base_entry + 5, start + d3 + d1); - internal_add_cell(base_entry + 6, start + d3 + d2 + d1); - internal_add_cell(base_entry + 7, start + d3 + d2); - } - } + case 0: + internal_add_cell(base_entry + 0, start); + break; + + case 1: + internal_add_cell(base_entry + 0, start); + internal_add_cell(base_entry + 1, start + d1); + break; + + case 2: + internal_add_cell(base_entry + 0, start); + internal_add_cell(base_entry + 1, start + d1); + internal_add_cell(base_entry + 2, start + d2 + d1); + internal_add_cell(base_entry + 3, start + d2); + break; + + case 3: + internal_add_cell(base_entry + 0, start); + internal_add_cell(base_entry + 1, start + d1); + internal_add_cell(base_entry + 2, start + d2 + d1); + internal_add_cell(base_entry + 3, start + d2); + internal_add_cell(base_entry + 4, start + d3); + internal_add_cell(base_entry + 5, start + d3 + d1); + internal_add_cell(base_entry + 6, start + d3 + d2 + d1); + internal_add_cell(base_entry + 7, start + d3 + d2); + break; + + default: + Assert(false, ExcNotImplemented()); } } @@ -3077,6 +3092,8 @@ namespace DataOutBase out.flush_cells(); } + + template void write_high_order_cells(const std::vector> &patches,