From: kainan.wang Date: Sat, 4 May 2013 05:06:10 +0000 (+0000) Subject: Make several changes in dof_tools X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e16afb92cdc771beb2cfcc695c1160250f6e6dad;p=dealii-svn.git Make several changes in dof_tools git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@29453 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/dofs/dof_tools.h b/deal.II/include/deal.II/dofs/dof_tools.h index 1aa12bb336..957f414e35 100644 --- a/deal.II/include/deal.II/dofs/dof_tools.h +++ b/deal.II/include/deal.II/dofs/dof_tools.h @@ -2568,7 +2568,7 @@ namespace DoFTools const DoFHandler &fine_grid, const unsigned int fine_component, const InterGridMap > &coarse_to_fine_grid_map, - std::vector > &transfer_representation); + std::vector > &transfer_representation); /** * Create a mapping from degree @@ -3084,7 +3084,7 @@ namespace DoFTools // previous function into the // output arg point_to_index_map.clear (); - for (unsigned int i=0; i(c))) ++n_dofs_on_subdomain[c]; @@ -4630,7 +4630,7 @@ namespace DoFTools const InterGridMap > &coarse_to_fine_grid_map, const std::vector > ¶meter_dofs, const std::vector &weight_mapping, - std::vector > &weights, + std::vector > &weights, const typename dealii::DoFHandler::active_cell_iterator &begin, const typename dealii::DoFHandler::active_cell_iterator &end) { @@ -4748,8 +4748,8 @@ namespace DoFTools // only overwrite old value if not by zero if (global_parameter_representation(i) != 0) { - const unsigned int wi = parameter_dof_indices[local_dof], - wj = weight_mapping[i]; + const types::global_dof_index wi = parameter_dof_indices[local_dof], + wj = weight_mapping[i]; weights[wi][wj] = global_parameter_representation(i); }; } @@ -4774,7 +4774,7 @@ namespace DoFTools const InterGridMap > &coarse_to_fine_grid_map, const std::vector > ¶meter_dofs, const std::vector &weight_mapping, - std::vector > &weights) + std::vector > &weights) { // simply distribute the range of cells to different threads typedef typename dealii::DoFHandler::active_cell_iterator active_cell_iterator; @@ -4791,7 +4791,7 @@ namespace DoFTools const InterGridMap > &, const std::vector > &, const std::vector &, - std::vector > &, + std::vector > &, const typename dealii::DoFHandler::active_cell_iterator &, const typename dealii::DoFHandler::active_cell_iterator &) = &compute_intergrid_weights_3; @@ -4822,7 +4822,7 @@ namespace DoFTools const dealii::DoFHandler &fine_grid, const unsigned int fine_component, const InterGridMap > &coarse_to_fine_grid_map, - std::vector > &weights, + std::vector > &weights, std::vector &weight_mapping) { // aliases to the finite elements used by the dof handlers: @@ -4830,8 +4830,8 @@ namespace DoFTools &fine_fe = fine_grid.get_fe(); // global numbers of dofs - const unsigned int n_coarse_dofs = coarse_grid.n_dofs(), - n_fine_dofs = fine_grid.n_dofs(); + const types::global_dof_index n_coarse_dofs = coarse_grid.n_dofs(), + n_fine_dofs = fine_grid.n_dofs(); // local numbers of dofs const unsigned int fine_dofs_per_cell = fine_fe.dofs_per_cell; @@ -5005,7 +5005,7 @@ namespace DoFTools for (unsigned int col=0; col > weights; + std::vector > weights; // this is this mapping. there is one entry for each dof on the fine // grid; if it is a parameter dof, then its value is the column in @@ -5069,7 +5069,7 @@ namespace DoFTools weights, weight_mapping); // global numbers of dofs - const unsigned int n_coarse_dofs = coarse_grid.n_dofs(), + const types::global_dof_index n_coarse_dofs = coarse_grid.n_dofs(), n_fine_dofs = fine_grid.n_dofs(); @@ -5094,7 +5094,7 @@ namespace DoFTools // will become an unconstrained degree of freedom, while all others // will be constrained to this dof (and possibly others) std::vector representants(n_coarse_dofs, -1); - for (unsigned int parameter_dof=0; parameter_dof 0, ExcInternalError()); // find the column where the representant is mentioned - std::map::const_iterator i = weights[parameter_dof].begin(); + std::map::const_iterator i = weights[parameter_dof].begin(); for (; i!=weights[parameter_dof].end(); ++i) if (i->second == 1) break; Assert (i!=weights[parameter_dof].end(), ExcInternalError()); - const unsigned int column = i->first; + const types::global_dof_index column = i->first; // now we know in which column of weights the representant is, // but we don't know its global index. get it using the inverse // operation of the weight_mapping - unsigned int global_dof=0; + types::global_dof_index global_dof=0; for (; global_dof(column)) break; @@ -5151,11 +5151,11 @@ namespace DoFTools const unsigned int col = weight_mapping[global_dof]; Assert (col < n_parameters_on_fine_grid, ExcInternalError()); - unsigned int first_used_row=0; + types::global_dof_index first_used_row=0; { Assert (weights.size() > 0, ExcInternalError()); - std::map::const_iterator + std::map::const_iterator col_entry = weights[0].end(); for (; first_used_row::const_iterator + const std::map::const_iterator j = weights[row].find(col); if ((j != weights[row].end()) && (j->second != 0)) constraint_line.push_back (std::pair(representants[row], @@ -5202,7 +5202,7 @@ namespace DoFTools const DoFHandler &fine_grid, const unsigned int fine_component, const InterGridMap > &coarse_to_fine_grid_map, - std::vector > &transfer_representation) + std::vector > &transfer_representation) { // store the weights with which a dof on the parameter grid contributes // to a dof on the fine grid. see the long doc below for more info @@ -5225,7 +5225,7 @@ namespace DoFTools // to save some memory and since the weights are usually (negative) // powers of 2, we choose the value type of the matrix to be @p{float} // rather than @p{double}. - std::vector > weights; + std::vector > weights; // this is this mapping. there is one entry for each dof on the fine // grid; if it is a parameter dof, then its value is the column in @@ -5246,9 +5246,9 @@ namespace DoFTools // first construct the inverse mapping of weight_mapping std::vector inverse_weight_mapping (n_global_parm_dofs, DoFHandler::invalid_dof_index); - for (unsigned int i=0; i::const_iterator j = weights[i].begin(); + std::map::const_iterator j = weights[i].begin(); for (; j!=weights[i].end(); ++j) { - const unsigned int p = inverse_weight_mapping[j->first]; + const types::global_dof_index p = inverse_weight_mapping[j->first]; Assert (psecond; @@ -5295,7 +5295,7 @@ namespace DoFTools std::vector dofs_on_face; dofs_on_face.reserve (max_dofs_per_face(dof_handler)); - unsigned int next_boundary_index = 0; + types::global_dof_index next_boundary_index = 0; // now loop over all cells and check whether their faces are at the // boundary. note that we need not take special care of single lines @@ -5343,7 +5343,7 @@ namespace DoFTools std::vector dofs_on_face; dofs_on_face.reserve (max_dofs_per_face(dof_handler)); - unsigned int next_boundary_index = 0; + types::global_dof_index next_boundary_index = 0; typename DH::active_cell_iterator cell = dof_handler.begin_active(), endc = dof_handler.end(); @@ -5434,7 +5434,7 @@ namespace DoFTools // now convert from the map to the linear vector. make sure every // entry really appeared in the map - for (unsigned int i=0; iat_boundary(face) || cell->neighbor(face)->level() != cell->level()) for (unsigned int i=0; i (const DoFHandler &, const unsigned int, const DoFHandler &, const unsigned int, const InterGridMap > &, - std::vector > &); + std::vector > &); template