From 7f2979cbed418f31aac811bf90e556bc1862837d Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Thu, 31 Mar 2011 07:46:24 +0000 Subject: [PATCH] Fixed anisotropic refinement in codim one. git-svn-id: https://svn.dealii.org/trunk@23548 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/doc/news/changes.h | 6 ++++++ deal.II/source/grid/tria.cc | 6 ++++++ deal.II/source/grid/tria_accessor.cc | 23 ++++++++++++++++++++++- 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index 1aba483bfa..bac4a0b86e 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -28,6 +28,12 @@ inconvenience this causes.

General

+
    +
  1. Fixed: Added some instantiations to make anisotropic refinement work +in codimension one. +
    +(Luca Heltai, 2011/03/31) +
    1. Fixed: Corrections in the creation of the face and subface interpolation matrices in the class FE_Nedelec. diff --git a/deal.II/source/grid/tria.cc b/deal.II/source/grid/tria.cc index 4124a4dc83..65bcdc65a0 100644 --- a/deal.II/source/grid/tria.cc +++ b/deal.II/source/grid/tria.cc @@ -8944,11 +8944,17 @@ namespace internal void prevent_distorted_boundary_cells (const Triangulation<1,spacedim> &); + template static void prevent_distorted_boundary_cells (Triangulation &triangulation) { + // If the codimension is + // one, we cannot perform + // this check yet. + if(spacedim>dim) return; + for (typename Triangulation::cell_iterator cell=triangulation.begin(); cell!=triangulation.end(); ++cell) if (cell->at_boundary() && diff --git a/deal.II/source/grid/tria_accessor.cc b/deal.II/source/grid/tria_accessor.cc index 7be71bc7ee..ef944f8d6d 100644 --- a/deal.II/source/grid/tria_accessor.cc +++ b/deal.II/source/grid/tria_accessor.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -1018,6 +1018,15 @@ double TriaAccessor<1,1,1>::extent_in_direction(const unsigned int axis) const } +template <> +double TriaAccessor<1,1,2>::extent_in_direction(const unsigned int axis) const +{ + Assert (axis == 0, ExcIndexRange (axis, 0, 1)); + + return this->diameter(); +} + + template <> double TriaAccessor<2,2,2>::extent_in_direction(const unsigned int axis) const { @@ -1030,6 +1039,18 @@ double TriaAccessor<2,2,2>::extent_in_direction(const unsigned int axis) const this->line(lines[axis][1])->diameter()); } +template <> +double TriaAccessor<2,2,3>::extent_in_direction(const unsigned int axis) const +{ + const unsigned int lines[2][2] = {{2,3}, /// Lines along x-axis, see GeometryInfo + {0,1}};/// Lines along y-axis + + Assert (axis < 2, ExcIndexRange (axis, 0, 2)); + + return std::max(this->line(lines[axis][0])->diameter(), + this->line(lines[axis][1])->diameter()); +} + template <> double TriaAccessor<3,3,3>::extent_in_direction(const unsigned int axis) const -- 2.39.5