From: turcksin Date: Fri, 15 Mar 2013 15:32:26 +0000 (+0000) Subject: Change the steps in examples to work with types::global_dof_index. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82416dc7b64bf2acfc70d07c222dbe94cf750eb3;p=dealii-svn.git Change the steps in examples to work with types::global_dof_index. git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@28913 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-18/step-18.cc b/deal.II/examples/step-18/step-18.cc index 6785d57d13..195a1cc204 100644 --- a/deal.II/examples/step-18/step-18.cc +++ b/deal.II/examples/step-18/step-18.cc @@ -512,12 +512,12 @@ namespace Step18 // Here is a vector where each entry denotes the numbers of degrees of // freedom that are stored on the processor with that particular number: - std::vector local_dofs_per_process; + std::vector local_dofs_per_process; // Next, how many degrees of freedom the present processor stores. This // is, of course, an abbreviation to // local_dofs_per_process[this_mpi_process]. - unsigned int n_local_dofs; + types::global_dof_index n_local_dofs; // In the same direction, also cache how many cells the present processor // owns. Note that the cells that belong to a processor are not @@ -1182,7 +1182,7 @@ namespace Step18 // for each vector component and because we only want to restrict vertical // motion, it has only its last component set: FEValuesExtractors::Scalar z_component (dim-1); - std::map boundary_values; + std::map boundary_values; VectorTools:: interpolate_boundary_values (dof_handler, 0, diff --git a/deal.II/examples/step-31/step-31.cc b/deal.II/examples/step-31/step-31.cc index 7d9a55ac91..65fc00a3ec 100644 --- a/deal.II/examples/step-31/step-31.cc +++ b/deal.II/examples/step-31/step-31.cc @@ -492,7 +492,7 @@ namespace Step31 DoFHandler stokes_dof_handler; ConstraintMatrix stokes_constraints; - std::vector stokes_block_sizes; + std::vector stokes_block_sizes; TrilinosWrappers::BlockSparseMatrix stokes_matrix; TrilinosWrappers::BlockSparseMatrix stokes_preconditioner_matrix; @@ -886,7 +886,7 @@ namespace Step31 temperature_constraints.close (); } - std::vector stokes_dofs_per_block (2); + std::vector stokes_dofs_per_block (2); DoFTools::count_dofs_per_block (stokes_dof_handler, stokes_dofs_per_block, stokes_sub_blocks); @@ -1076,7 +1076,7 @@ namespace Step31 const unsigned int n_q_points = quadrature_formula.size(); FullMatrix local_matrix (dofs_per_cell, dofs_per_cell); - std::vector local_dof_indices (dofs_per_cell); + std::vector local_dof_indices (dofs_per_cell); std::vector > grad_phi_u (dofs_per_cell); std::vector phi_p (dofs_per_cell); @@ -1293,7 +1293,7 @@ namespace Step31 FullMatrix local_matrix (dofs_per_cell, dofs_per_cell); Vector local_rhs (dofs_per_cell); - std::vector local_dof_indices (dofs_per_cell); + std::vector local_dof_indices (dofs_per_cell); // Next we need a vector that will contain the values of the temperature // solution at the previous time level at the quadrature points to @@ -1459,7 +1459,7 @@ namespace Step31 FullMatrix local_mass_matrix (dofs_per_cell, dofs_per_cell); FullMatrix local_stiffness_matrix (dofs_per_cell, dofs_per_cell); - std::vector local_dof_indices (dofs_per_cell); + std::vector local_dof_indices (dofs_per_cell); std::vector phi_T (dofs_per_cell); std::vector > grad_phi_T (dofs_per_cell); @@ -1571,7 +1571,7 @@ namespace Step31 Vector local_rhs (dofs_per_cell); - std::vector local_dof_indices (dofs_per_cell); + std::vector local_dof_indices (dofs_per_cell); // Next comes the declaration of vectors to hold the old and older // solution values (as a notation for time levels n-1 and @@ -1967,9 +1967,9 @@ namespace Step31 // output as only a qualititative means to understand a solution, we // ignore this $\mathcal{O}(h)$ error. { - std::vector local_joint_dof_indices (joint_fe.dofs_per_cell); - std::vector local_stokes_dof_indices (stokes_fe.dofs_per_cell); - std::vector local_temperature_dof_indices (temperature_fe.dofs_per_cell); + std::vector local_joint_dof_indices (joint_fe.dofs_per_cell); + std::vector local_stokes_dof_indices (stokes_fe.dofs_per_cell); + std::vector local_temperature_dof_indices (temperature_fe.dofs_per_cell); typename DoFHandler::active_cell_iterator joint_cell = joint_dof_handler.begin_active(), diff --git a/deal.II/examples/step-32/step-32.cc b/deal.II/examples/step-32/step-32.cc index ba978a498d..c22c7a0e77 100644 --- a/deal.II/examples/step-32/step-32.cc +++ b/deal.II/examples/step-32/step-32.cc @@ -617,7 +617,7 @@ namespace Step32 StokesPreconditioner (const StokesPreconditioner &data); FullMatrix local_matrix; - std::vector local_dof_indices; + std::vector local_dof_indices; }; template @@ -674,7 +674,7 @@ namespace Step32 FullMatrix local_mass_matrix; FullMatrix local_stiffness_matrix; - std::vector local_dof_indices; + std::vector local_dof_indices; }; template @@ -706,7 +706,7 @@ namespace Step32 TemperatureRHS (const TemperatureRHS &data); Vector local_rhs; - std::vector local_dof_indices; + std::vector local_dof_indices; FullMatrix matrix_for_bc; }; @@ -1690,7 +1690,7 @@ namespace Step32 const unsigned int dofs_per_cell = fe_values.dofs_per_cell, n_q_points = fe_values.n_quadrature_points; - std::vector local_dof_indices (dofs_per_cell); + std::vector local_dof_indices (dofs_per_cell); Vector cell_vector (dofs_per_cell); FullMatrix matrix_for_bc (dofs_per_cell, dofs_per_cell); @@ -1945,7 +1945,7 @@ namespace Step32 temperature_dof_handler.distribute_dofs (temperature_fe); - std::vector stokes_dofs_per_block (2); + std::vector stokes_dofs_per_block (2); DoFTools::count_dofs_per_block (stokes_dof_handler, stokes_dofs_per_block, stokes_sub_blocks); @@ -3251,9 +3251,9 @@ namespace Step32 joint_solution.reinit (joint_dof_handler.locally_owned_dofs(), MPI_COMM_WORLD); { - std::vector local_joint_dof_indices (joint_fe.dofs_per_cell); - std::vector local_stokes_dof_indices (stokes_fe.dofs_per_cell); - std::vector local_temperature_dof_indices (temperature_fe.dofs_per_cell); + std::vector local_joint_dof_indices (joint_fe.dofs_per_cell); + std::vector local_stokes_dof_indices (stokes_fe.dofs_per_cell); + std::vector local_temperature_dof_indices (temperature_fe.dofs_per_cell); typename DoFHandler::active_cell_iterator joint_cell = joint_dof_handler.begin_active(), diff --git a/deal.II/examples/step-33/step-33.cc b/deal.II/examples/step-33/step-33.cc index 37c8cf9792..16967816da 100644 --- a/deal.II/examples/step-33/step-33.cc +++ b/deal.II/examples/step-33/step-33.cc @@ -1290,12 +1290,12 @@ namespace Step33 void assemble_system (); void assemble_cell_term (const FEValues &fe_v, - const std::vector &dofs); + const std::vector &dofs); void assemble_face_term (const unsigned int face_no, const FEFaceValuesBase &fe_v, const FEFaceValuesBase &fe_v_neighbor, - const std::vector &dofs, - const std::vector &dofs_neighbor, + const std::vector &dofs, + const std::vector &dofs_neighbor, const bool external_face, const unsigned int boundary_id, const double face_diameter); @@ -1430,8 +1430,8 @@ namespace Step33 { const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell; - std::vector dof_indices (dofs_per_cell); - std::vector dof_indices_neighbor (dofs_per_cell); + std::vector dof_indices (dofs_per_cell); + std::vector dof_indices_neighbor (dofs_per_cell); const UpdateFlags update_flags = update_values | update_gradients @@ -1481,7 +1481,7 @@ namespace Step33 assemble_face_term (face_no, fe_v_face, fe_v_face, dof_indices, - std::vector(), + std::vector(), true, cell->face(face_no)->boundary_indicator(), cell->face(face_no)->diameter()); @@ -1661,7 +1661,7 @@ namespace Step33 void ConservationLaw:: assemble_cell_term (const FEValues &fe_v, - const std::vector &dof_indices) + const std::vector &dof_indices) { const unsigned int dofs_per_cell = fe_v.dofs_per_cell; const unsigned int n_q_points = fe_v.n_quadrature_points; @@ -1862,8 +1862,8 @@ namespace Step33 ConservationLaw::assemble_face_term(const unsigned int face_no, const FEFaceValuesBase &fe_v, const FEFaceValuesBase &fe_v_neighbor, - const std::vector &dof_indices, - const std::vector &dof_indices_neighbor, + const std::vector &dof_indices, + const std::vector &dof_indices_neighbor, const bool external_face, const unsigned int boundary_id, const double face_diameter) diff --git a/deal.II/examples/step-36/step-36.cc b/deal.II/examples/step-36/step-36.cc index 743049b17e..6f2d8edbe6 100644 --- a/deal.II/examples/step-36/step-36.cc +++ b/deal.II/examples/step-36/step-36.cc @@ -223,7 +223,7 @@ namespace Step36 FullMatrix cell_stiffness_matrix (dofs_per_cell, dofs_per_cell); FullMatrix cell_mass_matrix (dofs_per_cell, dofs_per_cell); - std::vector local_dof_indices (dofs_per_cell); + std::vector local_dof_indices (dofs_per_cell); FunctionParser potential; potential.initialize (FunctionParser::default_variable_names (), diff --git a/deal.II/examples/step-37/step-37.cc b/deal.II/examples/step-37/step-37.cc index 59dc99a04b..df9c6816a9 100644 --- a/deal.II/examples/step-37/step-37.cc +++ b/deal.II/examples/step-37/step-37.cc @@ -627,7 +627,7 @@ namespace Step37 { data.cell_loop (&LaplaceOperator::local_apply, this, dst, src); - const std::vector & + const std::vector & constrained_dofs = data.get_constrained_dofs(); for (unsigned int i=0; i & + const std::vector & constrained_dofs = data.get_constrained_dofs(); for (unsigned int i=0; i::type dirichlet_boundary; ZeroFunction homogeneous_dirichlet_bc (1); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; - std::vector > boundary_indices(triangulation.n_levels()); + std::vector > boundary_indices(triangulation.n_levels()); MGTools::make_boundary_list (dof_handler, dirichlet_boundary, boundary_indices); for (unsigned int level=0; level::iterator bc_it = boundary_indices[level].begin(); + std::set::iterator bc_it = boundary_indices[level].begin(); for ( ; bc_it != boundary_indices[level].end(); ++bc_it) mg_constraints[level].add_line(*bc_it); @@ -875,7 +875,7 @@ namespace Step37 const unsigned int dofs_per_cell = fe.dofs_per_cell; const unsigned int n_q_points = quadrature_formula.size(); - std::vector local_dof_indices (dofs_per_cell); + std::vector local_dof_indices (dofs_per_cell); const Coefficient coefficient; std::vector coefficient_values (n_q_points); @@ -921,7 +921,7 @@ namespace Step37 const unsigned int dofs_per_cell = fe.dofs_per_cell; const unsigned int n_q_points = quadrature_formula.size(); - std::vector local_dof_indices (dofs_per_cell); + std::vector local_dof_indices (dofs_per_cell); const Coefficient coefficient; std::vector coefficient_values (n_q_points); FullMatrix local_matrix (dofs_per_cell, dofs_per_cell); diff --git a/deal.II/examples/step-40/step-40.cc b/deal.II/examples/step-40/step-40.cc index 5c2ce3bbee..b5f1b3c80d 100644 --- a/deal.II/examples/step-40/step-40.cc +++ b/deal.II/examples/step-40/step-40.cc @@ -347,7 +347,7 @@ namespace Step40 FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); Vector cell_rhs (dofs_per_cell); - std::vector local_dof_indices (dofs_per_cell); + std::vector local_dof_indices (dofs_per_cell); typename DoFHandler::active_cell_iterator cell = dof_handler.begin_active(), diff --git a/deal.II/examples/step-41/step-41.cc b/deal.II/examples/step-41/step-41.cc index 699b98c897..2bd479c3bd 100644 --- a/deal.II/examples/step-41/step-41.cc +++ b/deal.II/examples/step-41/step-41.cc @@ -293,7 +293,7 @@ namespace Step41 FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); TrilinosWrappers::Vector cell_rhs (dofs_per_cell); - std::vector local_dof_indices (dofs_per_cell); + std::vector local_dof_indices (dofs_per_cell); typename DoFHandler::active_cell_iterator cell = dof_handler.begin_active(), @@ -370,7 +370,7 @@ namespace Step41 const unsigned int n_q_points = quadrature_formula.size(); FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); - std::vector local_dof_indices (dofs_per_cell); + std::vector local_dof_indices (dofs_per_cell); typename DoFHandler::active_cell_iterator cell = dof_handler.begin_active(), diff --git a/deal.II/examples/step-42/step-42.cc b/deal.II/examples/step-42/step-42.cc index 0c1e070b28..4b8ae399b0 100644 --- a/deal.II/examples/step-42/step-42.cc +++ b/deal.II/examples/step-42/step-42.cc @@ -881,7 +881,7 @@ namespace Step42 Vector cell_rhs (dofs_per_cell); - std::vector local_dof_indices (dofs_per_cell); + std::vector local_dof_indices (dofs_per_cell); const FEValuesExtractors::Vector displacement (0); @@ -992,7 +992,7 @@ namespace Step42 for (unsigned i=0; i local_dof_indices (dofs_per_cell); + std::vector local_dof_indices (dofs_per_cell); const FEValuesExtractors::Vector displacement (0); diff --git a/deal.II/examples/step-43/step-43.cc b/deal.II/examples/step-43/step-43.cc index 4086020fd7..c1e6046961 100644 --- a/deal.II/examples/step-43/step-43.cc +++ b/deal.II/examples/step-43/step-43.cc @@ -500,10 +500,10 @@ namespace Step43 const FEValues &darcy_fe_values, const double global_max_u_F_prime, const double global_S_variation, - const std::vector &local_dof_indices); + const std::vector &local_dof_indices); void assemble_saturation_rhs_boundary_term (const FEFaceValues &saturation_fe_face_values, const FEFaceValues &darcy_fe_face_values, - const std::vector &local_dof_indices); + const std::vector &local_dof_indices); void solve (); void refine_mesh (const unsigned int min_grid_level, const unsigned int max_grid_level); @@ -709,7 +709,7 @@ namespace Step43 } - std::vector darcy_dofs_per_block (2); + std::vector darcy_dofs_per_block (2); DoFTools::count_dofs_per_block (darcy_dof_handler, darcy_dofs_per_block, darcy_block_component); const unsigned int n_u = darcy_dofs_per_block[0], n_p = darcy_dofs_per_block[1], @@ -893,7 +893,7 @@ namespace Step43 std::vector old_saturation_values (n_q_points); FullMatrix local_matrix (dofs_per_cell, dofs_per_cell); - std::vector local_dof_indices (dofs_per_cell); + std::vector local_dof_indices (dofs_per_cell); std::vector > phi_u (dofs_per_cell); std::vector > grad_phi_p (dofs_per_cell); @@ -1038,7 +1038,7 @@ namespace Step43 FullMatrix local_matrix (dofs_per_cell, dofs_per_cell); Vector local_rhs (dofs_per_cell); - std::vector local_dof_indices (dofs_per_cell); + std::vector local_dof_indices (dofs_per_cell); const PressureRightHandSide pressure_right_hand_side; const PressureBoundaryValues pressure_boundary_values; @@ -1235,7 +1235,7 @@ namespace Step43 FullMatrix local_matrix (dofs_per_cell, dofs_per_cell); Vector local_rhs (dofs_per_cell); - std::vector local_dof_indices (dofs_per_cell); + std::vector local_dof_indices (dofs_per_cell); typename DoFHandler::active_cell_iterator cell = saturation_dof_handler.begin_active(), @@ -1310,7 +1310,7 @@ namespace Step43 update_values); const unsigned int dofs_per_cell = saturation_dof_handler.get_fe().dofs_per_cell; - std::vector local_dof_indices (dofs_per_cell); + std::vector local_dof_indices (dofs_per_cell); const double global_max_u_F_prime = get_max_u_F_prime (); const std::pair global_S_range = get_extrapolated_saturation_range (); @@ -1367,7 +1367,7 @@ namespace Step43 const FEValues &darcy_fe_values, const double global_max_u_F_prime, const double global_S_variation, - const std::vector &local_dof_indices) + const std::vector &local_dof_indices) { const unsigned int dofs_per_cell = saturation_fe_values.dofs_per_cell; const unsigned int n_q_points = saturation_fe_values.n_quadrature_points; @@ -1440,7 +1440,7 @@ namespace Step43 TwoPhaseFlowProblem:: assemble_saturation_rhs_boundary_term (const FEFaceValues &saturation_fe_face_values, const FEFaceValues &darcy_fe_face_values, - const std::vector &local_dof_indices) + const std::vector &local_dof_indices) { const unsigned int dofs_per_cell = saturation_fe_face_values.dofs_per_cell; const unsigned int n_face_q_points = saturation_fe_face_values.n_quadrature_points; @@ -1771,9 +1771,9 @@ namespace Step43 Vector joint_solution (joint_dof_handler.n_dofs()); { - std::vector local_joint_dof_indices (joint_fe.dofs_per_cell); - std::vector local_darcy_dof_indices (darcy_fe.dofs_per_cell); - std::vector local_saturation_dof_indices (saturation_fe.dofs_per_cell); + std::vector local_joint_dof_indices (joint_fe.dofs_per_cell); + std::vector local_darcy_dof_indices (darcy_fe.dofs_per_cell); + std::vector local_saturation_dof_indices (saturation_fe.dofs_per_cell); typename DoFHandler::active_cell_iterator joint_cell = joint_dof_handler.begin_active(), diff --git a/deal.II/examples/step-44/step-44.cc b/deal.II/examples/step-44/step-44.cc index e1f3495346..187f6ccd55 100644 --- a/deal.II/examples/step-44/step-44.cc +++ b/deal.II/examples/step-44/step-44.cc @@ -996,10 +996,10 @@ namespace Step44 J_dof = 2 }; - std::vector dofs_per_block; - std::vector element_indices_u; - std::vector element_indices_p; - std::vector element_indices_J; + std::vector dofs_per_block; + std::vector element_indices_u; + std::vector element_indices_p; + std::vector element_indices_J; // Rules for Gauss-quadrature on both the cell and faces. The number of // quadrature points on both cells and faces is recorded. @@ -1209,7 +1209,7 @@ namespace Step44 struct Solid::PerTaskData_K { FullMatrix cell_matrix; - std::vector local_dof_indices; + std::vector local_dof_indices; PerTaskData_K(const unsigned int dofs_per_cell) : @@ -1290,7 +1290,7 @@ namespace Step44 struct Solid::PerTaskData_RHS { Vector cell_rhs; - std::vector local_dof_indices; + std::vector local_dof_indices; PerTaskData_RHS(const unsigned int dofs_per_cell) : @@ -1372,7 +1372,7 @@ namespace Step44 struct Solid::PerTaskData_SC { FullMatrix cell_matrix; - std::vector local_dof_indices; + std::vector local_dof_indices; FullMatrix k_orig; FullMatrix k_pu; @@ -1567,9 +1567,9 @@ namespace Step44 // Setup the sparsity pattern and tangent matrix tangent_matrix.clear(); { - const unsigned int n_dofs_u = dofs_per_block[u_dof]; - const unsigned int n_dofs_p = dofs_per_block[p_dof]; - const unsigned int n_dofs_J = dofs_per_block[J_dof]; + const types::global_dof_index n_dofs_u = dofs_per_block[u_dof]; + const types::global_dof_index n_dofs_p = dofs_per_block[p_dof]; + const types::global_dof_index n_dofs_J = dofs_per_block[J_dof]; BlockCompressedSimpleSparsityPattern csp(n_blocks, n_blocks); diff --git a/deal.II/examples/step-47/step-47.cc b/deal.II/examples/step-47/step-47.cc index 8d24f894f6..de57709e15 100644 --- a/deal.II/examples/step-47/step-47.cc +++ b/deal.II/examples/step-47/step-47.cc @@ -280,7 +280,7 @@ namespace Step47 FullMatrix cell_matrix; Vector cell_rhs; - std::vector local_dof_indices; + std::vector local_dof_indices; const Coefficient coefficient; std::vector coefficient_values (n_q_points); @@ -424,7 +424,7 @@ namespace Step47 } - std::map boundary_values; + std::map boundary_values; VectorTools::interpolate_boundary_values (dof_handler, 0, ZeroFunction(2),