From: guido Date: Mon, 21 Jun 1999 21:17:31 +0000 (+0000) Subject: adapted to new boundary structure X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf12105393c31c1f7a3c3441c912f3f5ee1a819f;p=dealii-svn.git adapted to new boundary structure git-svn-id: https://svn.dealii.org/trunk@1430 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/deal.II/dof_test.cc b/tests/deal.II/dof_test.cc index 0fffc3cb8e..a0554e7d6c 100644 --- a/tests/deal.II/dof_test.cc +++ b/tests/deal.II/dof_test.cc @@ -32,41 +32,47 @@ template -class Ball : - public StraightBoundary { +class Ball + : + public StraightBoundary +{ public: virtual Point - get_new_point_on_line (const typename Triangulation::line_iterator &line) const { - Point middle = StraightBoundary::get_new_point_on_line(line); + get_new_point_on_line (const typename Triangulation::line_iterator &line) const + { + Point middle = StraightBoundary::get_new_point_on_line(line); - for (int i=0; i - get_new_point_on_quad (const typename Triangulation::quad_iterator &quad) const { - Point middle = StraightBoundary::get_new_point_on_quad(quad); + get_new_point_on_quad (const typename Triangulation::quad_iterator &quad) const + { + Point middle = StraightBoundary::get_new_point_on_quad(quad); - for (int i=0; i -class CurvedLine : - public StraightBoundary { +class CurvedLine + : + public StraightBoundary +{ public: virtual Point get_new_point_on_line (const typename Triangulation::line_iterator &line) const; @@ -164,7 +170,8 @@ CurvedLine::get_new_point_on_quad (const typename Triangulation::quad_ template -class TestCases { +class TestCases +{ public: TestCases (); virtual ~TestCases (); @@ -175,6 +182,8 @@ class TestCases { private: Triangulation *tria; DoFHandler *dof; + CurvedLine curved_line; + Ball ball; }; @@ -194,7 +203,8 @@ TestCases::~TestCases () template -void TestCases::create_new () { +void TestCases::create_new () +{ if (dof != 0) delete dof; if (tria != 0) delete tria; @@ -209,13 +219,13 @@ void TestCases::create_new () { template -void TestCases::run (const unsigned int test_case) { +void TestCases::run (const unsigned int test_case) +{ cout << "Dimension = " << dim << ", Test case = " << test_case << endl << endl; cout << " Making grid..." << endl; - Boundary *boundary = 0; switch (test_case) { @@ -254,10 +264,8 @@ void TestCases::run (const unsigned int test_case) { }; // set the boundary function - boundary = (test_case==2 ? - static_cast*>(new Ball()) : - static_cast*>(new CurvedLine())); - tria->set_boundary (boundary); + tria->set_boundary(1, (test_case==2) + ? ((Boundary&)ball) : ((Boundary&)curved_line)); // refine once tria->begin_active()->set_refine_flag(); @@ -325,9 +333,6 @@ void TestCases::run (const unsigned int test_case) { // release the lock that dof has to the // finite element object dof->clear (); - tria->set_boundary (0); - if (boundary) - delete boundary; }; diff --git a/tests/deal.II/grid_test.cc b/tests/deal.II/grid_test.cc index 7bbcd56750..1f733eb0b4 100644 --- a/tests/deal.II/grid_test.cc +++ b/tests/deal.II/grid_test.cc @@ -216,9 +216,9 @@ void test (const int test_case) { Ball ball; CurvedLine curved_line; if (test_case==2) - tria.set_boundary (&ball); + tria.set_boundary (1, ball); else - tria.set_boundary (&curved_line); + tria.set_boundary (1, curved_line); // refine once tria.begin_active()->set_refine_flag();