From: Guido Kanschat Date: Wed, 22 Mar 2006 20:19:31 +0000 (+0000) Subject: allow for empty flux matrix X-Git-Tag: v8.0.0~12039 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2e9e6877637773c9e335e44301d9c5dd2c0ab57;p=dealii.git allow for empty flux matrix git-svn-id: https://svn.dealii.org/trunk@12659 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 f9a9b078d5..1afc6be665 100644 --- a/deal.II/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/deal.II/source/dofs/dof_tools.cc @@ -413,7 +413,8 @@ compute_cell_row_length_matrix( { const unsigned int jblock = fe.first_block_of_base(base) + mult; if (couple_cell(iblock, jblock) != DoFTools::none || - couple_face(iblock, jblock) != DoFTools::none) + (couple_face.size(0) != 0 && + couple_face(iblock, jblock) != DoFTools::none)) { matrix(i, jblock) += increment; } @@ -440,44 +441,46 @@ compute_face_row_length_matrix( // This function will be called // once per face, at the refinement // edge from a refined cell. + + // Compute contributions due to + // numerical fluxes. + if (couple_face.size(0) != 0) + for (unsigned int base=0;base > couple_cell; - std::vector > couple_face; + std::vector > couple_cell(1); + std::vector > couple_face(1); convert_couplings_to_blocks(dofs, couplings, couple_cell); - convert_couplings_to_blocks(dofs, flux_couplings, couple_face); + if (flux_couplings.size(0) != 0) + convert_couplings_to_blocks(dofs, flux_couplings, couple_face); Table<2, unsigned int> cell_couplings; Table<2, unsigned int> neighbor_couplings; @@ -839,10 +843,11 @@ DoFTools::compute_row_length_vector( // couplings from components to // blocks, so this works for // nonprimitive elements as well. - std::vector > couple_cell; - std::vector > couple_face; + std::vector > couple_cell(1); + std::vector > couple_face(1); convert_couplings_to_blocks(dofs, couplings, couple_cell); - convert_couplings_to_blocks(dofs, flux_couplings, couple_face); + if (flux_couplings.size(0) != 0) + convert_couplings_to_blocks(dofs, flux_couplings, couple_face); Table<2, unsigned int> cell_couplings; Table<2, unsigned int> neighbor_couplings; @@ -863,10 +868,14 @@ DoFTools::compute_row_length_vector( ExcDimensionMismatch(couplings.n_rows(), fe.n_components())); Assert (couplings.n_cols()==fe.n_components(), ExcDimensionMismatch(couplings.n_cols(), fe.n_components())); - Assert (flux_couplings.n_rows()==fe.n_components(), - ExcDimensionMismatch(flux_couplings.n_rows(), fe.n_components())); - Assert (flux_couplings.n_cols()==fe.n_components(), - ExcDimensionMismatch(flux_couplings.n_cols(), fe.n_components())); + if (flux_couplings.n_rows() != 0) + Assert (flux_couplings.n_rows()==fe.n_components(), + ExcDimensionMismatch(flux_couplings.n_rows(), + fe.n_components())); + if (flux_couplings.n_rows() != 0) + Assert (flux_couplings.n_cols()==fe.n_components(), + ExcDimensionMismatch(flux_couplings.n_cols(), + fe.n_components())); cell_couplings.reinit(fe.dofs_per_cell, fe.n_blocks()); cell_indices.resize(fe.dofs_per_cell);