From: bangerth Date: Sat, 16 Sep 2006 12:14:20 +0000 (+0000) Subject: Change the order of indices in the {sub,}face_interpolation matrices to make it confo... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10db18bb6ebf5fd161ded3b91efc51f52b07de4c;p=dealii-svn.git Change the order of indices in the {sub,}face_interpolation matrices to make it conform to the one in the hp paper. Also makes a few things a bit simpler, though it's mostly a matter of taste. git-svn-id: https://svn.dealii.org/trunk@13912 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/fe/fe.h b/deal.II/deal.II/include/fe/fe.h index cdb37a4239..aa3efe0c05 100644 --- a/deal.II/deal.II/include/fe/fe.h +++ b/deal.II/deal.II/include/fe/fe.h @@ -952,8 +952,8 @@ class FiniteElement : public Subscriptor, * of one element to the face of * the neighboring element. * The size of the matrix is - * then @p dofs_per_face times - * source.dofs_per_face. + * then source.dofs_per_face times + * this->dofs_per_face. * * Derived elements will have to * implement this function. They @@ -978,8 +978,8 @@ class FiniteElement : public Subscriptor, * of one element to the subface of * the neighboring element. * The size of the matrix is - * then @p dofs_per_face times - * source.dofs_per_face. + * then source.dofs_per_face times + * this->dofs_per_face. * * Derived elements will have to * implement this function. They diff --git a/deal.II/deal.II/include/fe/fe_dgp.h b/deal.II/deal.II/include/fe/fe_dgp.h index 874010a29b..a8ee8f2c83 100644 --- a/deal.II/deal.II/include/fe/fe_dgp.h +++ b/deal.II/deal.II/include/fe/fe_dgp.h @@ -218,8 +218,8 @@ class FE_DGP : public FE_Poly,dim> * of one element to the face of * the neighboring element. * The size of the matrix is - * then @p dofs_per_face times - * source.dofs_per_face. + * then source.dofs_per_face times + * this->dofs_per_face. * * Derived elements will have to * implement this function. They @@ -243,8 +243,8 @@ class FE_DGP : public FE_Poly,dim> * of one element to the face of * the neighboring element. * The size of the matrix is - * then @p dofs_per_face times - * source.dofs_per_face. + * then source.dofs_per_face times + * this->dofs_per_face. * * Derived elements will have to * implement this function. They diff --git a/deal.II/deal.II/include/fe/fe_dgp_nonparametric.h b/deal.II/deal.II/include/fe/fe_dgp_nonparametric.h index 1f043d1844..b1510bf9ba 100644 --- a/deal.II/deal.II/include/fe/fe_dgp_nonparametric.h +++ b/deal.II/deal.II/include/fe/fe_dgp_nonparametric.h @@ -211,8 +211,8 @@ class FE_DGPNonparametric : public FiniteElement * of one element to the face of * the neighboring element. * The size of the matrix is - * then @p dofs_per_face times - * source.dofs_per_face. + * then source.dofs_per_face times + * this->dofs_per_face. * * Derived elements will have to * implement this function. They @@ -236,8 +236,8 @@ class FE_DGPNonparametric : public FiniteElement * of one element to the face of * the neighboring element. * The size of the matrix is - * then @p dofs_per_face times - * source.dofs_per_face. + * then source.dofs_per_face times + * this->dofs_per_face. * * Derived elements will have to * implement this function. They diff --git a/deal.II/deal.II/include/fe/fe_dgq.h b/deal.II/deal.II/include/fe/fe_dgq.h index b73f97ba45..b4498b4c33 100644 --- a/deal.II/deal.II/include/fe/fe_dgq.h +++ b/deal.II/deal.II/include/fe/fe_dgq.h @@ -128,8 +128,8 @@ class FE_DGQ : public FE_Poly,dim> * of one element to the face of * the neighboring element. * The size of the matrix is - * then @p dofs_per_face times - * source.dofs_per_face. + * then source.dofs_per_face times + * this->dofs_per_face. * * Derived elements will have to * implement this function. They @@ -153,8 +153,8 @@ class FE_DGQ : public FE_Poly,dim> * of one element to the face of * the neighboring element. * The size of the matrix is - * then @p dofs_per_face times - * source.dofs_per_face. + * then source.dofs_per_face times + * this->dofs_per_face. * * Derived elements will have to * implement this function. They diff --git a/deal.II/deal.II/include/fe/fe_q.h b/deal.II/deal.II/include/fe/fe_q.h index 31733b0a53..257749bbe0 100644 --- a/deal.II/deal.II/include/fe/fe_q.h +++ b/deal.II/deal.II/include/fe/fe_q.h @@ -280,8 +280,8 @@ class FE_Q : public FE_Poly,dim> * of one element to the face of * the neighboring element. * The size of the matrix is - * then @p dofs_per_face times - * source.dofs_per_face. + * then source.dofs_per_face times + * this->dofs_per_face. * * Derived elements will have to * implement this function. They @@ -305,8 +305,8 @@ class FE_Q : public FE_Poly,dim> * of one element to the face of * the neighboring element. * The size of the matrix is - * then @p dofs_per_face times - * source.dofs_per_face. + * then source.dofs_per_face times + * this->dofs_per_face. * * Derived elements will have to * implement this function. They diff --git a/deal.II/deal.II/include/fe/fe_system.h b/deal.II/deal.II/include/fe/fe_system.h index b9e764201b..77673d4352 100644 --- a/deal.II/deal.II/include/fe/fe_system.h +++ b/deal.II/deal.II/include/fe/fe_system.h @@ -415,8 +415,8 @@ class FESystem : public FiniteElement * of one element to the face of * the neighboring element. * The size of the matrix is - * then @p dofs_per_face times - * source.dofs_per_face. + * then source.dofs_per_face times + * this->dofs_per_face. * * Base elements of this element will * have to implement this function. They @@ -442,8 +442,8 @@ class FESystem : public FiniteElement * of one element to the subface of * the neighboring element. * The size of the matrix is - * then @p dofs_per_face times - * source.dofs_per_face. + * then source.dofs_per_face times + * this->dofs_per_face. * * Base elements of this element will * have to implement this function. They diff --git a/deal.II/deal.II/source/dofs/dof_tools.cc b/deal.II/deal.II/source/dofs/dof_tools.cc index 4b81357ae4..6953c58638 100644 --- a/deal.II/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/deal.II/source/dofs/dof_tools.cc @@ -1575,10 +1575,10 @@ namespace internal // previous steps of the hp hanging node // procedure. - Assert (face_constraints.m () == dofs_mother.size (), + Assert (face_constraints.n () == dofs_mother.size (), ExcDimensionMismatch(dofs_mother.size (), face_constraints.n())); - Assert (face_constraints.n () == dofs_child.size (), + Assert (face_constraints.m () == dofs_child.size (), ExcDimensionMismatch(dofs_child.size (), face_constraints.m())); @@ -1588,7 +1588,7 @@ namespace internal Assert (n_dofs_mother <= n_dofs_child, ExcInternalError ()); - for (unsigned int col=0; col!=n_dofs_child; ++col) + for (unsigned int row=0; row!=n_dofs_child; ++row) { bool constraint_already_satisfied = false; @@ -1598,8 +1598,8 @@ namespace internal // the corresponding global dof // indices for (unsigned int i=0; i " << face_constraints (i,col) << " * " + std::cout << " " << dofs_child[row] + << " -> " << face_constraints (row,i) << " * " << dofs_mother[i] << std::endl; #endif - constraints.add_entry (dofs_child[col], + constraints.add_entry (dofs_child[row], dofs_mother[i], - face_constraints (i,col)); + face_constraints (row,i)); } } } @@ -2241,8 +2241,8 @@ namespace internal // properties of a // finite element onto // that mesh - face_constraints.reinit (n_dofs_on_mother, - n_dofs_on_children); + face_constraints.reinit (n_dofs_on_children, + n_dofs_on_mother); cell->get_fe() .get_subface_interpolation_matrix (subface->get_fe(subface_fe_index), c, face_constraints); @@ -2473,13 +2473,13 @@ namespace internal dofs_on_mother.resize (n_dofs_on_mother); cell->face(face)->get_dof_indices (dofs_on_mother, cell->active_fe_index ()); - FullMatrix fc_mother_ipol (n_dofs_on_children, - n_dofs_on_mother); - FullMatrix fc_mother_sface (n_dofs_on_children, - n_dofs_on_mother); + FullMatrix fc_mother_ipol (n_dofs_on_mother, + n_dofs_on_children); + FullMatrix fc_mother_sface (n_dofs_on_mother, + n_dofs_on_children); dominating_fe.get_face_interpolation_matrix (cell->get_fe(), fc_mother_ipol); - fc_ipol_sface.mmult (fc_mother_sface, fc_mother_ipol); + fc_mother_ipol.mmult (fc_mother_sface, fc_ipol_sface); // Add constraints to global constraint // matrix. @@ -2522,15 +2522,15 @@ namespace internal // Now create the element // constraint for this subface. - FullMatrix fc_child_sface_ipol (n_dofs_on_children, - n_dofs_on_mother); - FullMatrix fc_child_sface_sface (n_dofs_on_children, - n_dofs_on_mother); + FullMatrix fc_child_sface_ipol (n_dofs_on_mother, + n_dofs_on_children); + FullMatrix fc_child_sface_sface (n_dofs_on_mother, + n_dofs_on_children); dominating_fe.get_subface_interpolation_matrix (subface->get_fe(subface_fe_index), c, fc_child_sface_ipol); - fc_ipol_sface.mmult (fc_child_sface_sface, fc_child_sface_ipol); + fc_child_sface_ipol.mmult (fc_child_sface_sface, fc_ipol_sface); // Add constraints to global constraint // matrix. @@ -2606,8 +2606,8 @@ namespace internal // Now create the element // constraint for this subface. - FullMatrix face_constraints (dofs_on_mother.size(), - dofs_on_children.size()); + FullMatrix face_constraints (dofs_on_children.size(), + dofs_on_mother.size()); cell->get_fe().get_face_interpolation_matrix (neighbor->get_fe (), face_constraints); diff --git a/deal.II/deal.II/source/fe/fe_dgp.cc b/deal.II/deal.II/source/fe/fe_dgp.cc index 88e9491620..9f21d1801b 100644 --- a/deal.II/deal.II/source/fe/fe_dgp.cc +++ b/deal.II/deal.II/source/fe/fe_dgp.cc @@ -111,7 +111,7 @@ get_face_interpolation_matrix (const FiniteElement &x_source_fe, ExcDimensionMismatch (interpolation_matrix.m(), 0)); Assert (interpolation_matrix.n() == 0, - ExcDimensionMismatch (interpolation_matrix.m(), + ExcDimensionMismatch (interpolation_matrix.n(), 0)); } @@ -140,7 +140,7 @@ get_subface_interpolation_matrix (const FiniteElement &x_source_fe, ExcDimensionMismatch (interpolation_matrix.m(), 0)); Assert (interpolation_matrix.n() == 0, - ExcDimensionMismatch (interpolation_matrix.m(), + ExcDimensionMismatch (interpolation_matrix.n(), 0)); } diff --git a/deal.II/deal.II/source/fe/fe_dgp_monomial.cc b/deal.II/deal.II/source/fe/fe_dgp_monomial.cc index 9495615b87..fb42e547cb 100644 --- a/deal.II/deal.II/source/fe/fe_dgp_monomial.cc +++ b/deal.II/deal.II/source/fe/fe_dgp_monomial.cc @@ -272,7 +272,7 @@ get_face_interpolation_matrix (const FiniteElement &x_source_fe, ExcDimensionMismatch (interpolation_matrix.m(), 0)); Assert (interpolation_matrix.n() == 0, - ExcDimensionMismatch (interpolation_matrix.m(), + ExcDimensionMismatch (interpolation_matrix.n(), 0)); } @@ -301,7 +301,7 @@ get_subface_interpolation_matrix (const FiniteElement &x_source_fe, ExcDimensionMismatch (interpolation_matrix.m(), 0)); Assert (interpolation_matrix.n() == 0, - ExcDimensionMismatch (interpolation_matrix.m(), + ExcDimensionMismatch (interpolation_matrix.n(), 0)); } diff --git a/deal.II/deal.II/source/fe/fe_dgp_nonparametric.cc b/deal.II/deal.II/source/fe/fe_dgp_nonparametric.cc index 3934f5f75f..402e9ca2a7 100644 --- a/deal.II/deal.II/source/fe/fe_dgp_nonparametric.cc +++ b/deal.II/deal.II/source/fe/fe_dgp_nonparametric.cc @@ -441,7 +441,7 @@ get_face_interpolation_matrix (const FiniteElement &x_source_fe, ExcDimensionMismatch (interpolation_matrix.m(), 0)); Assert (interpolation_matrix.n() == 0, - ExcDimensionMismatch (interpolation_matrix.m(), + ExcDimensionMismatch (interpolation_matrix.n(), 0)); } @@ -470,7 +470,7 @@ get_subface_interpolation_matrix (const FiniteElement &x_source_fe, ExcDimensionMismatch (interpolation_matrix.m(), 0)); Assert (interpolation_matrix.n() == 0, - ExcDimensionMismatch (interpolation_matrix.m(), + ExcDimensionMismatch (interpolation_matrix.n(), 0)); } diff --git a/deal.II/deal.II/source/fe/fe_q.cc b/deal.II/deal.II/source/fe/fe_q.cc index 0f4d12c95e..2338673e4f 100644 --- a/deal.II/deal.II/source/fe/fe_q.cc +++ b/deal.II/deal.II/source/fe/fe_q.cc @@ -364,10 +364,10 @@ get_face_interpolation_matrix (const FiniteElement &x_source_fe, typename FiniteElement:: ExcInterpolationNotImplemented()); - Assert (interpolation_matrix.m() == this->dofs_per_face, - ExcDimensionMismatch (interpolation_matrix.m(), + Assert (interpolation_matrix.n() == this->dofs_per_face, + ExcDimensionMismatch (interpolation_matrix.n(), this->dofs_per_face)); - Assert (interpolation_matrix.n() == x_source_fe.dofs_per_face, + Assert (interpolation_matrix.m() == x_source_fe.dofs_per_face, ExcDimensionMismatch (interpolation_matrix.m(), x_source_fe.dofs_per_face)); @@ -431,11 +431,11 @@ get_face_interpolation_matrix (const FiniteElement &x_source_fe, if (fabs (matrix_entry) < eps) matrix_entry = 0.0; - interpolation_matrix(j,i) = matrix_entry; + interpolation_matrix(i,j) = matrix_entry; } } - // make sure that the column sum of + // make sure that the row sum of // each of the matrices is 1 at // this point. this must be so // since the shape functions sum up @@ -445,7 +445,7 @@ get_face_interpolation_matrix (const FiniteElement &x_source_fe, double sum = 0.; for (unsigned int i=0; idofs_per_face; ++i) - sum += interpolation_matrix(i,j); + sum += interpolation_matrix(j,i); Assert (std::fabs(sum-1) < 2e-14*this->degree*(dim-1), ExcInternalError()); @@ -469,10 +469,10 @@ get_subface_interpolation_matrix (const FiniteElement &x_source_fe, typename FiniteElement:: ExcInterpolationNotImplemented()); - Assert (interpolation_matrix.m() == this->dofs_per_face, - ExcDimensionMismatch (interpolation_matrix.m(), + Assert (interpolation_matrix.n() == this->dofs_per_face, + ExcDimensionMismatch (interpolation_matrix.n(), this->dofs_per_face)); - Assert (interpolation_matrix.n() == x_source_fe.dofs_per_face, + Assert (interpolation_matrix.m() == x_source_fe.dofs_per_face, ExcDimensionMismatch (interpolation_matrix.m(), x_source_fe.dofs_per_face)); @@ -533,11 +533,11 @@ get_subface_interpolation_matrix (const FiniteElement &x_source_fe, if (fabs (matrix_entry) < eps) matrix_entry = 0.0; - interpolation_matrix(j,i) = matrix_entry; + interpolation_matrix(i,j) = matrix_entry; } } - // make sure that the column sum of + // make sure that the row sum of // each of the matrices is 1 at // this point. this must be so // since the shape functions sum up @@ -547,7 +547,7 @@ get_subface_interpolation_matrix (const FiniteElement &x_source_fe, double sum = 0.; for (unsigned int i=0; idofs_per_face; ++i) - sum += interpolation_matrix(i,j); + sum += interpolation_matrix(j,i); Assert (std::fabs(sum-1) < 2e-14*this->degree*(dim-1), ExcInternalError()); diff --git a/deal.II/deal.II/source/fe/fe_system.cc b/deal.II/deal.II/source/fe/fe_system.cc index 126de218c7..0f17d4981e 100644 --- a/deal.II/deal.II/source/fe/fe_system.cc +++ b/deal.II/deal.II/source/fe/fe_system.cc @@ -1872,10 +1872,10 @@ get_face_interpolation_matrix (const FiniteElement &x_source_fe, typename FiniteElement:: ExcInterpolationNotImplemented()); - Assert (interpolation_matrix.m() == this->dofs_per_face, - ExcDimensionMismatch (interpolation_matrix.m(), + Assert (interpolation_matrix.n() == this->dofs_per_face, + ExcDimensionMismatch (interpolation_matrix.n(), this->dofs_per_face)); - Assert (interpolation_matrix.n() == x_source_fe.dofs_per_face, + Assert (interpolation_matrix.m() == x_source_fe.dofs_per_face, ExcDimensionMismatch (interpolation_matrix.m(), x_source_fe.dofs_per_face)); @@ -1922,8 +1922,8 @@ get_face_interpolation_matrix (const FiniteElement &x_source_fe, ExcNotImplemented()); // get the interpolation from the bases - base_to_base_interpolation.reinit (base.dofs_per_face, - base_other.dofs_per_face); + base_to_base_interpolation.reinit (base_other.dofs_per_face, + base.dofs_per_face); base.get_face_interpolation_matrix (base_other, base_to_base_interpolation); @@ -1940,9 +1940,9 @@ get_face_interpolation_matrix (const FiniteElement &x_source_fe, if (fe_other_system->face_system_to_base_index(j).first == std::make_pair (base_index_other, multiplicity_other)) - interpolation_matrix(i, j) - = base_to_base_interpolation(this->face_system_to_base_index(i).second, - fe_other_system->face_system_to_base_index(j).second); + interpolation_matrix(j, i) + = base_to_base_interpolation(fe_other_system->face_system_to_base_index(j).second, + this->face_system_to_base_index(i).second); // advance to the next base element // for this and the other @@ -1999,10 +1999,10 @@ get_subface_interpolation_matrix (const FiniteElement &x_source_fe, typename FiniteElement:: ExcInterpolationNotImplemented()); - Assert (interpolation_matrix.m() == this->dofs_per_face, - ExcDimensionMismatch (interpolation_matrix.m(), + Assert (interpolation_matrix.n() == this->dofs_per_face, + ExcDimensionMismatch (interpolation_matrix.n(), this->dofs_per_face)); - Assert (interpolation_matrix.n() == x_source_fe.dofs_per_face, + Assert (interpolation_matrix.m() == x_source_fe.dofs_per_face, ExcDimensionMismatch (interpolation_matrix.m(), x_source_fe.dofs_per_face)); @@ -2049,8 +2049,8 @@ get_subface_interpolation_matrix (const FiniteElement &x_source_fe, ExcNotImplemented()); // get the interpolation from the bases - base_to_base_interpolation.reinit (base.dofs_per_face, - base_other.dofs_per_face); + base_to_base_interpolation.reinit (base_other.dofs_per_face, + base.dofs_per_face); base.get_subface_interpolation_matrix (base_other, subface, base_to_base_interpolation); @@ -2068,9 +2068,9 @@ get_subface_interpolation_matrix (const FiniteElement &x_source_fe, if (fe_other_system->face_system_to_base_index(j).first == std::make_pair (base_index_other, multiplicity_other)) - interpolation_matrix(i, j) - = base_to_base_interpolation(this->face_system_to_base_index(i).second, - fe_other_system->face_system_to_base_index(j).second); + interpolation_matrix(j, i) + = base_to_base_interpolation(fe_other_system->face_system_to_base_index(j).second, + this->face_system_to_base_index(i).second); // advance to the next base element // for this and the other