From: wolf Date: Mon, 29 Oct 2001 08:52:05 +0000 (+0000) Subject: More for subdomain ids. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb48012df2d680b7627586305087136a58b0b9eb;p=dealii-svn.git More for subdomain ids. git-svn-id: https://svn.dealii.org/trunk@5169 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/dofs/dof_tools.cc b/deal.II/deal.II/source/dofs/dof_tools.cc index c4ab77fae4..71a27dfe61 100644 --- a/deal.II/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/deal.II/source/dofs/dof_tools.cc @@ -1119,7 +1119,7 @@ DoFTools::extract_hanging_node_dofs (const DoFHandler<3> &dof_handler, Assert(selected_dofs.size() == dof_handler.n_dofs(), ExcDimensionMismatch(selected_dofs.size(), dof_handler.n_dofs())); // preset all values by false - fill_n (selected_dofs.begin(), dof_handler.n_dofs(), false); + std::fill_n (selected_dofs.begin(), dof_handler.n_dofs(), false); const FiniteElement &fe = dof_handler.get_fe(); @@ -1175,6 +1175,38 @@ DoFTools::extract_hanging_node_dofs (const DoFHandler<3> &dof_handler, +template +void +DoFTools::extract_subdomain_dofs (const DoFHandler &dof_handler, + const unsigned int subdomain_id, + std::vector &selected_dofs) +{ + Assert(selected_dofs.size() == dof_handler.n_dofs(), + ExcDimensionMismatch(selected_dofs.size(), dof_handler.n_dofs())); + // preset all values by false + std::fill_n (selected_dofs.begin(), dof_handler.n_dofs(), false); + + const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell; + std::vector local_dof_indices (dofs_per_cell); + + // this function is similar to the + // make_sparsity_pattern function, + // see there for more information + + typename DoFHandler::active_cell_iterator + cell = dof_handler.begin_active(), + endc = dof_handler.end(); + for (; cell!=endc; ++cell) + if (cell->subdomain_id() == subdomain_id) + { + cell->get_dof_indices (local_dof_indices); + for (unsigned int i=0; i void DoFTools::count_dofs_per_component (const DoFHandler &dof_handler, @@ -2362,7 +2394,13 @@ DoFTools::extract_boundary_dofs (const DoFHandler &, const std::set &); #endif +template +void +DoFTools::extract_subdomain_dofs (const DoFHandler &dof_handler, + const unsigned int subdomain_id, + std::vector &selected_dofs); + template void DoFTools::count_dofs_per_component (const DoFHandler &dof_handler, diff --git a/deal.II/deal.II/source/grid/tria.all_dimensions.cc b/deal.II/deal.II/source/grid/tria.all_dimensions.cc index 3c8824b618..e194e8beda 100644 --- a/deal.II/deal.II/source/grid/tria.all_dimensions.cc +++ b/deal.II/deal.II/source/grid/tria.all_dimensions.cc @@ -154,6 +154,11 @@ TriangulationLevel<0>::reserve_space (const unsigned int total_cells, total_cells - coarsen_flags.size(), false); + subdomain_ids.reserve (total_cells); + subdomain_ids.insert (subdomain_ids.end(), + total_cells - subdomain_ids.size(), + 0); + neighbors.reserve (total_cells*(2*dimension)); neighbors.insert (neighbors.end(), total_cells*(2*dimension) - neighbors.size(), @@ -185,6 +190,10 @@ TriangulationLevel<0>::monitor_memory (const unsigned int true_dimension) const neighbors.size()<256, ExcMemoryWasted ("neighbors", neighbors.size(), neighbors.capacity())); + Assert (subdomain_ids.size() == subdomain_ids.capacity() || + subdomain_ids.size()<256, + ExcMemoryWasted ("subdomain_ids", + subdomain_ids.size(), subdomain_ids.capacity())); Assert (2*true_dimension*refine_flags.size() == neighbors.size(), ExcMemoryInexact (refine_flags.size(), neighbors.size())); Assert (2*true_dimension*coarsen_flags.size() == neighbors.size(), diff --git a/deal.II/deal.II/source/grid/tria.cc b/deal.II/deal.II/source/grid/tria.cc index 26b07f2c05..550df0c14c 100644 --- a/deal.II/deal.II/source/grid/tria.cc +++ b/deal.II/deal.II/source/grid/tria.cc @@ -263,6 +263,7 @@ void Triangulation<1>::create_triangulation (const std::vector > &v, next_free_line->set_used_flag (); next_free_line->set_material_id (cells[cell].material_id); next_free_line->clear_user_pointer (); + next_free_line->set_subdomain_id (0); // note that this cell // is adjacent to these vertices @@ -626,6 +627,8 @@ void Triangulation<2>::create_triangulation (const std::vector > &v, cell->set_used_flag (); cell->set_material_id (cells[c].material_id); cell->clear_user_pointer (); + cell->set_subdomain_id (0); + // note that this cell is adjacent // to the four lines for (unsigned int line=0; line<4; ++line) @@ -810,7 +813,8 @@ void Triangulation<2>::create_triangulation (const std::vector > &v, * Since this comparison is not canonical, we do not include it into the * general Quad class. */ -struct QuadComparator { +struct QuadComparator +{ inline bool operator () (const Quad &q1, const Quad &q2) const { // here is room to optimize the @@ -1256,6 +1260,8 @@ void Triangulation<3>::create_triangulation (const std::vector > &v, cell->set_material_id (cells[c].material_id); cell->clear_user_flag (); cell->clear_user_pointer (); + cell->set_subdomain_id (0); + // note that this cell is adjacent // to the four lines for (unsigned int quad=0; quad<6; ++quad) @@ -1775,7 +1781,8 @@ using namespace std; template -void Triangulation::save_refine_flags (std::vector &v) const { +void Triangulation::save_refine_flags (std::vector &v) const +{ v.resize (n_active_cells(), false); std::vector::iterator i = v.begin(); active_cell_iterator cell = begin_active(), @@ -1785,8 +1792,10 @@ void Triangulation::save_refine_flags (std::vector &v) const { }; + template -void Triangulation::save_refine_flags (std::ostream &out) const { +void Triangulation::save_refine_flags (std::ostream &out) const +{ std::vector v; save_refine_flags (v); write_bool_vector (mn_tria_refine_flags_begin, v, mn_tria_refine_flags_end, @@ -1794,8 +1803,10 @@ void Triangulation::save_refine_flags (std::ostream &out) const { }; + template -void Triangulation::load_refine_flags (std::istream &in) { +void Triangulation::load_refine_flags (std::istream &in) +{ std::vector v; read_bool_vector (mn_tria_refine_flags_begin, v, mn_tria_refine_flags_end, in); @@ -1803,8 +1814,10 @@ void Triangulation::load_refine_flags (std::istream &in) { }; + template -void Triangulation::load_refine_flags (const std::vector &v) { +void Triangulation::load_refine_flags (const std::vector &v) +{ Assert (v.size() == n_active_cells(), ExcGridReadError()); active_cell_iterator cell = begin_active(), @@ -1818,8 +1831,10 @@ void Triangulation::load_refine_flags (const std::vector &v) { }; + template -void Triangulation::save_coarsen_flags (std::vector &v) const { +void Triangulation::save_coarsen_flags (std::vector &v) const +{ v.resize (n_active_cells(), false); std::vector::iterator i = v.begin(); active_cell_iterator cell = begin_active(), @@ -1829,8 +1844,10 @@ void Triangulation::save_coarsen_flags (std::vector &v) const { }; + template -void Triangulation::save_coarsen_flags (std::ostream &out) const { +void Triangulation::save_coarsen_flags (std::ostream &out) const +{ std::vector v; save_coarsen_flags (v); write_bool_vector (mn_tria_coarsen_flags_begin, v, mn_tria_coarsen_flags_end, @@ -1838,8 +1855,10 @@ void Triangulation::save_coarsen_flags (std::ostream &out) const { }; + template -void Triangulation::load_coarsen_flags (std::istream &in) { +void Triangulation::load_coarsen_flags (std::istream &in) +{ std::vector v; read_bool_vector (mn_tria_coarsen_flags_begin, v, mn_tria_coarsen_flags_end, in); @@ -1847,8 +1866,10 @@ void Triangulation::load_coarsen_flags (std::istream &in) { }; + template -void Triangulation::load_coarsen_flags (const std::vector &v) { +void Triangulation::load_coarsen_flags (const std::vector &v) +{ Assert (v.size() == n_active_cells(), ExcGridReadError()); active_cell_iterator cell = begin_active(), @@ -1865,7 +1886,8 @@ void Triangulation::load_coarsen_flags (const std::vector &v) { #if deal_II_dimension == 1 template <> -void Triangulation<1>::clear_user_pointers () { +void Triangulation<1>::clear_user_pointers () +{ cell_iterator cell = begin(), endc = end(); for (; cell!=endc; ++cell) @@ -1873,8 +1895,10 @@ void Triangulation<1>::clear_user_pointers () { }; + template <> -void Triangulation<1>::clear_user_flags () { +void Triangulation<1>::clear_user_flags () +{ cell_iterator cell = begin(), endc = end(); for (; cell!=endc; ++cell) @@ -1887,7 +1911,8 @@ void Triangulation<1>::clear_user_flags () { #if deal_II_dimension == 2 template <> -void Triangulation<2>::clear_user_pointers () { +void Triangulation<2>::clear_user_pointers () +{ line_iterator line = begin_line(), endl = end_line(); for (; line!=endl; ++line) @@ -1900,8 +1925,10 @@ void Triangulation<2>::clear_user_pointers () { }; + template <> -void Triangulation<2>::clear_user_flags () { +void Triangulation<2>::clear_user_flags () +{ line_iterator line = begin_line(), endl = end_line(); for (; line!=endl; ++line) @@ -1920,7 +1947,8 @@ void Triangulation<2>::clear_user_flags () { #if deal_II_dimension == 3 template <> -void Triangulation<3>::clear_user_pointers () { +void Triangulation<3>::clear_user_pointers () +{ line_iterator line = begin_line(), endl = end_line(); for (; line!=endl; ++line) @@ -1938,8 +1966,10 @@ void Triangulation<3>::clear_user_pointers () { }; + template <> -void Triangulation<3>::clear_user_flags () { +void Triangulation<3>::clear_user_flags () +{ line_iterator line = begin_line(), endl = end_line(); for (; line!=endl; ++line) @@ -1961,7 +1991,8 @@ void Triangulation<3>::clear_user_flags () { template -void Triangulation::save_user_flags (std::ostream &out) const { +void Triangulation::save_user_flags (std::ostream &out) const +{ save_user_flags_line (out); if (dim>=2) @@ -1975,8 +2006,10 @@ void Triangulation::save_user_flags (std::ostream &out) const { }; + template -void Triangulation::save_user_flags (std::vector &v) const { +void Triangulation::save_user_flags (std::vector &v) const +{ // clear vector and append // all the stuff later on v.clear (); @@ -2003,6 +2036,7 @@ void Triangulation::save_user_flags (std::vector &v) const { }; + template void Triangulation::load_user_flags (std::istream &in) { @@ -2019,6 +2053,7 @@ void Triangulation::load_user_flags (std::istream &in) }; + template void Triangulation::load_user_flags (const std::vector &v) { @@ -2054,8 +2089,10 @@ void Triangulation::load_user_flags (const std::vector &v) }; + template -void Triangulation::save_user_flags_line (std::vector &v) const { +void Triangulation::save_user_flags_line (std::vector &v) const +{ v.resize (n_lines(), false); std::vector::iterator i = v.begin(); line_iterator line = begin_line(), @@ -2065,8 +2102,10 @@ void Triangulation::save_user_flags_line (std::vector &v) const { }; + template -void Triangulation::save_user_flags_line (std::ostream &out) const { +void Triangulation::save_user_flags_line (std::ostream &out) const +{ std::vector v; save_user_flags_line (v); write_bool_vector (mn_tria_line_user_flags_begin, v, mn_tria_line_user_flags_end, @@ -2074,8 +2113,10 @@ void Triangulation::save_user_flags_line (std::ostream &out) const { }; + template -void Triangulation::load_user_flags_line (std::istream &in) { +void Triangulation::load_user_flags_line (std::istream &in) +{ std::vector v; read_bool_vector (mn_tria_line_user_flags_begin, v, mn_tria_line_user_flags_end, in); @@ -2083,8 +2124,10 @@ void Triangulation::load_user_flags_line (std::istream &in) { }; + template -void Triangulation::load_user_flags_line (const std::vector &v) { +void Triangulation::load_user_flags_line (const std::vector &v) +{ Assert (v.size() == n_lines(), ExcGridReadError()); line_iterator line = begin_line(), @@ -2101,49 +2144,64 @@ void Triangulation::load_user_flags_line (const std::vector &v) { #if deal_II_dimension == 1 template <> -void Triangulation<1>::save_user_flags_quad (std::ostream &) const { +void Triangulation<1>::save_user_flags_quad (std::ostream &) const +{ Assert (false, ExcFunctionNotUseful()); }; + template <> -void Triangulation<1>::save_user_flags_quad (std::vector &) const { +void Triangulation<1>::save_user_flags_quad (std::vector &) const +{ Assert (false, ExcFunctionNotUseful()); }; + template <> -void Triangulation<1>::load_user_flags_quad (std::istream &) { +void Triangulation<1>::load_user_flags_quad (std::istream &) +{ Assert (false, ExcFunctionNotUseful()); }; + template <> -void Triangulation<1>::load_user_flags_quad (const std::vector &) { +void Triangulation<1>::load_user_flags_quad (const std::vector &) +{ Assert (false, ExcFunctionNotUseful()); }; + template <> -void Triangulation<1>::save_user_flags_hex (std::ostream &) const { +void Triangulation<1>::save_user_flags_hex (std::ostream &) const +{ Assert (false, ExcFunctionNotUseful()); }; + template <> -void Triangulation<1>::save_user_flags_hex (std::vector &) const { +void Triangulation<1>::save_user_flags_hex (std::vector &) const +{ Assert (false, ExcFunctionNotUseful()); }; + template <> -void Triangulation<1>::load_user_flags_hex (std::istream &) { +void Triangulation<1>::load_user_flags_hex (std::istream &) +{ Assert (false, ExcFunctionNotUseful()); }; + template <> -void Triangulation<1>::load_user_flags_hex (const std::vector &) { +void Triangulation<1>::load_user_flags_hex (const std::vector &) +{ Assert (false, ExcFunctionNotUseful()); }; @@ -2151,7 +2209,8 @@ void Triangulation<1>::load_user_flags_hex (const std::vector &) { template -void Triangulation::save_user_flags_quad (std::vector &v) const { +void Triangulation::save_user_flags_quad (std::vector &v) const +{ v.resize (n_quads(), false); std::vector::iterator i = v.begin(); quad_iterator quad = begin_quad(), @@ -2161,8 +2220,10 @@ void Triangulation::save_user_flags_quad (std::vector &v) const { }; + template -void Triangulation::save_user_flags_quad (std::ostream &out) const { +void Triangulation::save_user_flags_quad (std::ostream &out) const +{ std::vector v; save_user_flags_quad (v); write_bool_vector (mn_tria_quad_user_flags_begin, v, mn_tria_quad_user_flags_end, @@ -2170,8 +2231,10 @@ void Triangulation::save_user_flags_quad (std::ostream &out) const { }; + template -void Triangulation::load_user_flags_quad (std::istream &in) { +void Triangulation::load_user_flags_quad (std::istream &in) +{ std::vector v; read_bool_vector (mn_tria_quad_user_flags_begin, v, mn_tria_quad_user_flags_end, in); @@ -2179,8 +2242,10 @@ void Triangulation::load_user_flags_quad (std::istream &in) { }; + template -void Triangulation::load_user_flags_quad (const std::vector &v) { +void Triangulation::load_user_flags_quad (const std::vector &v) +{ Assert (v.size() == n_quads(), ExcGridReadError()); quad_iterator quad = begin_quad(), @@ -2197,25 +2262,32 @@ void Triangulation::load_user_flags_quad (const std::vector &v) { #if deal_II_dimension == 2 template <> -void Triangulation<2>::save_user_flags_hex (std::ostream &) const { +void Triangulation<2>::save_user_flags_hex (std::ostream &) const +{ Assert (false, ExcFunctionNotUseful()); }; + template <> -void Triangulation<2>::save_user_flags_hex (std::vector &) const { +void Triangulation<2>::save_user_flags_hex (std::vector &) const +{ Assert (false, ExcFunctionNotUseful()); }; + template <> -void Triangulation<2>::load_user_flags_hex (std::istream &) { +void Triangulation<2>::load_user_flags_hex (std::istream &) +{ Assert (false, ExcFunctionNotUseful()); }; + template <> -void Triangulation<2>::load_user_flags_hex (const std::vector &) { +void Triangulation<2>::load_user_flags_hex (const std::vector &) +{ Assert (false, ExcFunctionNotUseful()); }; @@ -2224,7 +2296,8 @@ void Triangulation<2>::load_user_flags_hex (const std::vector &) { template -void Triangulation::save_user_flags_hex (std::vector &v) const { +void Triangulation::save_user_flags_hex (std::vector &v) const +{ v.resize (n_hexs(), false); std::vector::iterator i = v.begin(); hex_iterator hex = begin_hex(), @@ -2234,8 +2307,10 @@ void Triangulation::save_user_flags_hex (std::vector &v) const { }; + template -void Triangulation::save_user_flags_hex (std::ostream &out) const { +void Triangulation::save_user_flags_hex (std::ostream &out) const +{ std::vector v; save_user_flags_hex (v); write_bool_vector (mn_tria_hex_user_flags_begin, v, mn_tria_hex_user_flags_end, @@ -2243,8 +2318,10 @@ void Triangulation::save_user_flags_hex (std::ostream &out) const { }; + template -void Triangulation::load_user_flags_hex (std::istream &in) { +void Triangulation::load_user_flags_hex (std::istream &in) +{ std::vector v; read_bool_vector (mn_tria_hex_user_flags_begin, v, mn_tria_hex_user_flags_end, in); @@ -2252,8 +2329,10 @@ void Triangulation::load_user_flags_hex (std::istream &in) { }; + template -void Triangulation::load_user_flags_hex (const std::vector &v) { +void Triangulation::load_user_flags_hex (const std::vector &v) +{ Assert (v.size() == n_hexs(), ExcGridReadError()); hex_iterator hex = begin_hex(), @@ -2274,295 +2353,370 @@ void Triangulation::load_user_flags_hex (const std::vector &v) { template <> TriaDimensionInfo<1>::raw_cell_iterator -Triangulation<1>::begin_raw (const unsigned int level) const { +Triangulation<1>::begin_raw (const unsigned int level) const +{ return begin_raw_line (level); }; + template <> TriaDimensionInfo<1>::active_cell_iterator -Triangulation<1>::begin_active (const unsigned int level) const { +Triangulation<1>::begin_active (const unsigned int level) const +{ return begin_active_line (level); }; + template <> TriaDimensionInfo<1>::raw_cell_iterator -Triangulation<1>::last_raw () const { +Triangulation<1>::last_raw () const +{ return last_raw_line (); }; + template <> TriaDimensionInfo<1>::raw_cell_iterator -Triangulation<1>::last_raw (const unsigned int level) const { +Triangulation<1>::last_raw (const unsigned int level) const +{ return last_raw_line (level); }; + template <> TriaDimensionInfo<1>::cell_iterator -Triangulation<1>::last () const { +Triangulation<1>::last () const +{ return last_line (); }; + template <> TriaDimensionInfo<1>::cell_iterator -Triangulation<1>::last (const unsigned int level) const { +Triangulation<1>::last (const unsigned int level) const +{ return last_line (level); }; + template <> TriaDimensionInfo<1>::active_cell_iterator -Triangulation<1>::last_active () const { +Triangulation<1>::last_active () const +{ return last_active_line (); }; + template <> TriaDimensionInfo<1>::active_cell_iterator -Triangulation<1>::last_active (const unsigned int level) const { +Triangulation<1>::last_active (const unsigned int level) const +{ return last_active_line (level); }; + template <> TriaDimensionInfo<1>::raw_face_iterator -Triangulation<1>::begin_raw_face (const unsigned int) const { +Triangulation<1>::begin_raw_face (const unsigned int) const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::face_iterator -Triangulation<1>::begin_face (const unsigned int) const { +Triangulation<1>::begin_face (const unsigned int) const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::active_face_iterator -Triangulation<1>::begin_active_face (const unsigned int) const { +Triangulation<1>::begin_active_face (const unsigned int) const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::raw_face_iterator -Triangulation<1>::end_face () const { +Triangulation<1>::end_face () const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::raw_face_iterator -Triangulation<1>::last_raw_face () const { +Triangulation<1>::last_raw_face () const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::raw_face_iterator -Triangulation<1>::last_raw_face (const unsigned int) const { +Triangulation<1>::last_raw_face (const unsigned int) const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::face_iterator -Triangulation<1>::last_face () const { +Triangulation<1>::last_face () const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::face_iterator -Triangulation<1>::last_face (const unsigned int) const { +Triangulation<1>::last_face (const unsigned int) const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::active_face_iterator -Triangulation<1>::last_active_face () const { +Triangulation<1>::last_active_face () const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::active_face_iterator -Triangulation<1>::last_active_face (const unsigned int) const { +Triangulation<1>::last_active_face (const unsigned int) const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::raw_quad_iterator -Triangulation<1>::begin_raw_quad (const unsigned int) const { +Triangulation<1>::begin_raw_quad (const unsigned int) const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::quad_iterator -Triangulation<1>::begin_quad (const unsigned int) const { +Triangulation<1>::begin_quad (const unsigned int) const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::active_quad_iterator -Triangulation<1>::begin_active_quad (const unsigned int) const { +Triangulation<1>::begin_active_quad (const unsigned int) const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::raw_quad_iterator -Triangulation<1>::end_quad () const { +Triangulation<1>::end_quad () const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::raw_quad_iterator -Triangulation<1>::last_raw_quad (const unsigned int) const { +Triangulation<1>::last_raw_quad (const unsigned int) const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::raw_quad_iterator -Triangulation<1>::last_raw_quad () const { +Triangulation<1>::last_raw_quad () const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::quad_iterator -Triangulation<1>::last_quad (const unsigned int) const { +Triangulation<1>::last_quad (const unsigned int) const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::quad_iterator -Triangulation<1>::last_quad () const { +Triangulation<1>::last_quad () const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::active_quad_iterator -Triangulation<1>::last_active_quad (const unsigned int) const { +Triangulation<1>::last_active_quad (const unsigned int) const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::active_quad_iterator -Triangulation<1>::last_active_quad () const { +Triangulation<1>::last_active_quad () const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::raw_hex_iterator -Triangulation<1>::begin_raw_hex (const unsigned int) const { +Triangulation<1>::begin_raw_hex (const unsigned int) const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::hex_iterator -Triangulation<1>::begin_hex (const unsigned int) const { +Triangulation<1>::begin_hex (const unsigned int) const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::active_hex_iterator -Triangulation<1>::begin_active_hex (const unsigned int) const { +Triangulation<1>::begin_active_hex (const unsigned int) const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::raw_hex_iterator -Triangulation<1>::end_hex () const { +Triangulation<1>::end_hex () const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::raw_hex_iterator -Triangulation<1>::last_raw_hex (const unsigned int) const { +Triangulation<1>::last_raw_hex (const unsigned int) const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::raw_hex_iterator -Triangulation<1>::last_raw_hex () const { +Triangulation<1>::last_raw_hex () const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::hex_iterator -Triangulation<1>::last_hex (const unsigned int) const { +Triangulation<1>::last_hex (const unsigned int) const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::hex_iterator -Triangulation<1>::last_hex () const { +Triangulation<1>::last_hex () const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::active_hex_iterator -Triangulation<1>::last_active_hex (const unsigned int) const { +Triangulation<1>::last_active_hex (const unsigned int) const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<1>::active_hex_iterator -Triangulation<1>::last_active_hex () const { +Triangulation<1>::last_active_hex () const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; @@ -2574,210 +2728,264 @@ Triangulation<1>::last_active_hex () const { template <> TriaDimensionInfo<2>::raw_cell_iterator -Triangulation<2>::begin_raw (const unsigned int level) const { +Triangulation<2>::begin_raw (const unsigned int level) const +{ return begin_raw_quad (level); }; + template <> TriaDimensionInfo<2>::active_cell_iterator -Triangulation<2>::begin_active (const unsigned int level) const { +Triangulation<2>::begin_active (const unsigned int level) const +{ return begin_active_quad (level); }; + template <> TriaDimensionInfo<2>::raw_cell_iterator -Triangulation<2>::last_raw () const { +Triangulation<2>::last_raw () const +{ return last_raw_quad (); }; + template <> TriaDimensionInfo<2>::raw_cell_iterator -Triangulation<2>::last_raw (const unsigned int level) const { +Triangulation<2>::last_raw (const unsigned int level) const +{ return last_raw_quad (level); }; + template <> TriaDimensionInfo<2>::cell_iterator -Triangulation<2>::last () const { +Triangulation<2>::last () const +{ return last_quad (); }; + template <> TriaDimensionInfo<2>::cell_iterator -Triangulation<2>::last (const unsigned int level) const { +Triangulation<2>::last (const unsigned int level) const +{ return last_quad (level); }; + template <> TriaDimensionInfo<2>::active_cell_iterator -Triangulation<2>::last_active () const { +Triangulation<2>::last_active () const +{ return last_active_quad (); }; + template <> TriaDimensionInfo<2>::active_cell_iterator -Triangulation<2>::last_active (const unsigned int level) const { +Triangulation<2>::last_active (const unsigned int level) const +{ return last_active_quad (level); }; + template <> TriaDimensionInfo<2>::raw_face_iterator -Triangulation<2>::begin_raw_face (const unsigned int level) const { +Triangulation<2>::begin_raw_face (const unsigned int level) const +{ return begin_raw_line (level); }; + template <> TriaDimensionInfo<2>::face_iterator -Triangulation<2>::begin_face (const unsigned int level) const { +Triangulation<2>::begin_face (const unsigned int level) const +{ return begin_line (level); }; + template <> TriaDimensionInfo<2>::active_face_iterator -Triangulation<2>::begin_active_face (const unsigned int level) const { +Triangulation<2>::begin_active_face (const unsigned int level) const +{ return begin_active_line (level); }; + template <> TriaDimensionInfo<2>::raw_face_iterator -Triangulation<2>::end_face () const { +Triangulation<2>::end_face () const +{ return end_line (); }; + template <> TriaDimensionInfo<2>::raw_face_iterator -Triangulation<2>::last_raw_face () const { +Triangulation<2>::last_raw_face () const +{ return last_raw_line (); }; + template <> TriaDimensionInfo<2>::raw_face_iterator -Triangulation<2>::last_raw_face (const unsigned int level) const { +Triangulation<2>::last_raw_face (const unsigned int level) const +{ return last_raw_line (level); }; + template <> TriaDimensionInfo<2>::face_iterator -Triangulation<2>::last_face () const { +Triangulation<2>::last_face () const +{ return last_line (); }; + template <> TriaDimensionInfo<2>::face_iterator -Triangulation<2>::last_face (const unsigned int level) const { +Triangulation<2>::last_face (const unsigned int level) const +{ return last_line (level); }; + template <> TriaDimensionInfo<2>::active_face_iterator -Triangulation<2>::last_active_face () const { +Triangulation<2>::last_active_face () const +{ return last_active_line (); }; + template <> TriaDimensionInfo<2>::active_face_iterator -Triangulation<2>::last_active_face (const unsigned int level) const { +Triangulation<2>::last_active_face (const unsigned int level) const +{ return last_active_line (level); }; + template <> TriaDimensionInfo<2>::raw_hex_iterator -Triangulation<2>::begin_raw_hex (const unsigned int) const { +Triangulation<2>::begin_raw_hex (const unsigned int) const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<2>::hex_iterator -Triangulation<2>::begin_hex (const unsigned int) const { +Triangulation<2>::begin_hex (const unsigned int) const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<2>::active_hex_iterator -Triangulation<2>::begin_active_hex (const unsigned int) const { +Triangulation<2>::begin_active_hex (const unsigned int) const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<2>::raw_hex_iterator -Triangulation<2>::end_hex () const { +Triangulation<2>::end_hex () const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<2>::raw_hex_iterator -Triangulation<2>::last_raw_hex (const unsigned int) const { +Triangulation<2>::last_raw_hex (const unsigned int) const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<2>::raw_hex_iterator -Triangulation<2>::last_raw_hex () const { +Triangulation<2>::last_raw_hex () const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<2>::hex_iterator -Triangulation<2>::last_hex (const unsigned int) const { +Triangulation<2>::last_hex (const unsigned int) const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<2>::hex_iterator -Triangulation<2>::last_hex () const { +Triangulation<2>::last_hex () const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<2>::active_hex_iterator -Triangulation<2>::last_active_hex (const unsigned int) const { +Triangulation<2>::last_active_hex (const unsigned int) const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; + template <> TriaDimensionInfo<2>::active_hex_iterator -Triangulation<2>::last_active_hex () const { +Triangulation<2>::last_active_hex () const +{ Assert (false, ExcFunctionNotUseful()); return 0; }; - #endif @@ -2785,116 +2993,148 @@ Triangulation<2>::last_active_hex () const { template <> TriaDimensionInfo<3>::raw_cell_iterator -Triangulation<3>::begin_raw (const unsigned int level) const { +Triangulation<3>::begin_raw (const unsigned int level) const +{ return begin_raw_hex (level); }; + template <> TriaDimensionInfo<3>::active_cell_iterator -Triangulation<3>::begin_active (const unsigned int level) const { +Triangulation<3>::begin_active (const unsigned int level) const +{ return begin_active_hex (level); }; + template <> TriaDimensionInfo<3>::raw_cell_iterator -Triangulation<3>::last_raw () const { +Triangulation<3>::last_raw () const +{ return last_raw_hex (); }; + template <> TriaDimensionInfo<3>::raw_cell_iterator -Triangulation<3>::last_raw (const unsigned int level) const { +Triangulation<3>::last_raw (const unsigned int level) const +{ return last_raw_hex (level); }; + template <> TriaDimensionInfo<3>::cell_iterator -Triangulation<3>::last () const { +Triangulation<3>::last () const +{ return last_hex (); }; + template <> TriaDimensionInfo<3>::cell_iterator -Triangulation<3>::last (const unsigned int level) const { +Triangulation<3>::last (const unsigned int level) const +{ return last_hex (level); }; + template <> TriaDimensionInfo<3>::active_cell_iterator -Triangulation<3>::last_active () const { +Triangulation<3>::last_active () const +{ return last_active_hex (); }; + template <> TriaDimensionInfo<3>::active_cell_iterator -Triangulation<3>::last_active (const unsigned int level) const { +Triangulation<3>::last_active (const unsigned int level) const +{ return last_active_hex (level); }; + template <> TriaDimensionInfo<3>::raw_face_iterator -Triangulation<3>::begin_raw_face (const unsigned int level) const { +Triangulation<3>::begin_raw_face (const unsigned int level) const +{ return begin_raw_quad (level); }; + template <> TriaDimensionInfo<3>::face_iterator -Triangulation<3>::begin_face (const unsigned int level) const { +Triangulation<3>::begin_face (const unsigned int level) const +{ return begin_quad (level); }; + template <> TriaDimensionInfo<3>::active_face_iterator -Triangulation<3>::begin_active_face (const unsigned int level) const { +Triangulation<3>::begin_active_face (const unsigned int level) const +{ return begin_active_quad (level); }; + template <> TriaDimensionInfo<3>::raw_face_iterator -Triangulation<3>::end_face () const { +Triangulation<3>::end_face () const +{ return end_quad (); }; + template <> TriaDimensionInfo<3>::raw_face_iterator -Triangulation<3>::last_raw_face () const { +Triangulation<3>::last_raw_face () const +{ return last_raw_quad (); }; + template <> TriaDimensionInfo<3>::raw_face_iterator -Triangulation<3>::last_raw_face (const unsigned int level) const { +Triangulation<3>::last_raw_face (const unsigned int level) const +{ return last_raw_quad (level); }; + template <> TriaDimensionInfo<3>::face_iterator -Triangulation<3>::last_face () const { +Triangulation<3>::last_face () const +{ return last_quad (); }; + template <> TriaDimensionInfo<3>::face_iterator -Triangulation<3>::last_face (const unsigned int level) const { +Triangulation<3>::last_face (const unsigned int level) const +{ return last_quad (level); }; + template <> TriaDimensionInfo<3>::active_face_iterator Triangulation<3>::last_active_face () const @@ -2903,6 +3143,7 @@ Triangulation<3>::last_active_face () const }; + template <> TriaDimensionInfo<3>::active_face_iterator Triangulation<3>::last_active_face (const unsigned int level) const @@ -3908,6 +4149,7 @@ void Triangulation<1>::execute_refinement () { first_child->clear_children (); first_child->set (Line (cell->vertex_index(0), next_unused_vertex)); first_child->set_material_id (cell->material_id()); + first_child->set_subdomain_id (cell->subdomain_id()); // reset neighborship info // (refer to \Ref{TriangulationLevel<0>} @@ -3951,6 +4193,7 @@ void Triangulation<1>::execute_refinement () { second_child->set (Line (next_unused_vertex, cell->vertex_index(1))); second_child->set_neighbor (0, first_child); second_child->set_material_id (cell->material_id()); + second_child->set_subdomain_id (cell->subdomain_id()); if (cell->neighbor(1).state() != valid) second_child->set_neighbor (1, cell->neighbor(1)); else @@ -4595,6 +4838,11 @@ void Triangulation<2>::execute_refinement () { subcells[1]->set_material_id (cell->material_id()); subcells[2]->set_material_id (cell->material_id()); subcells[3]->set_material_id (cell->material_id()); + + subcells[0]->set_subdomain_id (cell->subdomain_id()); + subcells[1]->set_subdomain_id (cell->subdomain_id()); + subcells[2]->set_subdomain_id (cell->subdomain_id()); + subcells[3]->set_subdomain_id (cell->subdomain_id()); }; }; @@ -5659,6 +5907,7 @@ void Triangulation<3>::execute_refinement () new_hexes[i]->clear_children(); // inherit material properties new_hexes[i]->set_material_id (hex->material_id()); + new_hexes[i]->set_subdomain_id (hex->subdomain_id()); };