From: Wolfgang Bangerth Date: Tue, 9 Mar 2010 15:43:54 +0000 (+0000) Subject: Minor whitespace changes. X-Git-Tag: v8.0.0~6359 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f2c9805b84dd15bcca0507fa03d3ffb6a9630a1;p=dealii.git Minor whitespace changes. git-svn-id: https://svn.dealii.org/trunk@20761 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/numerics/matrices.cc b/deal.II/deal.II/source/numerics/matrices.cc index 5b724676d0..2331b64c39 100644 --- a/deal.II/deal.II/source/numerics/matrices.cc +++ b/deal.II/deal.II/source/numerics/matrices.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -102,7 +102,7 @@ namespace internal rhs_function (rhs_function), update_flags (update_flags) {} - + Scratch (const Scratch &data) : fe_collection (data.fe_collection), @@ -120,13 +120,13 @@ namespace internal rhs_function (data.rhs_function), update_flags (data.update_flags) {} - + const ::dealii::hp::FECollection fe_collection; const ::dealii::hp::QCollection quadrature_collection; const ::dealii::hp::MappingCollection mapping_collection; - + ::dealii::hp::FEValues x_fe_values; - + std::vector coefficient_values; std::vector > coefficient_vector_values; std::vector rhs_values; @@ -147,11 +147,8 @@ namespace internal FullMatrix cell_matrix; dealii::Vector cell_rhs; }; - - - } - + template &fe_values = data.x_fe_values.get_present_fe_values (); - + const unsigned int dofs_per_cell = fe_values.dofs_per_cell, n_q_points = fe_values.n_quadrature_points; const FiniteElement &fe = fe_values.get_fe(); @@ -179,7 +176,7 @@ namespace internal copy_data.cell_matrix.reinit (dofs_per_cell, dofs_per_cell); copy_data.cell_rhs.reinit (dofs_per_cell); - + copy_data.dof_indices.resize (dofs_per_cell); cell->get_dof_indices (copy_data.dof_indices); @@ -194,7 +191,7 @@ namespace internal } else { - data.rhs_vector_values.resize (n_q_points, + data.rhs_vector_values.resize (n_q_points, dealii::Vector(n_components)); data.rhs_function->vector_value_list (fe_values.get_quadrature_points(), data.rhs_vector_values); @@ -212,7 +209,7 @@ namespace internal } else { - data.coefficient_vector_values.resize (n_q_points, + data.coefficient_vector_values.resize (n_q_points, dealii::Vector(n_components)); data.coefficient->vector_value_list (fe_values.get_quadrature_points(), data.coefficient_vector_values); @@ -245,16 +242,16 @@ namespace internal { if (data.coefficient->n_components==1) for (unsigned int point=0; pointn_components==1) for (unsigned int point=0; point &fe_values = data.x_fe_values.get_present_fe_values (); + const FEValues &fe_values = data.x_fe_values.get_present_fe_values (); const unsigned int dofs_per_cell = fe_values.dofs_per_cell, n_q_points = fe_values.n_quadrature_points; @@ -375,7 +372,7 @@ namespace internal } else { - data.rhs_vector_values.resize (n_q_points, + data.rhs_vector_values.resize (n_q_points, dealii::Vector(n_components)); data.rhs_function->vector_value_list (fe_values.get_quadrature_points(), data.rhs_vector_values); @@ -393,14 +390,14 @@ namespace internal } else { - data.coefficient_vector_values.resize (n_q_points, + data.coefficient_vector_values.resize (n_q_points, dealii::Vector(n_components)); data.coefficient->vector_value_list (fe_values.get_quadrature_points(), data.coefficient_vector_values); } } - + const std::vector & JxW = fe_values.get_JxW_values(); double add_data; for (unsigned int i=0; i * grad_phi_i = + const Tensor<1,spacedim> * grad_phi_i = &fe_values.shape_grad(i,0); // can use symmetry @@ -417,26 +414,26 @@ namespace internal (fe.system_to_component_index(j).first == component_i)) { - const Tensor<1,spacedim> * grad_phi_j = + const Tensor<1,spacedim> * grad_phi_j = & fe_values.shape_grad(j,0); add_data = 0; if (use_coefficient) { if (data.coefficient->n_components==1) for (unsigned int point=0; pointn_components==1) for (unsigned int point=0; pointn_components==1) for (unsigned int point=0; point &mappi (coefficient != 0 ? update_quadrature_points : UpdateFlags(0)), coefficient, /*rhs_function=*/0, q, mapping); - + internal::MatrixCreator::AssemblerData::CopyData copy_data; copy_data.cell_matrix.reinit (assembler_data.fe_collection.max_dofs_per_cell(), assembler_data.fe_collection.max_dofs_per_cell()); @@ -639,7 +636,7 @@ void MatrixCreator::create_mass_matrix (const Mapping &mappi copy_data.cell_matrix.reinit (assembler_data.fe_collection.max_dofs_per_cell(), assembler_data.fe_collection.max_dofs_per_cell()); copy_data.cell_rhs.reinit (assembler_data.fe_collection.max_dofs_per_cell()); - copy_data.dof_indices.resize (assembler_data.fe_collection.max_dofs_per_cell()); + copy_data.dof_indices.resize (assembler_data.fe_collection.max_dofs_per_cell()); WorkStream::run (dof.begin_active(), static_cast::active_cell_iterator>(dof.end()), @@ -691,7 +688,7 @@ void MatrixCreator::create_mass_matrix (const hp::MappingCollection::active_cell_iterator>(dof.end()), &internal::MatrixCreator::mass_assembler::active_cell_iterator>, @@ -825,14 +822,14 @@ MatrixCreator::create_boundary_mass_matrix (const Mapping &mappi { const FiniteElement &fe = dof.get_fe(); const unsigned int n_components = fe.n_components(); - + Assert (matrix.n() == dof.n_boundary_dofs(boundary_functions), ExcInternalError()); Assert (matrix.n() == matrix.m(), ExcInternalError()); Assert (matrix.n() == rhs_vector.size(), ExcInternalError()); Assert (boundary_functions.size() != 0, ExcInternalError()); Assert (dof_to_boundary_mapping.size() == dof.n_dofs(), - ExcInternalError()); + ExcInternalError()); Assert (coefficient ==0 || coefficient->n_components==1 || coefficient->n_components==n_components, ExcComponentMismatch()); @@ -845,13 +842,13 @@ MatrixCreator::create_boundary_mass_matrix (const Mapping &mappi } else AssertDimension (n_components, component_mapping.size()); - + const unsigned int n_threads = multithread_info.n_default_threads; Threads::ThreadGroup<> threads; // define starting and end point // for each thread - typedef typename DoFHandler::active_cell_iterator active_cell_iterator; + typedef typename DoFHandler::active_cell_iterator active_cell_iterator; std::vector > thread_ranges = Threads::split_range (dof.begin_active(), dof.end(), n_threads); @@ -863,7 +860,7 @@ MatrixCreator::create_boundary_mass_matrix (const Mapping &mappi typedef std_cxx1x::tuple&, const DoFHandler&, const Quadrature&> Commons; - + // then assemble in parallel typedef void (*create_boundary_mass_matrix_1_t) (Commons, @@ -877,7 +874,7 @@ MatrixCreator::create_boundary_mass_matrix (const Mapping &mappi Threads::ThreadMutex &mutex); create_boundary_mass_matrix_1_t p = &MatrixCreator::template create_boundary_mass_matrix_1; -//TODO: Use WorkStream here +//TODO: Use WorkStream here for (unsigned int thread=0; thread &mappi dof_to_boundary_mapping, coefficient, component_mapping, thread_ranges[thread], mutex); - threads.join_all (); + threads.join_all (); } @@ -933,16 +930,16 @@ create_boundary_mass_matrix_1 (std_cxx1x::tuple &, const Mapping& mapping = std_cxx1x::get<0>(commons); const DoFHandler& dof = std_cxx1x::get<1>(commons); const Quadrature& q = std_cxx1x::get<2>(commons); - + const FiniteElement &fe = dof.get_fe(); const unsigned int n_components = fe.n_components(); const unsigned int n_function_components = boundary_functions.begin()->second->n_components; const bool fe_is_system = (n_components != 1); - const bool fe_is_primitive = fe.is_primitive(); - + const bool fe_is_primitive = fe.is_primitive(); + const unsigned int dofs_per_cell = fe.dofs_per_cell, dofs_per_face = fe.dofs_per_face; - + FullMatrix cell_matrix(dofs_per_cell, dofs_per_cell); Vector cell_vector(dofs_per_cell); @@ -961,18 +958,18 @@ create_boundary_mass_matrix_1 (std_cxx1x::tuple &, Vector(n_components)); const bool coefficient_is_vector = (coefficient != 0 && coefficient->n_components != 1) ? true : false; - + std::vector rhs_values_scalar (fe_values.n_quadrature_points); std::vector > rhs_values_system (fe_values.n_quadrature_points, Vector(n_function_components)); std::vector dofs (dofs_per_cell); std::vector dofs_on_face_vector (dofs_per_face); - + // for each dof on the cell, have a // flag whether it is on the face std::vector dof_is_on_face(dofs_per_cell); - + typename DoFHandler::active_cell_iterator cell = range.first; for (; cell!=range.second; ++cell) for (unsigned int face=0; face::faces_per_cell; ++face) @@ -983,9 +980,9 @@ create_boundary_mass_matrix_1 (std_cxx1x::tuple &, { cell_matrix = 0; cell_vector = 0; - + fe_values.reinit (cell, face); - + if (fe_is_system) // FE has several components { @@ -1026,19 +1023,19 @@ create_boundary_mass_matrix_1 (std_cxx1x::tuple &, // should be projected. std::vector > normal_adjustment(fe_values.n_quadrature_points, std::vector(n_components, 1.)); - + for (unsigned int comp = 0;comp& base = fe.base_element(fe.component_to_base_index(comp).first); const unsigned int bcomp = fe.component_to_base_index(comp).second; - + if (!base.conforms(FiniteElementData::H1) && base.conforms(FiniteElementData::Hdiv)) for (unsigned int point=0; point &, { boundary_functions.find(cell->face(face)->boundary_indicator()) ->second->value_list (fe_values.get_quadrature_points(), rhs_values_scalar); - + if (coefficient != 0) coefficient->value_list (fe_values.get_quadrature_points(), coefficient_values); for (unsigned int point=0; point &, dofs[i]) != dofs_on_face_vector.end()); - + // lock the matrix Threads::ThreadMutex::ScopedLock lock (mutex); for (unsigned int i=0; i &, matrix.add(dof_to_boundary_mapping[dofs[i]], dof_to_boundary_mapping[dofs[j]], cell_matrix(i,j)); - + rhs_vector(dof_to_boundary_mapping[dofs[i]]) += cell_vector(i); } } @@ -1234,7 +1231,7 @@ MatrixCreator::create_boundary_mass_matrix (const hp::MappingCollection &fe_collection = dof.get_fe(); const unsigned int n_components = fe_collection.n_components(); - + Assert (matrix.n() == dof.n_boundary_dofs(boundary_functions), ExcInternalError()); Assert (matrix.n() == matrix.m(), ExcInternalError()); @@ -1260,7 +1257,7 @@ MatrixCreator::create_boundary_mass_matrix (const hp::MappingCollection::active_cell_iterator active_cell_iterator; + typedef typename hp::DoFHandler::active_cell_iterator active_cell_iterator; std::vector > thread_ranges = Threads::split_range (dof.begin_active(), dof.end(), n_threads); @@ -1268,11 +1265,11 @@ MatrixCreator::create_boundary_mass_matrix (const hp::MappingCollection&, const hp::DoFHandler&, const hp::QCollection&> Commons; - + // mutex to synchronise access to // the matrix Threads::ThreadMutex mutex; - + // then assemble in parallel typedef void (*create_boundary_mass_matrix_1_t) (Commons, @@ -1286,7 +1283,7 @@ MatrixCreator::create_boundary_mass_matrix (const hp::MappingCollection; -//TODO: Use WorkStream here +//TODO: Use WorkStream here for (unsigned int thread=0; thread cell_matrix(max_dofs_per_cell, max_dofs_per_cell); Vector cell_vector(max_dofs_per_cell); @@ -1378,12 +1375,12 @@ create_boundary_mass_matrix_1 (std_cxx1x::tuple &fe = cell->get_fe(); const unsigned int dofs_per_cell = fe.dofs_per_cell; const unsigned int dofs_per_face = fe.dofs_per_face; - + cell_matrix.reinit (dofs_per_cell, dofs_per_cell); cell_vector.reinit (dofs_per_cell); cell_matrix = 0; - cell_vector = 0; - + cell_vector = 0; + if (fe_is_system) // FE has several components { @@ -1392,7 +1389,7 @@ create_boundary_mass_matrix_1 (std_cxx1x::tupleface(face)->boundary_indicator()) ->second->vector_value_list (fe_values.get_quadrature_points(), rhs_values_system); - + if (coefficient != 0) { if (coefficient->n_components==1) @@ -1403,7 +1400,7 @@ create_boundary_mass_matrix_1 (std_cxx1x::tupleface(face)->boundary_indicator()) ->second->value_list (fe_values.get_quadrature_points(), rhs_values_scalar); - + if (coefficient != 0) { coefficient_values.resize (fe_values.n_quadrature_points); @@ -1484,7 +1481,7 @@ create_boundary_mass_matrix_1 (std_cxx1x::tuple max_diag_entry) max_diag_entry = std::fabs(cell_matrix(i,i)); -#endif +#endif // lock the matrix Threads::ThreadMutex::ScopedLock lock (mutex); @@ -1650,7 +1647,7 @@ create_boundary_mass_matrix_1 (std_cxx1x::tuple &m copy_data.cell_matrix.reinit (assembler_data.fe_collection.max_dofs_per_cell(), assembler_data.fe_collection.max_dofs_per_cell()); copy_data.cell_rhs.reinit (assembler_data.fe_collection.max_dofs_per_cell()); - copy_data.dof_indices.resize (assembler_data.fe_collection.max_dofs_per_cell()); + copy_data.dof_indices.resize (assembler_data.fe_collection.max_dofs_per_cell()); WorkStream::run (dof.begin_active(), static_cast::active_cell_iterator>(dof.end()), @@ -1805,7 +1802,7 @@ void MatrixCreator::create_laplace_matrix (const hp::MappingCollection::active_cell_iterator>(dof.end()), @@ -1856,7 +1853,7 @@ void MatrixCreator::create_laplace_matrix (const hp::MappingCollection::active_cell_iterator>(dof.end()), &internal::MatrixCreator::laplace_assembler::active_cell_iterator>, @@ -2227,7 +2224,7 @@ void MatrixCreator::create_boundary_mass_matrix * const a, std::vector); -#endif +#endif // #if deal_II_dimension != 1 // template