From 0c4dee40d2ebc0ad8c16eae6b0a049aad56b93af Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 12 Aug 1998 07:37:36 +0000 Subject: [PATCH] Invent some workarounds to allow compilation of the library with the egcs compiler (it has some bugs; revert these changes some day, if the bugs are removed). git-svn-id: https://svn.dealii.org/trunk@482 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/dofs/dof_handler.cc | 23 ++++++++++++++------- deal.II/deal.II/source/grid/tria.cc | 19 ++++++++--------- deal.II/deal.II/source/numerics/matrices.cc | 8 ++++--- 3 files changed, 30 insertions(+), 20 deletions(-) diff --git a/deal.II/deal.II/source/dofs/dof_handler.cc b/deal.II/deal.II/source/dofs/dof_handler.cc index e4a921619e..9776cdd83e 100644 --- a/deal.II/deal.II/source/dofs/dof_handler.cc +++ b/deal.II/deal.II/source/dofs/dof_handler.cc @@ -1503,7 +1503,9 @@ void DoFHandler::transfer_cell (const typename DoFHandler::cell_iterat // copy dofs one-by-one for (unsigned int j=0; jactive() && old_cell->active()) @@ -1530,9 +1532,12 @@ void DoFHandler::transfer_cell (const typename DoFHandler::cell_iterat for (unsigned int k=0; ktotal_dofs; ++k) for (unsigned int j=0; jtotal_dofs; ++j) if (selected_fe->prolongate(c)(k,j) != 0.) - transfer_matrix.set (child_dof_indices[k], - old_dof_indices[j], - selected_fe->prolongate(c)(k,j)); + // use the dSMatrix:: + // as a workaround + // for a bug in egcs + transfer_matrix.dSMatrix::set (child_dof_indices[k], + old_dof_indices[j], + selected_fe->prolongate(c)(k,j)); }; } else { // old cell has children, new one has not @@ -1557,9 +1562,13 @@ void DoFHandler::transfer_cell (const typename DoFHandler::cell_iterat for (unsigned int k=0; ktotal_dofs; ++k) for (unsigned int j=0; jtotal_dofs; ++j) if (selected_fe->restrict(c)(k,j) != 0.) - transfer_matrix.set (new_dof_indices[k], - child_dof_indices[j], - selected_fe->restrict(c)(k,j)); + // use the dSMatrix:: as + // a workaround + // for a bug in egcs + + transfer_matrix.dSMatrix::set (new_dof_indices[k], + child_dof_indices[j], + selected_fe->restrict(c)(k,j)); }; }; }; diff --git a/deal.II/deal.II/source/grid/tria.cc b/deal.II/deal.II/source/grid/tria.cc index 6c1158a752..f90cb00deb 100644 --- a/deal.II/deal.II/source/grid/tria.cc +++ b/deal.II/deal.II/source/grid/tria.cc @@ -610,18 +610,17 @@ void Triangulation<2>::create_hyper_L (const double a, const double b) { template <> void Triangulation<2>::create_hyper_ball (const Point<2> &p, const double radius) { - const unsigned int dim=2; const double a = 1./(1+sqrt(2)); // equilibrate cell sizes at transition // from the inner part to the radial // cells - const Point vertices[8] = { p+Point(-1,-1)*(radius/sqrt(2)), - p+Point(+1,-1)*(radius/sqrt(2)), - p+Point(-1,-1)*(radius/sqrt(2)*a), - p+Point(+1,-1)*(radius/sqrt(2)*a), - p+Point(-1,+1)*(radius/sqrt(2)*a), - p+Point(+1,+1)*(radius/sqrt(2)*a), - p+Point(-1,+1)*(radius/sqrt(2)), - p+Point(+1,+1)*(radius/sqrt(2)) }; + const Point<2> vertices[8] = { p+Point<2>(-1,-1)*(radius/sqrt(2)), + p+Point<2>(+1,-1)*(radius/sqrt(2)), + p+Point<2>(-1,-1)*(radius/sqrt(2)*a), + p+Point<2>(+1,-1)*(radius/sqrt(2)*a), + p+Point<2>(-1,+1)*(radius/sqrt(2)*a), + p+Point<2>(+1,+1)*(radius/sqrt(2)*a), + p+Point<2>(-1,+1)*(radius/sqrt(2)), + p+Point<2>(+1,+1)*(radius/sqrt(2)) }; const int cell_vertices[5][4] = {{0, 1, 3, 2}, {0, 2, 4, 6}, @@ -638,7 +637,7 @@ void Triangulation<2>::create_hyper_ball (const Point<2> &p, const double radius cells[i].material_id = 0; }; - create_triangulation (vector >(&vertices[0], &vertices[8]), + create_triangulation (vector >(&vertices[0], &vertices[8]), cells, SubCellData()); // no boundary information }; diff --git a/deal.II/deal.II/source/numerics/matrices.cc b/deal.II/deal.II/source/numerics/matrices.cc index eda20bdb1d..d76e63f432 100644 --- a/deal.II/deal.II/source/numerics/matrices.cc +++ b/deal.II/deal.II/source/numerics/matrices.cc @@ -453,9 +453,11 @@ void MatrixTools::apply_boundary_values (const map &boundary_va first_diagonal_entry = matrix.diag_element(i); break; }; - - matrix.set(dof_number, dof_number, - first_diagonal_entry); + + // use the dSMatrix:: as a workaround + // for a bug in egcs + matrix.dSMatrix::set(dof_number, dof_number, + first_diagonal_entry); new_rhs = right_hand_side(dof_number) = dof->second * first_diagonal_entry; }; -- 2.39.5