<commit_before>// ---------------------------------------------------------------------
//
// Copyright (C) 2006 - 2014 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 at
// the top level of the deal.II distribution.
//
// ---------------------------------------------------------------------



// like kelly_crash_01 (which has since been renamed circular_01 because it
// continued to fail, though for other reasons) but much reduced. it turned
// out that cell->face(f)->at_boundary() and cell->at_boundary(f) did not
// always return the same thing, although they of course should. as a result,
// the KellyErrorEstimator forgot to work on certain faces
//
// the problem turned out to be that we were setting a boundary indicator for
// an interior face. while cell->face(f)->at_boundary() checks for a boundary
// indicator != 255, cell->at_boundary(f) checks whether the cell has no
// neighbor in position f. The latter was false (there was a neighbor) but the
// former true, thus the discrepancy.
//
// the problem was fixed by fixing the code

char logname[] = "output";


#include "../tests.h"


#include <deal.II/base/logstream.h>
#include <deal.II/base/utilities.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.h>
#include <deal.II/grid/tria_boundary_lib.h>

#include <fstream>


void test ()
{
  const unsigned int dim = 3;

  static const Point<3> vertices_1[]
  =
  {
    // points on the lower surface
    Point<dim>(0,  0, -4),
    Point<dim>(std::cos(0*numbers::PI/6),
    std::sin(0*numbers::PI/6),
    -4),
    Point<dim>(std::cos(2*numbers::PI/6),
    std::sin(2*numbers::PI/6),
    -4),
    Point<dim>(std::cos(4*numbers::PI/6),
    std::sin(4*numbers::PI/6),
    -4),
    Point<dim>(std::cos(6*numbers::PI/6),
    std::sin(6*numbers::PI/6),
    -4),
    Point<dim>(std::cos(8*numbers::PI/6),
    std::sin(8*numbers::PI/6),
    -4),
    Point<dim>(std::cos(10*numbers::PI/6),
    std::sin(10*numbers::PI/6),
    -4),

    // same points on the top
    // of the stem, with
    // indentation in the middle
    Point<dim>(0,  0, 4-std::sqrt(2.)/2),
    Point<dim>(std::cos(0*numbers::PI/6),
    std::sin(0*numbers::PI/6),
    4),
    Point<dim>(std::cos(2*numbers::PI/6),
    std::sin(2*numbers::PI/6),
    4),
    Point<dim>(std::cos(4*numbers::PI/6),
    std::sin(4*numbers::PI/6),
    4),
    Point<dim>(std::cos(6*numbers::PI/6),
    std::sin(6*numbers::PI/6),
    4),
    Point<dim>(std::cos(8*numbers::PI/6),
    std::sin(8*numbers::PI/6),
    4),
    Point<dim>(std::cos(10*numbers::PI/6),
    std::sin(10*numbers::PI/6),
    4),

    // point at top of chevron
    Point<dim>(0,0,4+std::sqrt(2.)/2),

    // points at the top of the
    // first extension
    // points 15-18
    Point<dim>(0,  0, 7) + Point<dim> (std::cos(2*numbers::PI/6),
    std::sin(2*numbers::PI/6),
    0) * 4,
    Point<dim>(std::cos(0*numbers::PI/6),
    std::sin(0*numbers::PI/6),
    7) + Point<dim> (std::cos(2*numbers::PI/6),
    std::sin(2*numbers::PI/6),
    0) * 4,
    Point<dim>(std::cos(2*numbers::PI/6),
    std::sin(2*numbers::PI/6),
    7) + Point<dim> (std::cos(2*numbers::PI/6),
    std::sin(2*numbers::PI/6),
    0) * 4,
    Point<dim>(std::cos(4*numbers::PI/6),
    std::sin(4*numbers::PI/6),
    7) + Point<dim> (std::cos(2*numbers::PI/6),
    std::sin(2*numbers::PI/6),
    0) * 4,

    // points at the top of the
    // second extension
    // points 19-22
    Point<dim>(0,  0, 7) + Point<dim> (std::cos(6*numbers::PI/6),
    std::sin(6*numbers::PI/6),
    0) * 4,
    Point<dim>(std::cos(4*numbers::PI/6),
    std::sin(4*numbers::PI/6),
    7) + Point<dim> (std::cos(6*numbers::PI/6),
    std::sin(6*numbers::PI/6),
    0) * 4,
    Point<dim>(std::cos(6*numbers::PI/6),
    std::sin(6*numbers::PI/6),
    7) + Point<dim> (std::cos(6*numbers::PI/6),
    std::sin(6*numbers::PI/6),
    0) * 4,
    Point<dim>(std::cos(8*numbers::PI/6),
    std::sin(8*numbers::PI/6),
    7) + Point<dim> (std::cos(6*numbers::PI/6),
    std::sin(6*numbers::PI/6),
    0) * 4,

    // points at the top of the
    // third extension
    // points 23-26
    Point<dim>(0,  0, 7) + Point<dim> (std::cos(10*numbers::PI/6),
    std::sin(10*numbers::PI/6),
    0) * 4,
    Point<dim>(std::cos(8*numbers::PI/6),
    std::sin(8*numbers::PI/6),
    7) + Point<dim> (std::cos(10*numbers::PI/6),
    std::sin(10*numbers::PI/6),
    0) * 4,
    Point<dim>(std::cos(10*numbers::PI/6),
    std::sin(10*numbers::PI/6),
    7) + Point<dim> (std::cos(10*numbers::PI/6),
    std::sin(10*numbers::PI/6),
    0) * 4,
    Point<dim>(std::cos(0*numbers::PI/6),
    std::sin(0*numbers::PI/6),
    7) + Point<dim> (std::cos(10*numbers::PI/6),
    std::sin(10*numbers::PI/6),
    0) * 4,

  };

  const unsigned int
  n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
  const std::vector<Point<dim> > vertices (&vertices_1[0],
                                           &vertices_1[n_vertices]);
  static const int cell_vertices[][GeometryInfo<dim>::vertices_per_cell]
  =
  {
    // the three cells in the stem<commit_msg>Disambiguate the use of operator*<commit_after>// ---------------------------------------------------------------------
//
// Copyright (C) 2006 - 2015 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 at
// the top level of the deal.II distribution.
//
// ---------------------------------------------------------------------



// like kelly_crash_01 (which has since been renamed circular_01 because it
// continued to fail, though for other reasons) but much reduced. it turned
// out that cell->face(f)->at_boundary() and cell->at_boundary(f) did not
// always return the same thing, although they of course should. as a result,
// the KellyErrorEstimator forgot to work on certain faces
//
// the problem turned out to be that we were setting a boundary indicator for
// an interior face. while cell->face(f)->at_boundary() checks for a boundary
// indicator != 255, cell->at_boundary(f) checks whether the cell has no
// neighbor in position f. The latter was false (there was a neighbor) but the
// former true, thus the discrepancy.
//
// the problem was fixed by fixing the code

char logname[] = "output";


#include "../tests.h"


#include <deal.II/base/logstream.h>
#include <deal.II/base/utilities.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.h>
#include <deal.II/grid/tria_boundary_lib.h>

#include <fstream>


void test ()
{
  const unsigned int dim = 3;

  static const Point<3> vertices_1[]
  =
  {
    // points on the lower surface
    Point<dim>(0,  0, -4),
    Point<dim>(std::cos(0*numbers::PI/6),
    std::sin(0*numbers::PI/6),
    -4),
    Point<dim>(std::cos(2*numbers::PI/6),
    std::sin(2*numbers::PI/6),
    -4),
    Point<dim>(std::cos(4*numbers::PI/6),
    std::sin(4*numbers::PI/6),
    -4),
    Point<dim>(std::cos(6*numbers::PI/6),
    std::sin(6*numbers::PI/6),
    -4),
    Point<dim>(std::cos(8*numbers::PI/6),
    std::sin(8*numbers::PI/6),
    -4),
    Point<dim>(std::cos(10*numbers::PI/6),
    std::sin(10*numbers::PI/6),
    -4),

    // same points on the top
    // of the stem, with
    // indentation in the middle
    Point<dim>(0,  0, 4-std::sqrt(2.)/2),
    Point<dim>(std::cos(0*numbers::PI/6),
    std::sin(0*numbers::PI/6),
    4),
    Point<dim>(std::cos(2*numbers::PI/6),
    std::sin(2*numbers::PI/6),
    4),
    Point<dim>(std::cos(4*numbers::PI/6),
    std::sin(4*numbers::PI/6),
    4),
    Point<dim>(std::cos(6*numbers::PI/6),
    std::sin(6*numbers::PI/6),
    4),
    Point<dim>(std::cos(8*numbers::PI/6),
    std::sin(8*numbers::PI/6),
    4),
    Point<dim>(std::cos(10*numbers::PI/6),
    std::sin(10*numbers::PI/6),
    4),

    // point at top of chevron
    Point<dim>(0,0,4+std::sqrt(2.)/2),

    // points at the top of the
    // first extension
    // points 15-18
    Point<dim>(0,  0, 7) + Point<dim> (std::cos(2*numbers::PI/6),
    std::sin(2*numbers::PI/6),
    0) * 4.0,
    Point<dim>(std::cos(0*numbers::PI/6),
    std::sin(0*numbers::PI/6),
    7) + Point<dim> (std::cos(2*numbers::PI/6),
    std::sin(2*numbers::PI/6),
    0) * 4.0,
    Point<dim>(std::cos(2*numbers::PI/6),
    std::sin(2*numbers::PI/6),
    7) + Point<dim> (std::cos(2*numbers::PI/6),
    std::sin(2*numbers::PI/6),
    0) * 4.0,
    Point<dim>(std::cos(4*numbers::PI/6),
    std::sin(4*numbers::PI/6),
    7) + Point<dim> (std::cos(2*numbers::PI/6),
    std::sin(2*numbers::PI/6),
    0) * 4.0,

    // points at the top of the
    // second extension
    // points 19-22
    Point<dim>(0,  0, 7) + Point<dim> (std::cos(6*numbers::PI/6),
    std::sin(6*numbers::PI/6),
    0) * 4.0,
    Point<dim>(std::cos(4*numbers::PI/6),
    std::sin(4*numbers::PI/6),
    7) + Point<dim> (std::cos(6*numbers::PI/6),
    std::sin(6*numbers::PI/6),
    0) * 4.0,
    Point<dim>(std::cos(6*numbers::PI/6),
    std::sin(6*numbers::PI/6),
    7) + Point<dim> (std::cos(6*numbers::PI/6),
    std::sin(6*numbers::PI/6),
    0) * 4.0,
    Point<dim>(std::cos(8*numbers::PI/6),
    std::sin(8*numbers::PI/6),
    7) + Point<dim> (std::cos(6*numbers::PI/6),
    std::sin(6*numbers::PI/6),
    0) * 4.0,

    // points at the top of the
    // third extension
    // points 23-26
    Point<dim>(0,  0, 7) + Point<dim> (std::cos(10*numbers::PI/6),
    std::sin(10*numbers::PI/6),
    0) * 4.0,
    Point<dim>(std::cos(8*numbers::PI/6),
    std::sin(8*numbers::PI/6),
    7) + Point<dim> (std::cos(10*numbers::PI/6),
    std::sin(10*numbers::PI/6),
    0) * 4.0,
    Point<dim>(std::cos(10*numbers::PI/6),
    std::sin(10*numbers::PI/6),
    7) + Point<dim> (std::cos(10*numbers::PI/6),
    std::sin(10*numbers::PI/6),
    0) * 4.0,
    Point<dim>(std::cos(0*numbers::PI/6),
    std::sin(0*numbers::PI/6),
    7) + Point<dim> (std::cos(10*numbers::PI/6),
    std::sin(10*numbers::PI/6),
    0) * 4.0,

  };

  const unsigned int
  n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
  const std::vector<Point<dim> > vertices (&vertices_1[0],
                                           &vertices_1[n_vertices]);
  static const int cell_vertices[][GeometryInfo<dim>::vertices_per_cell]
  =
  {
    // the three cells in the stem
{'fraction_non_alphanumeric': 0.22531760435571688, 'fraction_numerical': 0.04664246823956443, 'mean_word_length': 2.926255789098682, 'pattern_counts': {'":': 0, '<': 105, '<?xml version=': 0, '>': 117, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '340814', 'n_tokens_mistral': 4426, 'n_tokens_neox': 4129, 'n_words': 877}