+++ /dev/null
-//---------------------------- mesh_smoothing_01.cc ---------------------------
-// $Id$
-// Version: $Name$
-//
-// Copyright (C) 2006, 2007, 2008 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------- mesh_smoothing_01.cc ---------------------------
-
-
-// something went wrong with smoothing a mesh when a particular set of
-// cells were set to be refined. found in step-31
-//
-// a redux is in mesh_smoothing_02
-
-
-char logname[] = "mesh_smoothing_01/output";
-
-
-#include "../tests.h"
-
-
-#include <base/logstream.h>
-#include <grid/tria.h>
-#include <grid/grid_generator.h>
-#include <grid/tria_accessor.h>
-#include <grid/tria_iterator.h>
-
-#include <fstream>
-#include <iostream>
-#include <cstring>
-
-
- // Finally, this is as in previous
- // programs:
-using namespace dealii;
-
-
-
-template <int dim>
-bool cell_is_patch_level_1 (const typename Triangulation<dim>::cell_iterator &cell)
-{
- Assert (cell->active() == false, ExcInternalError());
-
- unsigned int n_active_children = 0;
- for (unsigned int i=0; i<cell->n_children(); ++i)
- if (cell->child(i)->active())
- ++n_active_children;
-
- return (n_active_children == 0) || (n_active_children == cell->n_children());
-}
-
-
-void test ()
-{
- Triangulation<2> triangulation (Triangulation<2>::maximum_smoothing);
- GridGenerator::hyper_cube (triangulation);
- triangulation.refine_global (3);
-
- const char *refinement_flags[]
- =
- {
- "1010222211110211222222220211211111111111111111111111111111111111",
- "1212111111111111111111111111111111111111222222222222222211111111111111111101102201110210012211112001111111111111111111111111111111111111",
- "1111111111111111111111111111111111111111111111111121111111111111111111111111111111111111111111111111111211111111111111111111111111021121222222221112112022222222021222011111111102102021111111111111110210102222111102121111111111211111222201012021111111111111",
- "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110112211111111112111110222222222222022202211212222210111111111111111121111111111221101111202221210222222222022222222220011222211111111222111111111111111112212111111112222000111111111111111111111112210022222021222221011220211111111111111111122111122220120222220212220011111111111",
- "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111121111111111111111111111111111111111211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100110011111111111111111111100010100000000000000001101010100000101000001101111100001000000011010000000011111111111111111010000000000001111111111111111111111111111111111111111110001100111111111111111111100000000000001111111111111111000001010010000000000000010100100100111100000101111111100100000000000101000001010000000011111111000101111111111110110010111111110000000011111111111111111111110011111111111110000000000000000001111100001111101000001111000010000010000011111111111111111100111100000000001000001111111101001111111100000100000000001111010111110000000111111111"
- };
- const unsigned int n_refinement_steps = sizeof(refinement_flags) /
- sizeof(refinement_flags[0]);
-
- for (unsigned int i=0; i<n_refinement_steps; ++i)
- {
- Assert (triangulation.n_active_cells() ==
- std::strlen(refinement_flags[i]),
- ExcInternalError());
-
- // set refinement flags from
- // the string above
- unsigned int index = 0;
- for (Triangulation<2>::active_cell_iterator
- cell = triangulation.begin_active();
- cell != triangulation.end(); ++cell, ++index)
- if (refinement_flags[i][index] == '2')
- cell->set_refine_flag();
- else if (refinement_flags[i][index] == '1')
- cell->set_coarsen_flag();
-
- triangulation.prepare_coarsening_and_refinement ();
-
- // at this point, of course the
- // mesh needs to be
- // patch_level_1, but the flags
- // also need to be set in such
- // a way that it preserves
- // patch_level_1. check
- // this. the reason that the
- // test failed is because flags
- // were incorrectly set,
- // resulting in a mesh that
- // wasn't patch_level_1, and we
- // got an assertion in the next
- // call to prepare_c_and_r
- // after setting flags next
- // time around
- for (Triangulation<2>::cell_iterator
- cell = triangulation.begin();
- cell != triangulation.end(); ++cell)
- if (!cell->active())
- {
- unsigned int n_active_children = 0;
- for (unsigned int i=0; i<cell->n_children(); ++i)
- if (cell->child(i)->active())
- ++n_active_children;
-
- Assert ((n_active_children == 0) || (n_active_children == cell->n_children()),
- ExcInternalError());
-
- // if there are no active
- // children, then nothing
- // to do here
- if (n_active_children == 0)
- continue;
-
- // otherwise: all
- // children are
- // active. patch_level_1
- // then means that either
- // all of them need to be
- // flagged for
- // refinement, or
- // none. check that this
- // is so by making sure
- // that they all have the
- // same flags as child(0)
- for (unsigned int i=1; i<cell->n_children(); ++i)
- Assert(cell->child(i)->refine_flag_set()
- ==
- cell->child(0)->refine_flag_set(),
- ExcInternalError());
- }
-
- for (Triangulation<2>::active_cell_iterator
- cell = triangulation.begin_active();
- cell != triangulation.end(); ++cell)
- if (cell->coarsen_flag_set ())
- deallog << "Coarsen flag set: " << cell
- << std::endl;
-
-
- triangulation.execute_coarsening_and_refinement ();
-
- // and at this point, the
- // mesh still needs to be
- // patch_level_1, but no flags
- // should remain set
- for (Triangulation<2>::cell_iterator
- cell = triangulation.begin();
- cell != triangulation.end(); ++cell)
- {
- Assert ((cell->refine_flag_set() == false)
- &&
- (cell->coarsen_flag_set() == false),
- ExcInternalError());
- if (!cell->active())
- Assert (cell_is_patch_level_1<2>(cell),
- ExcInternalError());
- }
-
-
- deallog << triangulation.n_active_cells()
- << " (on "
- << triangulation.n_levels()
- << " levels)"
- << std::endl;
- }
-
- deallog << "OK" << std::endl;
-}
-
-
-
-int main ()
-{
- std::ofstream logfile(logname);
- logfile.precision (3);
-
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
- try
- {
- test();
- }
- catch (std::exception &exc)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Exception on processing: " << std::endl
- << exc.what() << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
-
- return 1;
- }
- catch (...)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Unknown exception!" << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
- return 1;
- }
-
- return 0;
-}
+++ /dev/null
-
-DEAL::136 (on 5 levels)
-DEAL::256 (on 6 levels)
-DEAL::520 (on 7 levels)
-DEAL::1120 (on 8 levels)
-DEAL::Coarsen flag set: 5.208
-DEAL::Coarsen flag set: 5.209
-DEAL::Coarsen flag set: 5.210
-DEAL::Coarsen flag set: 5.211
-DEAL::Coarsen flag set: 5.212
-DEAL::Coarsen flag set: 5.213
-DEAL::Coarsen flag set: 5.214
-DEAL::Coarsen flag set: 5.215
-DEAL::Coarsen flag set: 5.216
-DEAL::Coarsen flag set: 5.217
-DEAL::Coarsen flag set: 5.218
-DEAL::Coarsen flag set: 5.219
-DEAL::Coarsen flag set: 5.220
-DEAL::Coarsen flag set: 5.221
-DEAL::Coarsen flag set: 5.222
-DEAL::Coarsen flag set: 5.223
-DEAL::Coarsen flag set: 6.288
-DEAL::Coarsen flag set: 6.289
-DEAL::Coarsen flag set: 6.290
-DEAL::Coarsen flag set: 6.291
-DEAL::Coarsen flag set: 6.292
-DEAL::Coarsen flag set: 6.293
-DEAL::Coarsen flag set: 6.294
-DEAL::Coarsen flag set: 6.295
-DEAL::Coarsen flag set: 6.296
-DEAL::Coarsen flag set: 6.297
-DEAL::Coarsen flag set: 6.298
-DEAL::Coarsen flag set: 6.299
-DEAL::Coarsen flag set: 6.300
-DEAL::Coarsen flag set: 6.301
-DEAL::Coarsen flag set: 6.302
-DEAL::Coarsen flag set: 6.303
-DEAL::Coarsen flag set: 6.320
-DEAL::Coarsen flag set: 6.321
-DEAL::Coarsen flag set: 6.322
-DEAL::Coarsen flag set: 6.323
-DEAL::Coarsen flag set: 6.324
-DEAL::Coarsen flag set: 6.325
-DEAL::Coarsen flag set: 6.326
-DEAL::Coarsen flag set: 6.327
-DEAL::Coarsen flag set: 6.328
-DEAL::Coarsen flag set: 6.329
-DEAL::Coarsen flag set: 6.330
-DEAL::Coarsen flag set: 6.331
-DEAL::Coarsen flag set: 6.332
-DEAL::Coarsen flag set: 6.333
-DEAL::Coarsen flag set: 6.334
-DEAL::Coarsen flag set: 6.335
-DEAL::Coarsen flag set: 6.336
-DEAL::Coarsen flag set: 6.337
-DEAL::Coarsen flag set: 6.338
-DEAL::Coarsen flag set: 6.339
-DEAL::Coarsen flag set: 6.340
-DEAL::Coarsen flag set: 6.341
-DEAL::Coarsen flag set: 6.342
-DEAL::Coarsen flag set: 6.343
-DEAL::Coarsen flag set: 6.344
-DEAL::Coarsen flag set: 6.345
-DEAL::Coarsen flag set: 6.346
-DEAL::Coarsen flag set: 6.347
-DEAL::Coarsen flag set: 6.348
-DEAL::Coarsen flag set: 6.349
-DEAL::Coarsen flag set: 6.350
-DEAL::Coarsen flag set: 6.351
-DEAL::Coarsen flag set: 6.368
-DEAL::Coarsen flag set: 6.369
-DEAL::Coarsen flag set: 6.370
-DEAL::Coarsen flag set: 6.371
-DEAL::Coarsen flag set: 6.372
-DEAL::Coarsen flag set: 6.373
-DEAL::Coarsen flag set: 6.374
-DEAL::Coarsen flag set: 6.375
-DEAL::Coarsen flag set: 6.376
-DEAL::Coarsen flag set: 6.377
-DEAL::Coarsen flag set: 6.378
-DEAL::Coarsen flag set: 6.379
-DEAL::Coarsen flag set: 6.380
-DEAL::Coarsen flag set: 6.381
-DEAL::Coarsen flag set: 6.382
-DEAL::Coarsen flag set: 6.383
-DEAL::Coarsen flag set: 6.384
-DEAL::Coarsen flag set: 6.385
-DEAL::Coarsen flag set: 6.386
-DEAL::Coarsen flag set: 6.387
-DEAL::Coarsen flag set: 6.388
-DEAL::Coarsen flag set: 6.389
-DEAL::Coarsen flag set: 6.390
-DEAL::Coarsen flag set: 6.391
-DEAL::Coarsen flag set: 6.392
-DEAL::Coarsen flag set: 6.393
-DEAL::Coarsen flag set: 6.394
-DEAL::Coarsen flag set: 6.395
-DEAL::Coarsen flag set: 6.396
-DEAL::Coarsen flag set: 6.397
-DEAL::Coarsen flag set: 6.398
-DEAL::Coarsen flag set: 6.399
-DEAL::Coarsen flag set: 6.432
-DEAL::Coarsen flag set: 6.433
-DEAL::Coarsen flag set: 6.434
-DEAL::Coarsen flag set: 6.435
-DEAL::Coarsen flag set: 6.436
-DEAL::Coarsen flag set: 6.437
-DEAL::Coarsen flag set: 6.438
-DEAL::Coarsen flag set: 6.439
-DEAL::Coarsen flag set: 6.440
-DEAL::Coarsen flag set: 6.441
-DEAL::Coarsen flag set: 6.442
-DEAL::Coarsen flag set: 6.443
-DEAL::Coarsen flag set: 6.444
-DEAL::Coarsen flag set: 6.445
-DEAL::Coarsen flag set: 6.446
-DEAL::Coarsen flag set: 6.447
-DEAL::Coarsen flag set: 7.16
-DEAL::Coarsen flag set: 7.17
-DEAL::Coarsen flag set: 7.18
-DEAL::Coarsen flag set: 7.19
-DEAL::Coarsen flag set: 7.20
-DEAL::Coarsen flag set: 7.21
-DEAL::Coarsen flag set: 7.22
-DEAL::Coarsen flag set: 7.23
-DEAL::Coarsen flag set: 7.24
-DEAL::Coarsen flag set: 7.25
-DEAL::Coarsen flag set: 7.26
-DEAL::Coarsen flag set: 7.27
-DEAL::Coarsen flag set: 7.28
-DEAL::Coarsen flag set: 7.29
-DEAL::Coarsen flag set: 7.30
-DEAL::Coarsen flag set: 7.31
-DEAL::Coarsen flag set: 7.112
-DEAL::Coarsen flag set: 7.113
-DEAL::Coarsen flag set: 7.114
-DEAL::Coarsen flag set: 7.115
-DEAL::Coarsen flag set: 7.116
-DEAL::Coarsen flag set: 7.117
-DEAL::Coarsen flag set: 7.118
-DEAL::Coarsen flag set: 7.119
-DEAL::Coarsen flag set: 7.120
-DEAL::Coarsen flag set: 7.121
-DEAL::Coarsen flag set: 7.122
-DEAL::Coarsen flag set: 7.123
-DEAL::Coarsen flag set: 7.124
-DEAL::Coarsen flag set: 7.125
-DEAL::Coarsen flag set: 7.126
-DEAL::Coarsen flag set: 7.127
-DEAL::Coarsen flag set: 7.144
-DEAL::Coarsen flag set: 7.145
-DEAL::Coarsen flag set: 7.146
-DEAL::Coarsen flag set: 7.147
-DEAL::Coarsen flag set: 7.148
-DEAL::Coarsen flag set: 7.149
-DEAL::Coarsen flag set: 7.150
-DEAL::Coarsen flag set: 7.151
-DEAL::Coarsen flag set: 7.152
-DEAL::Coarsen flag set: 7.153
-DEAL::Coarsen flag set: 7.154
-DEAL::Coarsen flag set: 7.155
-DEAL::Coarsen flag set: 7.156
-DEAL::Coarsen flag set: 7.157
-DEAL::Coarsen flag set: 7.158
-DEAL::Coarsen flag set: 7.159
-DEAL::Coarsen flag set: 7.160
-DEAL::Coarsen flag set: 7.161
-DEAL::Coarsen flag set: 7.162
-DEAL::Coarsen flag set: 7.163
-DEAL::Coarsen flag set: 7.164
-DEAL::Coarsen flag set: 7.165
-DEAL::Coarsen flag set: 7.166
-DEAL::Coarsen flag set: 7.167
-DEAL::Coarsen flag set: 7.168
-DEAL::Coarsen flag set: 7.169
-DEAL::Coarsen flag set: 7.170
-DEAL::Coarsen flag set: 7.171
-DEAL::Coarsen flag set: 7.172
-DEAL::Coarsen flag set: 7.173
-DEAL::Coarsen flag set: 7.174
-DEAL::Coarsen flag set: 7.175
-DEAL::Coarsen flag set: 7.192
-DEAL::Coarsen flag set: 7.193
-DEAL::Coarsen flag set: 7.194
-DEAL::Coarsen flag set: 7.195
-DEAL::Coarsen flag set: 7.196
-DEAL::Coarsen flag set: 7.197
-DEAL::Coarsen flag set: 7.198
-DEAL::Coarsen flag set: 7.199
-DEAL::Coarsen flag set: 7.200
-DEAL::Coarsen flag set: 7.201
-DEAL::Coarsen flag set: 7.202
-DEAL::Coarsen flag set: 7.203
-DEAL::Coarsen flag set: 7.204
-DEAL::Coarsen flag set: 7.205
-DEAL::Coarsen flag set: 7.206
-DEAL::Coarsen flag set: 7.207
-DEAL::Coarsen flag set: 7.224
-DEAL::Coarsen flag set: 7.225
-DEAL::Coarsen flag set: 7.226
-DEAL::Coarsen flag set: 7.227
-DEAL::Coarsen flag set: 7.228
-DEAL::Coarsen flag set: 7.229
-DEAL::Coarsen flag set: 7.230
-DEAL::Coarsen flag set: 7.231
-DEAL::Coarsen flag set: 7.232
-DEAL::Coarsen flag set: 7.233
-DEAL::Coarsen flag set: 7.234
-DEAL::Coarsen flag set: 7.235
-DEAL::Coarsen flag set: 7.236
-DEAL::Coarsen flag set: 7.237
-DEAL::Coarsen flag set: 7.238
-DEAL::Coarsen flag set: 7.239
-DEAL::988 (on 8 levels)
-DEAL::OK