From: bangerth Date: Thu, 23 Aug 2012 02:12:01 +0000 (+0000) Subject: Merge from mainline. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e271ac7c7990f9c9ad8ff17e37e7d86ed980e2b8;p=dealii-svn.git Merge from mainline. git-svn-id: https://svn.dealii.org/branches/branch_merge_mg_into_dof_handler@26095 0785d39b-7218-0410-832d-ea1e28bc413d --- e271ac7c7990f9c9ad8ff17e37e7d86ed980e2b8 diff --cc deal.II/include/deal.II/dofs/dof_tools.h index c0928142c4,22a9d90963..09479d5afb --- a/deal.II/include/deal.II/dofs/dof_tools.h +++ b/deal.II/include/deal.II/dofs/dof_tools.h @@@ -493,10 -493,10 +493,10 @@@ namespace DoFTool template void make_sparsity_pattern (const DH &dof, - SparsityPattern &sparsity_pattern, - const ConstraintMatrix &constraints = ConstraintMatrix(), - const bool keep_constrained_dofs = true, - const types::subdomain_id subdomain_id = types::invalid_subdomain_id); + SparsityPattern &sparsity_pattern, + const ConstraintMatrix &constraints = ConstraintMatrix(), + const bool keep_constrained_dofs = true, - const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id); ++ const types::subdomain_id subdomain_id = types::invalid_subdomain_id); /** * Locate non-zero entries for @@@ -654,11 -654,11 +654,11 @@@ template void make_sparsity_pattern (const DH &dof, - const Table<2, Coupling> &coupling, - SparsityPattern &sparsity_pattern, - const ConstraintMatrix &constraints = ConstraintMatrix(), - const bool keep_constrained_dofs = true, - const types::subdomain_id subdomain_id = types::invalid_subdomain_id); + const Table<2, Coupling> &coupling, + SparsityPattern &sparsity_pattern, + const ConstraintMatrix &constraints = ConstraintMatrix(), + const bool keep_constrained_dofs = true, - const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id); ++ const types::subdomain_id subdomain_id = types::invalid_subdomain_id); /** * @deprecated This is the old @@@ -812,10 -812,10 +812,10 @@@ template void make_flux_sparsity_pattern (const DH &dof_handler, - SparsityPattern &sparsity_pattern, - const ConstraintMatrix &constraints, - const bool keep_constrained_dofs = true, - const types::subdomain_id subdomain_id = numbers::invalid_unsigned_int); + SparsityPattern &sparsity_pattern, + const ConstraintMatrix &constraints, + const bool keep_constrained_dofs = true, - const types::subdomain_id_t subdomain_id = numbers::invalid_unsigned_int); ++ const types::subdomain_id subdomain_id = numbers::invalid_unsigned_int); /** * This function does the same as @@@ -1243,14 -1243,14 +1243,14 @@@ * extract_dofs() for one level * of a multi-grid DoF numbering. */ - template + template void extract_level_dofs (const unsigned int level, - const MGDoFHandler &dof, - const std::vector &select, - std::vector &selected_dofs, - const bool blocks = false); + const DH &dof, + const std::vector &select, + std::vector &selected_dofs, + const bool blocks = false); - + /** * Extract all degrees of freedom * which are at the boundary and @@@ -1335,44 -1335,8 +1335,44 @@@ extract_boundary_dofs (const DH &dof_handler, const std::vector &component_mask, std::vector &selected_dofs, - const std::set &boundary_indicators = std::set()); + const std::set &boundary_indicators = std::set()); + /** + * This function does the same as the previous one but it + * returns its result as an IndexSet rather than a std::vector@. + * Thus, it can also be called for DoFHandler objects that are + * defined on parallel::distributed::Triangulation objects. + * + * @note If the DoFHandler object is indeed defined on a + * parallel::distributed::Triangulation, then the @p selected_dofs + * index set will contain only those degrees of freedom on the + * boundary that belong to the locally relevant set (see + * @ref GlossLocallyRelevantDof "locally relevant DoFs"). + * + * @param dof_handler The object that describes which degrees of freedom + * live on which cell + * @param component_mask A mask denoting the vector components of the + * finite element that should be considered (see also + * @ref GlossComponentMask). + * @param selected_dofs The IndexSet object that is returned and that + * will contain the indices of degrees of freedom that are + * located on the boundary (and correspond to the selected + * vector components and boundary indicators, depending on + * the values of the @p component_mask and @p boundary_indicators + * arguments). + * @param boundary_indicators If empty, this function extracts the + * indices of the degrees of freedom for all parts of the boundary. + * If it is a non-empty list, then the function only considers + * boundary faces with the boundary indicators listed in this + * argument. + */ + template + void + extract_boundary_dofs (const DH &dof_handler, + const std::vector &component_mask, + IndexSet &selected_dofs, + const std::set &boundary_indicators = std::set()); + /** * This function does the same as the previous one but it * returns its result as an IndexSet rather than a std::vector@. @@@ -1442,9 -1406,9 +1442,9 @@@ template void extract_dofs_with_support_on_boundary (const DH &dof_handler, - const std::vector &component_mask, - std::vector &selected_dofs, - const std::set &boundary_indicators = std::set()); + const std::vector &component_mask, + std::vector &selected_dofs, - const std::set &boundary_indicators = std::set()); ++ const std::set &boundary_indicators = std::set()); /** * @name Hanging Nodes @@@ -1494,8 -1458,8 +1494,8 @@@ template void extract_subdomain_dofs (const DH &dof_handler, - const types::subdomain_id_t subdomain_id, - const types::subdomain_id subdomain_id, - std::vector &selected_dofs); ++ const types::subdomain_id subdomain_id, + std::vector &selected_dofs); /** @@@ -1625,7 -1589,7 +1625,7 @@@ template void get_subdomain_association (const DH &dof_handler, - std::vector &subdomain); - std::vector &subdomain); ++ std::vector &subdomain); /** * Count how many degrees of freedom are @@@ -1669,7 -1633,7 +1669,7 @@@ template unsigned int count_dofs_with_subdomain_association (const DH &dof_handler, - const types::subdomain_id_t subdomain); - const types::subdomain_id subdomain); ++ const types::subdomain_id subdomain); /** * Count how many degrees of freedom are @@@ -1706,8 -1670,8 +1706,8 @@@ template void count_dofs_with_subdomain_association (const DH &dof_handler, - const types::subdomain_id_t subdomain, - const types::subdomain_id subdomain, - std::vector &n_dofs_on_subdomain); ++ const types::subdomain_id subdomain, + std::vector &n_dofs_on_subdomain); /** * Return a set of indices that denotes @@@ -1748,7 -1712,8 +1748,7 @@@ template IndexSet dof_indices_with_subdomain_association (const DH &dof_handler, - const types::subdomain_id_t subdomain); - const types::subdomain_id subdomain); - ++ const types::subdomain_id subdomain); // @} /** * @name Dof indices for patches @@@ -2454,8 -2419,8 +2454,8 @@@ template void map_dof_to_boundary_indices (const DH &dof_handler, - const std::set &boundary_indicators, - const std::set &boundary_indicators, - std::vector &mapping); ++ const std::set &boundary_indicators, + std::vector &mapping); /** * Return a list of support diff --cc deal.II/include/deal.II/multigrid/mg_transfer.templates.h index bcd44fdf6e,94b82212dc..7e51e549cd --- a/deal.II/include/deal.II/multigrid/mg_transfer.templates.h +++ b/deal.II/include/deal.II/multigrid/mg_transfer.templates.h @@@ -356,16 -215,11 +356,11 @@@ MGTransferPrebuilt::memory_cons { std::size_t result = sizeof(*this); result += sizeof(unsigned int) * sizes.size(); - #ifdef DEAL_PREFER_MATRIX_EZ - std::vector > >::const_iterator m; - const std::vector > >::const_iterator end = prolongation_matrices.end(); - for (m = prolongation_matrices.begin(); m != end ; ++m) - result += *m->memory_consumption(); - #else + for (unsigned int i=0;imemory_consumption() - + prolongation_sparsities[i]->memory_consumption(); + + prolongation_sparsities[i]->memory_consumption(); - #endif + return result; } diff --cc deal.II/source/dofs/dof_handler.cc index a7d769c0df,9e466cd2d0..0311f713b5 --- a/deal.II/source/dofs/dof_handler.cc +++ b/deal.II/source/dofs/dof_handler.cc @@@ -1824,10 -1494,10 +1824,10 @@@ unsigned int DoFHandler<1>::n_boundary_ // check that only boundary // indicators 0 and 1 are allowed // in 1d - for (std::set::const_iterator i=boundary_indicators.begin(); + for (std::set::const_iterator i=boundary_indicators.begin(); i!=boundary_indicators.end(); ++i) Assert ((*i == 0) || (*i == 1), - ExcInvalidBoundaryIndicator()); + ExcInvalidBoundaryIndicator()); return boundary_indicators.size()*get_fe().dofs_per_vertex; } @@@ -1863,10 -1533,10 +1863,10 @@@ unsigned int DoFHandler<1,2>::n_boundar // check that only boundary // indicators 0 and 1 are allowed // in 1d - for (std::set::const_iterator i=boundary_indicators.begin(); + for (std::set::const_iterator i=boundary_indicators.begin(); i!=boundary_indicators.end(); ++i) Assert ((*i == 0) || (*i == 1), - ExcInvalidBoundaryIndicator()); + ExcInvalidBoundaryIndicator()); return boundary_indicators.size()*get_fe().dofs_per_vertex; } @@@ -1933,10 -1603,10 +1933,10 @@@ DoFHandler::n_boundary_do template unsigned int - DoFHandler::n_boundary_dofs (const std::set &boundary_indicators) const + DoFHandler::n_boundary_dofs (const std::set &boundary_indicators) const { Assert (boundary_indicators.find (types::internal_face_boundary_id) == boundary_indicators.end(), - ExcInvalidBoundaryIndicator()); + ExcInvalidBoundaryIndicator()); std::set boundary_dofs; diff --cc deal.II/source/dofs/dof_tools.cc index 283005dee8,e23dd691a8..8beb80b21c --- a/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/source/dofs/dof_tools.cc @@@ -57,10 -57,10 +57,10 @@@ namespace DoFTool template void make_sparsity_pattern (const DH &dof, - SparsityPattern &sparsity, - const ConstraintMatrix &constraints, - const bool keep_constrained_dofs, - const types::subdomain_id subdomain_id) + SparsityPattern &sparsity, + const ConstraintMatrix &constraints, + const bool keep_constrained_dofs, - const types::subdomain_id_t subdomain_id) ++ const types::subdomain_id subdomain_id) { const unsigned int n_dofs = dof.n_dofs(); @@@ -119,11 -119,11 +119,11 @@@ template void make_sparsity_pattern (const DH &dof, - const Table<2,Coupling> &couplings, - SparsityPattern &sparsity, - const ConstraintMatrix &constraints, - const bool keep_constrained_dofs, - const types::subdomain_id subdomain_id) + const Table<2,Coupling> &couplings, + SparsityPattern &sparsity, + const ConstraintMatrix &constraints, + const bool keep_constrained_dofs, - const types::subdomain_id_t subdomain_id) ++ const types::subdomain_id subdomain_id) { const unsigned int n_dofs = dof.n_dofs(); @@@ -518,10 -518,10 +518,10 @@@ template void make_flux_sparsity_pattern (const DH &dof, - SparsityPattern &sparsity, - const ConstraintMatrix &constraints, - const bool keep_constrained_dofs, + SparsityPattern &sparsity, + const ConstraintMatrix &constraints, + const bool keep_constrained_dofs, - const types::subdomain_id_t subdomain_id) + const types::subdomain_id subdomain_id) { const unsigned int n_dofs = dof.n_dofs(); @@@ -4071,9 -4071,9 +4071,9 @@@ template void extract_dofs_with_support_on_boundary (const DH &dof_handler, - const std::vector &component_select, - std::vector &selected_dofs, - const std::set &boundary_indicators) + const std::vector &component_select, + std::vector &selected_dofs, - const std::set &boundary_indicators) ++ const std::set &boundary_indicators) { AssertDimension (component_select.size(), n_components(dof_handler)); Assert (boundary_indicators.find (types::internal_face_boundary_id) == boundary_indicators.end(), @@@ -4306,11 -4306,11 +4306,11 @@@ template void extract_subdomain_dofs (const DH &dof_handler, - const types::subdomain_id_t subdomain_id, - const types::subdomain_id subdomain_id, - std::vector &selected_dofs) ++ const types::subdomain_id subdomain_id, + std::vector &selected_dofs) { Assert(selected_dofs.size() == dof_handler.n_dofs(), - ExcDimensionMismatch(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); @@@ -4491,7 -4491,7 +4491,7 @@@ template void get_subdomain_association (const DH &dof_handler, - std::vector &subdomain_association) - std::vector &subdomain_association) ++ std::vector &subdomain_association) { // if the Triangulation is distributed, the // only thing we can usefully ask is for @@@ -4529,14 -4529,14 +4529,14 @@@ endc = dof_handler.end(); for (; cell!=endc; ++cell) { - Assert (cell->is_artificial() == false, - ExcMessage ("You can't call this function for meshes that " - "have artificial cells.")); + Assert (cell->is_artificial() == false, + ExcMessage ("You can't call this function for meshes that " + "have artificial cells.")); - const types::subdomain_id_t subdomain_id = cell->subdomain_id(); - const types::subdomain_id subdomain_id = cell->subdomain_id(); - const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell; - local_dof_indices.resize (dofs_per_cell); - cell->get_dof_indices (local_dof_indices); ++ const types::subdomain_id subdomain_id = cell->subdomain_id(); + const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell; + local_dof_indices.resize (dofs_per_cell); + cell->get_dof_indices (local_dof_indices); // set subdomain ids. if dofs // already have their values @@@ -4572,9 -4572,9 +4572,9 @@@ template unsigned int count_dofs_with_subdomain_association (const DH &dof_handler, - const types::subdomain_id_t subdomain) - const types::subdomain_id subdomain) ++ const types::subdomain_id subdomain) { - std::vector subdomain_association (dof_handler.n_dofs()); + std::vector subdomain_association (dof_handler.n_dofs()); get_subdomain_association (dof_handler, subdomain_association); return std::count (subdomain_association.begin(), @@@ -4587,7 -4587,7 +4587,7 @@@ template IndexSet dof_indices_with_subdomain_association (const DH &dof_handler, - const types::subdomain_id_t subdomain) - const types::subdomain_id subdomain) ++ const types::subdomain_id subdomain) { // If we have a distributed::Triangulation only @@@ -4648,12 -4648,12 +4648,12 @@@ template void count_dofs_with_subdomain_association (const DH &dof_handler, - const types::subdomain_id_t subdomain, - const types::subdomain_id subdomain, - std::vector &n_dofs_on_subdomain) ++ const types::subdomain_id subdomain, + std::vector &n_dofs_on_subdomain) { Assert (n_dofs_on_subdomain.size() == dof_handler.get_fe().n_components(), - ExcDimensionMismatch (n_dofs_on_subdomain.size(), - dof_handler.get_fe().n_components())); + ExcDimensionMismatch (n_dofs_on_subdomain.size(), + dof_handler.get_fe().n_components())); std::fill (n_dofs_on_subdomain.begin(), n_dofs_on_subdomain.end(), 0); // in debug mode, make sure that there are @@@ -4875,15 -4875,15 +4875,15 @@@ #if defined(DEAL_II_USE_P4EST) && defined(DEAL_II_COMPILER_SUPPORTS_MPI) const unsigned int dim = DH::dimension; const unsigned int spacedim = DH::space_dimension; - + if (const parallel::distributed::Triangulation * tria - = (dynamic_cast*> - (&dof_handler.get_tria()))) + = (dynamic_cast*> + (&dof_handler.get_tria()))) { - std::vector local_dof_count = dofs_per_component; + std::vector local_dof_count = dofs_per_component; - MPI_Allreduce ( &local_dof_count[0], &dofs_per_component[0], n_target_components, - MPI_UNSIGNED, MPI_SUM, tria->get_communicator()); + MPI_Allreduce ( &local_dof_count[0], &dofs_per_component[0], n_target_components, + MPI_UNSIGNED, MPI_SUM, tria->get_communicator()); } #endif } @@@ -5474,10 -5474,10 +5474,10 @@@ #endif - return n_parameters_on_fine_grid; + return n_parameters_on_fine_grid; } - - + + } } @@@ -5963,9 -5963,9 +5963,9 @@@ local_dof_indices.resize(cell->get_fe().dofs_per_cell); cell->get_dof_indices(local_dof_indices); - + const std::vector > & points = - fe_values.get_quadrature_points(); + fe_values.get_quadrature_points(); for (unsigned int i = 0; i < cell->get_fe().dofs_per_cell; ++i) // insert the values into the map support_points[local_dof_indices[i]] = points[i]; diff --cc deal.II/source/dofs/dof_tools.inst.in index eac4d10faa,f1ecde11e7..8a2c627d71 --- a/deal.II/source/dofs/dof_tools.inst.in +++ b/deal.II/source/dofs/dof_tools.inst.in @@@ -604,14 -600,14 +604,14 @@@ templat unsigned int DoFTools::count_dofs_with_subdomain_association > (const hp::DoFHandler &, - const types::subdomain_id_t); + const types::subdomain_id); - + template IndexSet DoFTools::dof_indices_with_subdomain_association > (const hp::DoFHandler &, - const types::subdomain_id_t); + const types::subdomain_id); - + template void DoFTools::get_subdomain_association > diff --cc deal.II/source/multigrid/mg_tools.cc index d60d62e20a,411b60a7e0..c81d632032 --- a/deal.II/source/multigrid/mg_tools.cc +++ b/deal.II/source/multigrid/mg_tools.cc @@@ -867,9 -866,9 +867,9 @@@ namespace MGTool { const FiniteElement& fe = dof.get_fe(); const unsigned int n_comp = fe.n_components(); - + Assert ((level>=1) && (level::cell_iterator - cell = dof.begin(), - endc = dof.end(); + cell = dof.begin(), + endc = dof.end(); for (; cell!=endc; ++cell) - { - const FiniteElement &fe = cell->get_fe(); - const unsigned int level = cell->level(); - local_dofs.resize(fe.dofs_per_face); - - for (unsigned int face_no = 0; face_no < GeometryInfo::faces_per_cell; - ++face_no) - if (cell->at_boundary(face_no) == true) - { - const typename MGDoFHandler::face_iterator - face = cell->face(face_no); - const types::boundary_id bi = face->boundary_indicator(); + { + const FiniteElement &fe = cell->get_fe(); + const unsigned int level = cell->level(); + local_dofs.resize(fe.dofs_per_face); + + for (unsigned int face_no = 0; face_no < GeometryInfo::faces_per_cell; + ++face_no) + if (cell->at_boundary(face_no) == true) + { + const typename MGDoFHandler::face_iterator + face = cell->face(face_no); - const types::boundary_id_t bi = face->boundary_indicator(); ++ const types::boundary_id bi = face->boundary_indicator(); // Face is listed in // boundary map - if (function_map.find(bi) != function_map.end()) - { - face->get_mg_dof_indices(level, local_dofs); - for (unsigned int i=0;iget_mg_dof_indices(level, local_dofs); + for (unsigned int i=0;iget_fe().dofs_per_cell; ++i) - { - const std::vector &nonzero_component_array - = cell->get_fe().get_nonzero_components (i); - for (unsigned int c=0; cget_fe().is_primitive (i), - ExcMessage ("This function can only deal with requested boundary " - "values that correspond to primitive (scalar) base " - "elements")); - } - - typename MGDoFHandler::face_iterator face = cell->face(face_no); - const types::boundary_id boundary_component = face->boundary_indicator(); - if (function_map.find(boundary_component) != function_map.end()) + for (unsigned int i=0; iget_fe().dofs_per_cell; ++i) + { + const std::vector &nonzero_component_array + = cell->get_fe().get_nonzero_components (i); + for (unsigned int c=0; cget_fe().is_primitive (i), + ExcMessage ("This function can only deal with requested boundary " + "values that correspond to primitive (scalar) base " + "elements")); + } + + typename MGDoFHandler::face_iterator face = cell->face(face_no); - const types::boundary_id_t boundary_component = face->boundary_indicator(); ++ const types::boundary_id boundary_component = face->boundary_indicator(); + if (function_map.find(boundary_component) != function_map.end()) // face is of the right component - { + { // get indices, physical location and // boundary values of dofs on this // face @@@ -1644,23 -1433,23 +1644,23 @@@ std::fill (cell_dofs.begin(), cell_dofs.end(), false); for (unsigned int face_nr=0; face_nr::faces_per_cell; ++face_nr) - { - const typename DoFHandler::face_iterator face = cell->face(face_nr); - if (!face->at_boundary()) - { + { + const typename DoFHandler::face_iterator face = cell->face(face_nr); + if (!face->at_boundary()) + { //interior face - const typename MGDoFHandler::cell_iterator - neighbor = cell->neighbor(face_nr); + const typename MGDoFHandler::cell_iterator + neighbor = cell->neighbor(face_nr); - if (neighbor->level() < cell->level()) - { - for (unsigned int j=0; jlevel() < cell->level()) + { + for (unsigned int j=0; jlevel(); cell->get_mg_dof_indices (local_dof_indices); @@@ -1671,69 -1460,69 +1671,69 @@@ } -template -void -extract_non_interface_dofs (const MGDoFHandler &mg_dof_handler, - std::vector > &non_interface_dofs) -{ - Assert (non_interface_dofs.size() == mg_dof_handler.get_tria().n_levels(), - ExcDimensionMismatch (non_interface_dofs.size(), - mg_dof_handler.get_tria().n_levels())); + template + void + extract_non_interface_dofs (const MGDoFHandler &mg_dof_handler, + std::vector > &non_interface_dofs) + { + Assert (non_interface_dofs.size() == mg_dof_handler.get_tria().n_levels(), + ExcDimensionMismatch (non_interface_dofs.size(), + mg_dof_handler.get_tria().n_levels())); - const FiniteElement &fe = mg_dof_handler.get_fe(); + const FiniteElement &fe = mg_dof_handler.get_fe(); - const unsigned int dofs_per_cell = fe.dofs_per_cell; - const unsigned int dofs_per_face = fe.dofs_per_face; + const unsigned int dofs_per_cell = fe.dofs_per_cell; + const unsigned int dofs_per_face = fe.dofs_per_face; - std::vector local_dof_indices (dofs_per_cell); - std::vector cell_dofs(dofs_per_cell, false); - std::vector cell_dofs_interface(dofs_per_cell, false); + std::vector local_dof_indices (dofs_per_cell); + std::vector cell_dofs(dofs_per_cell, false); + std::vector cell_dofs_interface(dofs_per_cell, false); - typename MGDoFHandler::cell_iterator cell = mg_dof_handler.begin(), - endc = mg_dof_handler.end(); + typename MGDoFHandler::cell_iterator cell = mg_dof_handler.begin(), + endc = mg_dof_handler.end(); - for (; cell!=endc; ++cell) - { - std::fill (cell_dofs.begin(), cell_dofs.end(), false); - std::fill (cell_dofs_interface.begin(), cell_dofs_interface.end(), false); + for (; cell!=endc; ++cell) + { + std::fill (cell_dofs.begin(), cell_dofs.end(), false); + std::fill (cell_dofs_interface.begin(), cell_dofs_interface.end(), false); - + - for (unsigned int face_nr=0; face_nr::faces_per_cell; ++face_nr) - { - const typename DoFHandler::face_iterator face = cell->face(face_nr); - if (!face->at_boundary()) - { + for (unsigned int face_nr=0; face_nr::faces_per_cell; ++face_nr) + { + const typename DoFHandler::face_iterator face = cell->face(face_nr); + if (!face->at_boundary()) + { //interior face - const typename MGDoFHandler::cell_iterator - neighbor = cell->neighbor(face_nr); - - if ((neighbor->level() < cell->level())) + const typename MGDoFHandler::cell_iterator + neighbor = cell->neighbor(face_nr); + + if ((neighbor->level() < cell->level())) + { + for (unsigned int j=0; jlevel(); - cell->get_mg_dof_indices (local_dof_indices); + const unsigned int level = cell->level(); + cell->get_mg_dof_indices (local_dof_indices); - for(unsigned int i=0; i