//---------------------------- distorted_cells_01.cc ---------------------------
// $Id$
-// Version: $Name$
+// Version: $Name$
//
-// Copyright (C) 2003, 2004, 2005, 2009 by the deal.II authors
+// Copyright (C) 2003, 2004, 2005, 2009, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
default:
Assert (false, ExcNotImplemented());
}
-
+
std::vector<CellData<dim> > cells;
{
cells.push_back (cell);
}
- Triangulation<dim> coarse_grid;
+ Triangulation<dim> coarse_grid (Triangulation<dim>::none, true);
bool flag = false;
try
catch (typename Triangulation<dim>::DistortedCellList &dcv)
{
flag = true;
-
+
deallog << dcv.distorted_cells.size() << " distorted cells"
<< std::endl;
Assert (dcv.distorted_cells.front() == coarse_grid.begin(0),
}
-int main ()
+int main ()
{
std::ofstream logfile("distorted_cells_01/output");
deallog.attach(logfile);
}
}
-
-
+
+
//---------------------------- distorted_cells_02.cc ---------------------------
// $Id$
-// Version: $Name$
+// Version: $Name$
//
-// Copyright (C) 2003, 2004, 2005, 2009 by the deal.II authors
+// Copyright (C) 2003, 2004, 2005, 2009, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
template <int dim>
void check ()
{
- Triangulation<dim> coarse_grid;
+ Triangulation<dim> coarse_grid (Triangulation<dim>::none, true);
GridIn<dim> gi;
std::ifstream in (dim == 2 ? "distorted_cells_02/2d" : "distorted_cells_02/3d");
-
+
gi.attach_triangulation (coarse_grid);
-
+
bool flag = false;
try
{
catch (typename Triangulation<dim>::DistortedCellList &dcv)
{
flag = true;
-
+
deallog << dcv.distorted_cells.size() << " distorted cells"
<< std::endl;
Assert (dcv.distorted_cells.front() == coarse_grid.begin(0),
}
-int main ()
+int main ()
{
std::ofstream logfile("distorted_cells_02/output");
deallog.attach(logfile);
check<3> ();
}
-
-
+
+
//---------------------------- distorted_cells_03.cc ---------------------------
// $Id$
-// Version: $Name$
+// Version: $Name$
//
-// Copyright (C) 2003, 2004, 2005, 2009 by the deal.II authors
+// Copyright (C) 2003, 2004, 2005, 2009, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
void check ()
{
MyBoundary<dim> my_boundary;
-
+
// create a single square/cube
- Triangulation<dim> coarse_grid;
+ Triangulation<dim> coarse_grid (Triangulation<dim>::none, true);
GridGenerator::hyper_cube (coarse_grid, -1, 1);
// set bottom face to use MyBoundary
catch (typename Triangulation<dim>::DistortedCellList &dcv)
{
flag = true;
-
+
deallog << dcv.distorted_cells.size() << " distorted cells"
<< std::endl;
Assert (dcv.distorted_cells.front() == coarse_grid.begin(0),
}
-int main ()
+int main ()
{
std::ofstream logfile("distorted_cells_03/output");
deallog.attach(logfile);
check<3> ();
}
-
-
+
+
//---------------------------- distorted_cells_04.cc ---------------------------
// $Id$
-// Version: $Name$
+// Version: $Name$
//
-// Copyright (C) 2003, 2004, 2005, 2009 by the deal.II authors
+// Copyright (C) 2003, 2004, 2005, 2009, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
void check ()
{
MyBoundary<dim> my_boundary;
-
+
// create a single square/cube
- Triangulation<dim> coarse_grid;
+ Triangulation<dim> coarse_grid (Triangulation<dim>::none, true);
GridGenerator::hyper_cube (coarse_grid, -1, 1);
// set bottom face to use MyBoundary
}
-int main ()
+int main ()
{
std::ofstream logfile("distorted_cells_04/output");
deallog.attach(logfile);
check<3> ();
}
-
-
+
+
//---------------------------- distorted_cells_05.cc ---------------------------
// $Id$
-// Version: $Name$
+// Version: $Name$
//
-// Copyright (C) 2003, 2004, 2005, 2009 by the deal.II authors
+// Copyright (C) 2003, 2004, 2005, 2009, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
void check ()
{
MyBoundary<dim> my_boundary;
-
+
// create a single square/cube
- Triangulation<dim> coarse_grid;
+ Triangulation<dim> coarse_grid (Triangulation<dim>::none, true);
GridGenerator::hyper_cube (coarse_grid, -1, 1);
// set bottom face to use MyBoundary
}
-int main ()
+int main ()
{
std::ofstream logfile("distorted_cells_05/output");
deallog.attach(logfile);
check<3> ();
}
-
-
+
+
//---------------------------- distorted_cells_06.cc ---------------------------
// $Id$
-// Version: $Name$
+// Version: $Name$
//
-// Copyright (C) 2003, 2004, 2005, 2009 by the deal.II authors
+// Copyright (C) 2003, 2004, 2005, 2009, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
void check ()
{
MyBoundary<dim> my_boundary;
-
+
// create two cubes
- Triangulation<dim> coarse_grid;
+ Triangulation<dim> coarse_grid (Triangulation<dim>::none, true);
std::vector<unsigned int> sub(dim, 1);
sub[0] = 2;
Point<dim> p1 (-1,0,0), p2(1,1,1);
GridGenerator::subdivided_hyper_rectangle(coarse_grid, sub, p1, p2, true);
-
+
// set bottom middle edge to use MyBoundary
for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
for (unsigned int e=0; e<GeometryInfo<dim-1>::faces_per_cell; ++e)
Assert (dcv.distorted_cells.size() == 2,
ExcInternalError());
-
+
typename Triangulation<dim>::DistortedCellList
subset = GridTools::fix_up_distorted_child_cells (dcv,
coarse_grid);
}
-int main ()
+int main ()
{
std::ofstream logfile("distorted_cells_06/output");
deallog.attach(logfile);
check<3> ();
}
-
-
+
+
//----------------------------------------------------------------------
// $Id$
-// Version: $Name$
+// Version: $Name$
//
-// Copyright (C) 2007, 2008, 2009 by the deal.II authors
+// Copyright (C) 2007, 2008, 2009, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
void check (double r1, double r2, unsigned int n, bool)
{
Point<dim> center;
- Triangulation<dim> tria;
+ Triangulation<dim> tria (Triangulation<dim>::none, true);
GridGenerator::hyper_shell (tria, center, r1, r2, n, true);
static const HyperShellBoundary<dim> boundary(center);
tria.set_boundary(0, boundary);
{
deallog << "Found " << dcv.distorted_cells.size()
<< " distorted cells" << std::endl;
-
+
typename Triangulation<dim>::DistortedCellList
subset = GridTools::fix_up_distorted_child_cells (dcv,
tria);
ExcInternalError());
}
}
-
+
GridOut grid_out;
GridOutFlags::DX flags;
flags.write_faces = true;
//---------------------------- grid_in.cc ---------------------------
// $Id$
-// Version: $Name$
+// Version: $Name$
//
// Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009 by the deal.II authors
//
template <int dim>
void test1 ()
-{
+{
Triangulation<dim> tria;
GridIn<dim> gi;
gi.attach_triangulation (tria);
std::ifstream in ("grid_in/2d.inp");
gi.read_ucd (in);
-
+
GridOut grid_out;
grid_out.set_flags (GridOutFlags::Ucd(true));
grid_out.write_ucd (tria, logfile);
// grid_in_02 testcase fail when using this
// input file, but grid_in_02/2d.xda is a
// corrected input file.
- Triangulation<dim> tria;
+ Triangulation<dim> tria (Triangulation<dim>::none, true);
GridIn<dim> gi;
gi.attach_triangulation (tria);
std::ifstream in ("grid_in/2d.xda");
deallog << dcv.distorted_cells.size() << " cells are distorted."
<< std::endl;
}
-
+
int hash = 0;
int index = 0;
gi.read ("grid_in/2d.nc");
GridOut grid_out;
- std::ofstream gnufile("grid_in_2d.gnuplot");
+ std::ofstream gnufile("grid_in_2d.gnuplot");
grid_out.write_gnuplot (tria, gnufile);
}
void check_file (const std::string name,
typename GridIn<dim>::Format format)
{
- Triangulation<dim> tria;
+ Triangulation<dim> tria (Triangulation<dim>::none, true);
GridIn<dim> gi;
gi.attach_triangulation (tria);
try
deallog << dcv.distorted_cells.size() << " cells are distorted."
<< std::endl;
}
-
+
deallog << name
<< '\t' << tria.n_vertices()
<< '\t' << tria.n_cells()
//---------------------------- grid_in_02.cc ---------------------------
// $Id$
-// Version: $Name$
+// Version: $Name$
//
-// Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009 by the deal.II authors
+// Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
// available, program was killed
// before), with the new one it
// takes less than 8 seconds
- Triangulation<dim> tria;
+ Triangulation<dim> tria (Triangulation<dim>::none, true);
GridIn<dim> gi;
gi.attach_triangulation (tria);
std::ifstream in ("grid_in_02/2d.xda");
//---------------------------- number_cache_02.cc ---------------------------
// $Id$
-// Version: $Name$
+// Version: $Name$
//
-// Copyright (C) 2008, 2009 by the deal.II authors
+// Copyright (C) 2008, 2009, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
template <int dim>
void output (const Triangulation<dim> &tria)
{
-
+
deallog << " " << tria.n_active_cells() << std::endl;
deallog << " " << tria.n_cells() << std::endl;
deallog << " " << tria.n_active_lines() << std::endl;
deallog << " " << tria.n_active_lines(i) << std::endl;
deallog << " " << tria.n_lines(i) << std::endl;
}
-
+
if (dim == 2)
{
deallog << " " << tria.n_active_quads(i) << std::endl;
deallog << " " << tria.n_quads(i) << std::endl;
}
-
+
if (dim == 3)
{
deallog << " " << tria.n_active_hexs(i) << std::endl;
void test (const char *filename)
{
deallog << "Reading " << filename << std::endl;
-
- Triangulation<dim> tria;
+
+ Triangulation<dim> tria (Triangulation<dim>::none, true);
GridIn<dim> gi;
gi.attach_triangulation (tria);
std::ifstream in (filename);
}
output (tria);
-
+
// now refine a few cells and output again
deallog << " Refining..." << std::endl;
typename Triangulation<dim>::active_cell_iterator
deallog.threshold_double(1.e-10);
test<2> ("grid_in/2d.xda");
-
+
test<3> ("grid_in_3d/1.in");
test<3> ("grid_in_3d/2.in");
test<3> ("grid_in_3d/3.in");