From: Daniel Arndt Date: Fri, 18 Aug 2017 16:34:06 +0000 (+0200) Subject: Introduce get_finite_element and get_fe_collection X-Git-Tag: v9.0.0-rc1~1189^2~8 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e688d9030b3e4e0e69ab3799c085678834dbd851;p=dealii.git Introduce get_finite_element and get_fe_collection --- diff --git a/examples/step-12/step-12.cc b/examples/step-12/step-12.cc index bc39ef2c0e..6adbee3cd3 100644 --- a/examples/step-12/step-12.cc +++ b/examples/step-12/step-12.cc @@ -257,7 +257,7 @@ namespace Step12 // formula with number of points one higher than the polynomial degree // used. Since the quadratures for cells, boundary and interior faces can // be selected independently, we have to hand over this value three times. - const unsigned int n_gauss_points = dof_handler.get_fe().degree+1; + const unsigned int n_gauss_points = dof_handler.get_finite_element().degree+1; info_box.initialize_gauss_quadrature(n_gauss_points, n_gauss_points, n_gauss_points); diff --git a/examples/step-13/step-13.cc b/examples/step-13/step-13.cc index a80a185976..f2f07d3d9d 100644 --- a/examples/step-13/step-13.cc +++ b/examples/step-13/step-13.cc @@ -257,7 +257,7 @@ namespace Step13 // // Ideally, we would check this at the beginning of the // function, for example by a statement like Assert - // (dof_handler.get_fe().dofs_per_vertex @> 0, + // (dof_handler.get_finite_element().dofs_per_vertex @> 0, // ExcNotImplemented()), which should make it quite clear // what is going wrong when the exception is triggered. In this // case, we omit it (which is indeed bad style), but knowing diff --git a/examples/step-14/step-14.cc b/examples/step-14/step-14.cc index d98966313f..d04a6c21e5 100644 --- a/examples/step-14/step-14.cc +++ b/examples/step-14/step-14.cc @@ -219,7 +219,7 @@ namespace Step14 // ...then have some objects of which the meaning will become clear // below... QTrapez vertex_quadrature; - FEValues fe_values (dof_handler.get_fe(), + FEValues fe_values (dof_handler.get_finite_element(), vertex_quadrature, update_gradients | update_quadrature_points); std::vector > @@ -1654,12 +1654,12 @@ namespace Step14 // have abbreviations for the number of quadrature points and shape // functions... QGauss quadrature(4); - FEValues fe_values (dof_handler.get_fe(), quadrature, + FEValues fe_values (dof_handler.get_finite_element(), quadrature, update_gradients | update_quadrature_points | update_JxW_values); const unsigned int n_q_points = fe_values.n_quadrature_points; - const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = dof_handler.get_finite_element().dofs_per_cell; // ...and have two objects that are used to store the global indices of // the degrees of freedom on a cell, and the values of the gradients of diff --git a/examples/step-30/step-30.cc b/examples/step-30/step-30.cc index a4f8f113fb..cd3a020fc0 100644 --- a/examples/step-30/step-30.cc +++ b/examples/step-30/step-30.cc @@ -434,7 +434,7 @@ namespace Step30 template void DGMethod::assemble_system2 () { - const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = dof_handler.get_finite_element().dofs_per_cell; std::vector dofs (dofs_per_cell); std::vector dofs_neighbor (dofs_per_cell); diff --git a/examples/step-33/step-33.cc b/examples/step-33/step-33.cc index 3629f3cfe6..2f4fb421e8 100644 --- a/examples/step-33/step-33.cc +++ b/examples/step-33/step-33.cc @@ -469,12 +469,12 @@ namespace Step33 const Vector &solution, Vector &refinement_indicators) { - const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = dof_handler.get_finite_element().dofs_per_cell; std::vector dofs (dofs_per_cell); const QMidpoint quadrature_formula; const UpdateFlags update_flags = update_gradients; - FEValues fe_v (mapping, dof_handler.get_fe(), + FEValues fe_v (mapping, dof_handler.get_finite_element(), quadrature_formula, update_flags); std::vector > > @@ -1431,7 +1431,7 @@ namespace Step33 template void ConservationLaw::assemble_system () { - const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = dof_handler.get_finite_element().dofs_per_cell; std::vector dof_indices (dofs_per_cell); std::vector dof_indices_neighbor (dofs_per_cell); diff --git a/examples/step-39/step-39.cc b/examples/step-39/step-39.cc index f072929674..e0898fbeb5 100644 --- a/examples/step-39/step-39.cc +++ b/examples/step-39/step-39.cc @@ -759,7 +759,7 @@ namespace Step39 // This starts like before, MeshWorker::IntegrationInfoBox info_box; - const unsigned int n_gauss_points = dof_handler.get_fe().tensor_degree()+1; + const unsigned int n_gauss_points = dof_handler.get_finite_element().tensor_degree()+1; info_box.initialize_gauss_quadrature(n_gauss_points, n_gauss_points+1, n_gauss_points); // but now we need to notify the info box of the finite element function we @@ -827,7 +827,7 @@ namespace Step39 cell->set_user_index(i); MeshWorker::IntegrationInfoBox info_box; - const unsigned int n_gauss_points = dof_handler.get_fe().tensor_degree()+1; + const unsigned int n_gauss_points = dof_handler.get_finite_element().tensor_degree()+1; info_box.initialize_gauss_quadrature(n_gauss_points, n_gauss_points+1, n_gauss_points); AnyData solution_data; diff --git a/examples/step-41/step-41.cc b/examples/step-41/step-41.cc index 948caed7af..ce1fefadc9 100644 --- a/examples/step-41/step-41.cc +++ b/examples/step-41/step-41.cc @@ -482,7 +482,7 @@ namespace Step41 for (; cell!=endc; ++cell) for (unsigned int v=0; v::vertices_per_cell; ++v) { - Assert (dof_handler.get_fe().dofs_per_cell == + Assert (dof_handler.get_finite_element().dofs_per_cell == GeometryInfo::vertices_per_cell, ExcNotImplemented()); diff --git a/examples/step-43/step-43.cc b/examples/step-43/step-43.cc index e5cd6bc653..3c255ea730 100644 --- a/examples/step-43/step-43.cc +++ b/examples/step-43/step-43.cc @@ -1314,7 +1314,7 @@ namespace Step43 FEFaceValues saturation_fe_face_values_neighbor (saturation_fe, face_quadrature_formula, update_values); - const unsigned int dofs_per_cell = saturation_dof_handler.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = saturation_dof_handler.get_finite_element().dofs_per_cell; std::vector local_dof_indices (dofs_per_cell); const double global_max_u_F_prime = get_max_u_F_prime (); diff --git a/examples/step-9/step-9.cc b/examples/step-9/step-9.cc index c1bd66b9b8..cf4f8713b5 100644 --- a/examples/step-9/step-9.cc +++ b/examples/step-9/step-9.cc @@ -1037,7 +1037,7 @@ namespace Step9 end_sync_it, &GradientEstimation::template estimate_cell, std::function (), - EstimateScratchData (dof_handler.get_fe(), + EstimateScratchData (dof_handler.get_finite_element(), solution), EstimateCopyData ()); } diff --git a/include/deal.II/dofs/dof_accessor.templates.h b/include/deal.II/dofs/dof_accessor.templates.h index c1dbf5a1cb..b1a118de8d 100644 --- a/include/deal.II/dofs/dof_accessor.templates.h +++ b/include/deal.II/dofs/dof_accessor.templates.h @@ -696,7 +696,7 @@ namespace internal const unsigned int i) { return dof_handler.mg_vertex_dofs[vertex_index].get_index (level, i, - dof_handler.get_fe().dofs_per_vertex); + dof_handler.get_finite_element().dofs_per_vertex); } @@ -723,7 +723,7 @@ namespace internal types::global_dof_index index) { return dof_handler.mg_vertex_dofs[vertex_index].set_index (level, i, - dof_handler.get_fe().dofs_per_vertex, + dof_handler.get_finite_element().dofs_per_vertex, index); } @@ -1475,7 +1475,7 @@ namespace internal const unsigned int fe_index) { const FiniteElement &fe - = accessor.get_dof_handler ().get_fe ()[fe_index]; + = accessor.get_dof_handler ().get_finite_element(fe_index); std::vector::const_iterator next = dof_indices.begin (); for (unsigned int vertex = 0; vertex < GeometryInfo<2>::vertices_per_cell; ++vertex) @@ -1503,7 +1503,7 @@ namespace internal const unsigned int fe_index) { const FiniteElement &fe - = accessor.get_dof_handler ().get_fe ()[fe_index]; + = accessor.get_dof_handler ().get_finite_element(fe_index); std::vector::const_iterator next = dof_indices.begin (); for (unsigned int vertex = 0; vertex < GeometryInfo<3>::vertices_per_cell; ++vertex) @@ -1721,8 +1721,8 @@ DoFAccessor::mg_vertex_dof_index (co Assert (this->dof_handler != nullptr, ExcInvalidObject ()); Assert (vertex < GeometryInfo::vertices_per_cell, ExcIndexRange (vertex, 0, GeometryInfo::vertices_per_cell)); - Assert (i < this->dof_handler->get_fe ()[fe_index].dofs_per_vertex, - ExcIndexRange (i, 0, this->dof_handler->get_fe ()[fe_index].dofs_per_vertex)); + Assert (i < this->dof_handler->get_finite_element (fe_index).dofs_per_vertex, + ExcIndexRange (i, 0, this->dof_handler->get_finite_element (fe_index).dofs_per_vertex)); return dealii::internal::DoFAccessor::Implementation::mg_vertex_dof_index @@ -1764,8 +1764,8 @@ DoFAccessor::set_mg_vertex_dof_index Assert (this->dof_handler != nullptr, ExcInvalidObject ()); Assert (vertex < GeometryInfo::vertices_per_cell, ExcIndexRange (vertex, 0, GeometryInfo::vertices_per_cell)); - Assert (i < this->dof_handler->get_fe ()[fe_index].dofs_per_vertex, - ExcIndexRange (i, 0, this->dof_handler->get_fe ()[fe_index].dofs_per_vertex)); + Assert (i < this->dof_handler->get_finite_element (fe_index).dofs_per_vertex, + ExcIndexRange (i, 0, this->dof_handler->get_finite_element (fe_index).dofs_per_vertex)); return dealii::internal::DoFAccessor::Implementation::set_mg_vertex_dof_index @@ -1789,32 +1789,6 @@ DoFAccessor::set_mg_dof_index } -namespace internal -{ - namespace DoFAccessor - { - template - inline - const FiniteElement & - get_fe (const FiniteElement &fe, - const unsigned int) - { - return fe; - } - - - - template - inline - const FiniteElement & - get_fe (const dealii::hp::FECollection &fe, - const unsigned int index) - { - return fe[index]; - } - } -} - template inline @@ -1824,7 +1798,7 @@ DoFAccessor::get_fe (const unsigned int fe_ Assert (fe_index_is_active (fe_index) == true, ExcMessage ("This function can only be called for active fe indices")); - return dealii::internal::DoFAccessor::get_fe (this->dof_handler->get_fe(), fe_index); + return this->dof_handler->get_finite_element(fe_index); } @@ -1951,7 +1925,7 @@ namespace internal const DoFHandlerType &handler = accessor.get_dof_handler(); const FiniteElement &fe - = handler.get_fe ()[fe_index]; + = handler.get_finite_element (fe_index); std::vector::iterator next = dof_indices.begin (); for (unsigned int vertex = 0; vertex < GeometryInfo<1>::vertices_per_cell; ++vertex) @@ -1975,7 +1949,7 @@ namespace internal const DoFHandlerType &handler = accessor.get_dof_handler(); const FiniteElement &fe - = handler.get_fe ()[fe_index]; + = handler.get_finite_element (fe_index); std::vector::iterator next = dof_indices.begin (); for (unsigned int vertex = 0; vertex < GeometryInfo<2>::vertices_per_cell; ++vertex) @@ -2004,7 +1978,7 @@ namespace internal const DoFHandlerType &handler = accessor.get_dof_handler(); const FiniteElement &fe - = handler.get_fe ()[fe_index]; + = handler.get_finite_element (fe_index); std::vector::iterator next = dof_indices.begin (); for (unsigned int vertex = 0; vertex < GeometryInfo<3>::vertices_per_cell; ++vertex) @@ -2055,23 +2029,23 @@ DoFAccessor::get_dof_indices { case 1: Assert (dof_indices.size() == - (2*this->dof_handler->get_fe()[fe_index].dofs_per_vertex + - this->dof_handler->get_fe()[fe_index].dofs_per_line), + (2*this->dof_handler->get_finite_element(fe_index).dofs_per_vertex + + this->dof_handler->get_finite_element(fe_index).dofs_per_line), ExcVectorDoesNotMatch()); break; case 2: Assert (dof_indices.size() == - (4*this->dof_handler->get_fe()[fe_index].dofs_per_vertex + - 4*this->dof_handler->get_fe()[fe_index].dofs_per_line + - this->dof_handler->get_fe()[fe_index].dofs_per_quad), + (4*this->dof_handler->get_finite_element(fe_index).dofs_per_vertex + + 4*this->dof_handler->get_finite_element(fe_index).dofs_per_line + + this->dof_handler->get_finite_element(fe_index).dofs_per_quad), ExcVectorDoesNotMatch()); break; case 3: Assert (dof_indices.size() == - (8*this->dof_handler->get_fe()[fe_index].dofs_per_vertex + - 12*this->dof_handler->get_fe()[fe_index].dofs_per_line + - 6*this->dof_handler->get_fe()[fe_index].dofs_per_quad + - this->dof_handler->get_fe()[fe_index].dofs_per_hex), + (8*this->dof_handler->get_finite_element(fe_index).dofs_per_vertex + + 12*this->dof_handler->get_finite_element(fe_index).dofs_per_line + + 6*this->dof_handler->get_finite_element(fe_index).dofs_per_quad + + this->dof_handler->get_finite_element(fe_index).dofs_per_hex), ExcVectorDoesNotMatch()); break; default: @@ -2092,9 +2066,9 @@ DoFAccessor::get_dof_indices // non-active thing Assert (this->fe_index_is_active (fe_index) || - (this->dof_handler->get_fe()[fe_index].dofs_per_cell == + (this->dof_handler->get_finite_element(fe_index).dofs_per_cell == GeometryInfo::vertices_per_cell * - this->dof_handler->get_fe()[fe_index].dofs_per_vertex), + this->dof_handler->get_finite_element(fe_index).dofs_per_vertex), ExcInternalError()); // now do the actual work @@ -2117,8 +2091,8 @@ void DoFAccessor::get_mg_dof_indices case 1: { Assert (dof_indices.size () == - 2 * this->dof_handler->get_fe ()[fe_index].dofs_per_vertex + - this->dof_handler->get_fe ()[fe_index].dofs_per_line, + 2 * this->dof_handler->get_finite_element (fe_index).dofs_per_vertex + + this->dof_handler->get_finite_element (fe_index).dofs_per_line, ExcVectorDoesNotMatch ()); break; } @@ -2126,9 +2100,9 @@ void DoFAccessor::get_mg_dof_indices case 2: { Assert (dof_indices.size () == - 4 * (this->dof_handler->get_fe ()[fe_index].dofs_per_vertex + - this->dof_handler->get_fe ()[fe_index].dofs_per_line) + - this->dof_handler->get_fe ()[fe_index].dofs_per_quad, + 4 * (this->dof_handler->get_finite_element (fe_index).dofs_per_vertex + + this->dof_handler->get_finite_element (fe_index).dofs_per_line) + + this->dof_handler->get_finite_element (fe_index).dofs_per_quad, ExcVectorDoesNotMatch ()); break; } @@ -2136,10 +2110,10 @@ void DoFAccessor::get_mg_dof_indices case 3: { Assert (dof_indices.size () == - 8 * this->dof_handler->get_fe ()[fe_index].dofs_per_vertex + - 12 * this->dof_handler->get_fe ()[fe_index].dofs_per_line + - 6 * this->dof_handler->get_fe ()[fe_index].dofs_per_quad + - this->dof_handler->get_fe ()[fe_index].dofs_per_hex, + 8 * this->dof_handler->get_finite_element (fe_index).dofs_per_vertex + + 12 * this->dof_handler->get_finite_element (fe_index).dofs_per_line + + 6 * this->dof_handler->get_finite_element (fe_index).dofs_per_quad + + this->dof_handler->get_finite_element (fe_index).dofs_per_hex, ExcVectorDoesNotMatch ()); break; } @@ -2169,8 +2143,8 @@ void DoFAccessor::set_mg_dof_indices case 1: { Assert (dof_indices.size () == - 2 * this->dof_handler->get_fe ()[fe_index].dofs_per_vertex + - this->dof_handler->get_fe ()[fe_index].dofs_per_line, + 2 * this->dof_handler->get_finite_element (fe_index).dofs_per_vertex + + this->dof_handler->get_finite_element (fe_index).dofs_per_line, ExcVectorDoesNotMatch ()); break; } @@ -2178,9 +2152,9 @@ void DoFAccessor::set_mg_dof_indices case 2: { Assert (dof_indices.size () == - 4 * (this->dof_handler->get_fe ()[fe_index].dofs_per_vertex + - this->dof_handler->get_fe ()[fe_index].dofs_per_line) + - this->dof_handler->get_fe ()[fe_index].dofs_per_quad, + 4 * (this->dof_handler->get_finite_element (fe_index).dofs_per_vertex + + this->dof_handler->get_finite_element (fe_index).dofs_per_line) + + this->dof_handler->get_finite_element (fe_index).dofs_per_quad, ExcVectorDoesNotMatch ()); break; } @@ -2188,10 +2162,10 @@ void DoFAccessor::set_mg_dof_indices case 3: { Assert (dof_indices.size () == - 8 * this->dof_handler->get_fe ()[fe_index].dofs_per_vertex + - 12 * this->dof_handler->get_fe ()[fe_index].dofs_per_line + - 6 * this->dof_handler->get_fe ()[fe_index].dofs_per_quad + - this->dof_handler->get_fe ()[fe_index].dofs_per_hex, + 8 * this->dof_handler->get_finite_element (fe_index).dofs_per_vertex + + 12 * this->dof_handler->get_finite_element (fe_index).dofs_per_line + + 6 * this->dof_handler->get_finite_element (fe_index).dofs_per_quad + + this->dof_handler->get_finite_element (fe_index).dofs_per_hex, ExcVectorDoesNotMatch ()); break; } @@ -2479,7 +2453,7 @@ get_mg_dof_indices (const int, (void) fe_index; Assert (this->dof_handler != nullptr, ExcInvalidObject ()); Assert (dof_indices.size () == - this->dof_handler->get_fe ()[fe_index].dofs_per_vertex, + this->dof_handler->get_finite_element (fe_index).dofs_per_vertex, ExcVectorDoesNotMatch ()); Assert (false, ExcNotImplemented()); @@ -2565,7 +2539,7 @@ DoFAccessor<0,DoFHandlerType<1,spacedim>, level_dof_access>:: get_fe (const unsigned int fe_index) const { Assert (this->dof_handler != nullptr, ExcInvalidObject()); - return dof_handler->get_fe()[fe_index]; + return dof_handler->get_finite_element(fe_index); } @@ -2830,7 +2804,7 @@ namespace internal // (cell-local) ordering. for (unsigned int line=0; line<12; ++line) for (unsigned int d=0; ddof_index(accessor.dof_handler->get_fe(). + *next++ = accessor.line(line)->dof_index(accessor.dof_handler->get_finite_element(). adjust_line_dof_index_for_line_orientation(d, accessor.line_orientation(line))); // now copy dof numbers from the face. for @@ -2848,7 +2822,7 @@ namespace internal // face_orientation is non-standard for (unsigned int quad=0; quad<6; ++quad) for (unsigned int d=0; ddof_index(accessor.dof_handler->get_fe(). + *next++ = accessor.quad(quad)->dof_index(accessor.dof_handler->get_finite_element(). adjust_quad_dof_index_for_face_orientation(d, accessor.face_orientation(quad), accessor.face_flip(quad), @@ -3016,7 +2990,7 @@ namespace internal // (cell-local) ordering. for (unsigned int line=0; line<12; ++line) for (unsigned int d=0; dset_dof_index(accessor.dof_handler->get_fe(). + accessor.line(line)->set_dof_index(accessor.dof_handler->get_finite_element(). adjust_line_dof_index_for_line_orientation(d, accessor.line_orientation(line)), local_dof_indices[index]); @@ -3035,7 +3009,7 @@ namespace internal // face_orientation is non-standard for (unsigned int quad=0; quad<6; ++quad) for (unsigned int d=0; dset_dof_index(accessor.dof_handler->get_fe(). + accessor.quad(quad)->set_dof_index(accessor.dof_handler->get_finite_element(). adjust_quad_dof_index_for_face_orientation(d, accessor.face_orientation(quad), accessor.face_flip(quad), @@ -3737,7 +3711,7 @@ DoFCellAccessor::get_fe () const ExcMessage ("In hp::DoFHandler objects, finite elements are only associated " "with active cells. Consequently, you can not ask for the " "active finite element on cells with children.")); - return dealii::internal::DoFAccessor::get_fe (this->dof_handler->get_fe(), active_fe_index()); + return this->dof_handler->get_finite_element(active_fe_index()); } diff --git a/include/deal.II/dofs/dof_handler.h b/include/deal.II/dofs/dof_handler.h index 21e564f7e5..2d4f0aa5a2 100644 --- a/include/deal.II/dofs/dof_handler.h +++ b/include/deal.II/dofs/dof_handler.h @@ -29,6 +29,7 @@ #include #include #include +#include #include @@ -828,8 +829,24 @@ public: /** * Return a constant reference to the selected finite element object. + * + * @deprecated Use get_finite_element() instead. */ - const FiniteElement &get_fe () const; + const FiniteElement &get_fe () const DEAL_II_DEPRECATED; + + /** + * Return a constant reference to the selected finite element object. + */ + const FiniteElement & + get_finite_element (const unsigned int number=0) const; + + /** + * Return a constant reference to the set of finite element objects that + * are used by this @p DoFHandler. Since this object only contains one + * FiniteElement, only this one object is returned wrapped in a + * hp::FECollection. + */ + hp::FECollection get_fe_collection () const; /** * Return a constant reference to the triangulation underlying this object. @@ -1222,6 +1239,31 @@ DoFHandler::get_fe () const +template +inline +const FiniteElement & +DoFHandler::get_finite_element +(const unsigned int) const +{ + Assert(selected_fe!=nullptr, + ExcMessage("You are trying to access the DoFHandler's FiniteElement object before it has been initialized.")); + return *selected_fe; +} + + + +template +inline +hp::FECollection +DoFHandler::get_fe_collection () const +{ + Assert(selected_fe!=nullptr, + ExcMessage("You are trying to access the DoFHandler's FiniteElement object before it has been initialized.")); + return hp::FECollection(*selected_fe); +} + + + template inline const Triangulation & diff --git a/include/deal.II/dofs/dof_objects.h b/include/deal.II/dofs/dof_objects.h index 63cb3967d6..f9bcb55cd4 100644 --- a/include/deal.II/dofs/dof_objects.h +++ b/include/deal.II/dofs/dof_objects.h @@ -194,14 +194,14 @@ namespace internal (void)fe_index; Assert ((fe_index == dealii::DoFHandler::default_fe_index), ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); - Assert (local_index(), - ExcIndexRange (local_index, 0, dof_handler.get_fe().template n_dofs_per_object())); - Assert (obj_index * dof_handler.get_fe().template n_dofs_per_object()+local_index + Assert (local_index(), + ExcIndexRange (local_index, 0, dof_handler.get_finite_element().template n_dofs_per_object())); + Assert (obj_index * dof_handler.get_finite_element().template n_dofs_per_object()+local_index < dofs.size(), ExcInternalError()); - return dofs[obj_index * dof_handler.get_fe() + return dofs[obj_index * dof_handler.get_finite_element() .template n_dofs_per_object() + local_index]; } diff --git a/include/deal.II/dofs/dof_tools.h b/include/deal.II/dofs/dof_tools.h index db0977b880..9be785ac27 100644 --- a/include/deal.II/dofs/dof_tools.h +++ b/include/deal.II/dofs/dof_tools.h @@ -2492,7 +2492,7 @@ namespace DoFTools unsigned int max_dofs_per_cell (const DoFHandler &dh) { - return dh.get_fe().dofs_per_cell; + return dh.get_finite_element().dofs_per_cell; } @@ -2501,7 +2501,7 @@ namespace DoFTools unsigned int max_dofs_per_face (const DoFHandler &dh) { - return dh.get_fe().dofs_per_face; + return dh.get_finite_element().dofs_per_face; } @@ -2510,7 +2510,7 @@ namespace DoFTools unsigned int max_dofs_per_vertex (const DoFHandler &dh) { - return dh.get_fe().dofs_per_vertex; + return dh.get_finite_element().dofs_per_vertex; } @@ -2519,7 +2519,7 @@ namespace DoFTools unsigned int n_components (const DoFHandler &dh) { - return dh.get_fe().n_components(); + return dh.get_finite_element().n_components(); } @@ -2529,7 +2529,7 @@ namespace DoFTools bool fe_is_primitive (const DoFHandler &dh) { - return dh.get_fe().is_primitive(); + return dh.get_finite_element().is_primitive(); } @@ -2538,7 +2538,7 @@ namespace DoFTools unsigned int max_dofs_per_cell (const hp::DoFHandler &dh) { - return dh.get_fe().max_dofs_per_cell (); + return dh.get_fe_collection().max_dofs_per_cell (); } @@ -2547,7 +2547,7 @@ namespace DoFTools unsigned int max_dofs_per_face (const hp::DoFHandler &dh) { - return dh.get_fe().max_dofs_per_face (); + return dh.get_fe_collection().max_dofs_per_face (); } @@ -2556,7 +2556,7 @@ namespace DoFTools unsigned int max_dofs_per_vertex (const hp::DoFHandler &dh) { - return dh.get_fe().max_dofs_per_vertex (); + return dh.get_fe_collection().max_dofs_per_vertex (); } @@ -2565,7 +2565,7 @@ namespace DoFTools unsigned int n_components (const hp::DoFHandler &dh) { - return dh.get_fe()[0].n_components(); + return dh.get_finite_element(0).n_components(); } @@ -2574,7 +2574,7 @@ namespace DoFTools bool fe_is_primitive (const hp::DoFHandler &dh) { - return dh.get_fe()[0].is_primitive(); + return dh.get_finite_element(0).is_primitive(); } diff --git a/include/deal.II/fe/fe.h b/include/deal.II/fe/fe.h index 165d794211..8043027b9a 100644 --- a/include/deal.II/fe/fe.h +++ b/include/deal.II/fe/fe.h @@ -733,7 +733,7 @@ public: * version hp::DoFHandler, since one can then write code like this: * @code * dofs_per_cell - * = dof_handler->get_fe()[cell->active_fe_index()].dofs_per_cell; + * = dof_handler->get_finite_element()[cell->active_fe_index()].dofs_per_cell; * @endcode * * This code doesn't work in both situations without the present operator diff --git a/include/deal.II/fe/fe_tools_extrapolate.templates.h b/include/deal.II/fe/fe_tools_extrapolate.templates.h index 114e6be460..055890b591 100644 --- a/include/deal.II/fe/fe_tools_extrapolate.templates.h +++ b/include/deal.II/fe/fe_tools_extrapolate.templates.h @@ -495,7 +495,7 @@ namespace FETools if (locally_owned_children) { - const FiniteElement &fe = dealii_cell->get_dof_handler().get_fe(); + const FiniteElement &fe = dealii_cell->get_dof_handler().get_finite_element(); const unsigned int dofs_per_cell = fe.dofs_per_cell; Vector interpolated_values(dofs_per_cell); @@ -560,7 +560,7 @@ namespace FETools } else { - const FiniteElement &fe = dealii_cell->get_dof_handler().get_fe(); + const FiniteElement &fe = dealii_cell->get_dof_handler().get_finite_element(); const unsigned int dofs_per_cell = fe.dofs_per_cell; Assert (interpolated_values.size() == dofs_per_cell, @@ -668,7 +668,7 @@ namespace FETools const Vector &local_values, OutVector &u) { - const FiniteElement &fe = dealii_cell->get_dof_handler().get_fe(); + const FiniteElement &fe = dealii_cell->get_dof_handler().get_finite_element(); const unsigned int dofs_per_cell = fe.dofs_per_cell; if (!dealii_cell->has_children ()) @@ -1135,7 +1135,7 @@ namespace FETools const typename dealii::internal::p4est::types::quadrant &p4est_cell, std::vector &new_needs) { - const FiniteElement &fe = dealii_cell->get_dof_handler().get_fe(); + const FiniteElement &fe = dealii_cell->get_dof_handler().get_finite_element(); const unsigned int dofs_per_cell = fe.dofs_per_cell; CellData cell_data (dofs_per_cell); @@ -1305,7 +1305,7 @@ namespace FETools compute_all_non_local_data (dof2, u2_relevant); // exclude dofs on more refined ghosted cells - const FiniteElement &fe = dof2.get_fe(); + const FiniteElement &fe = dof2.get_finite_element(); const unsigned int dofs_per_face = fe.dofs_per_face; if (dofs_per_face > 0) { @@ -1542,7 +1542,7 @@ namespace FETools const DoFHandler &dof2, OutVector &u2) { - const unsigned int dofs_per_cell = dof2.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = dof2.get_finite_element().dofs_per_cell; Vector dof_values(dofs_per_cell); // then traverse grid bottom up @@ -1603,8 +1603,8 @@ namespace FETools const ConstraintMatrix &constraints, OutVector &u2) { - Assert(dof1.get_fe().n_components() == dof2.get_fe().n_components(), - ExcDimensionMismatch(dof1.get_fe().n_components(), dof2.get_fe().n_components())); + Assert(dof1.get_finite_element(0).n_components() == dof2.get_finite_element(0).n_components(), + ExcDimensionMismatch(dof1.get_finite_element(0).n_components(), dof2.get_finite_element(0).n_components())); Assert(&dof1.get_triangulation()==&dof2.get_triangulation(), ExcTriangulationMismatch()); Assert(u1.size()==dof1.n_dofs(), ExcDimensionMismatch(u1.size(), dof1.n_dofs())); Assert(u2.size()==dof2.n_dofs(), ExcDimensionMismatch(u2.size(), dof2.n_dofs())); diff --git a/include/deal.II/fe/fe_tools_interpolate.templates.h b/include/deal.II/fe/fe_tools_interpolate.templates.h index 449f27ffe3..9d1b1b1b53 100644 --- a/include/deal.II/fe/fe_tools_interpolate.templates.h +++ b/include/deal.II/fe/fe_tools_interpolate.templates.h @@ -259,8 +259,8 @@ namespace FETools const FiniteElement &fe2, OutVector &u1_interpolated) { - Assert(dof1.get_fe().n_components() == fe2.n_components(), - ExcDimensionMismatch(dof1.get_fe().n_components(), fe2.n_components())); + Assert(dof1.get_finite_element(0).n_components() == fe2.n_components(), + ExcDimensionMismatch(dof1.get_finite_element(0).n_components(), fe2.n_components())); Assert(u1.size() == dof1.n_dofs(), ExcDimensionMismatch(u1.size(), dof1.n_dofs())); Assert(u1_interpolated.size() == dof1.n_dofs(), @@ -454,13 +454,13 @@ namespace FETools { // For discontinuous elements without constraints take the simpler version // of the back_interpolate function. - if (dof1.get_fe().dofs_per_vertex==0 && dof2.get_fe().dofs_per_vertex==0 + if (dof1.get_finite_element().dofs_per_vertex==0 && dof2.get_finite_element().dofs_per_vertex==0 && constraints1.n_constraints()==0 && constraints2.n_constraints()==0) - back_interpolate(dof1, u1, dof2.get_fe(), u1_interpolated); + back_interpolate(dof1, u1, dof2.get_finite_element(), u1_interpolated); else { - Assert(dof1.get_fe().n_components() == dof2.get_fe().n_components(), - ExcDimensionMismatch(dof1.get_fe().n_components(), dof2.get_fe().n_components())); + Assert(dof1.get_finite_element(0).n_components() == dof2.get_finite_element(0).n_components(), + ExcDimensionMismatch(dof1.get_finite_element(0).n_components(), dof2.get_finite_element(0).n_components())); Assert(u1.size()==dof1.n_dofs(), ExcDimensionMismatch(u1.size(), dof1.n_dofs())); Assert(u1_interpolated.size()==dof1.n_dofs(), ExcDimensionMismatch(u1_interpolated.size(), dof1.n_dofs())); @@ -481,8 +481,8 @@ namespace FETools const FiniteElement &fe2, OutVector &u1_difference) { - Assert(dof1.get_fe().n_components() == fe2.n_components(), - ExcDimensionMismatch(dof1.get_fe().n_components(), fe2.n_components())); + Assert(dof1.get_finite_element(0).n_components() == fe2.n_components(), + ExcDimensionMismatch(dof1.get_finite_element(0).n_components(), fe2.n_components())); Assert(u1.size()==dof1.n_dofs(), ExcDimensionMismatch(u1.size(), dof1.n_dofs())); Assert(u1_difference.size()==dof1.n_dofs(), ExcDimensionMismatch(u1_difference.size(), dof1.n_dofs())); @@ -507,9 +507,9 @@ namespace FETools // hanging node constraints are // allowed. const bool hanging_nodes_not_allowed= - (dof1.get_fe().dofs_per_vertex != 0) || (fe2.dofs_per_vertex != 0); + (dof1.get_finite_element().dofs_per_vertex != 0) || (fe2.dofs_per_vertex != 0); - const unsigned int dofs_per_cell=dof1.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell=dof1.get_finite_element().dofs_per_cell; Vector u1_local(dofs_per_cell); Vector u1_diff_local(dofs_per_cell); @@ -518,7 +518,7 @@ namespace FETools dof1.get_triangulation().locally_owned_subdomain(); FullMatrix difference_matrix(dofs_per_cell, dofs_per_cell); - get_interpolation_difference_matrix(dof1.get_fe(), fe2, + get_interpolation_difference_matrix(dof1.get_finite_element(), fe2, difference_matrix); typename DoFHandler::active_cell_iterator cell = dof1.begin_active(), @@ -604,9 +604,9 @@ namespace FETools // without constraints take the // cheaper version of the // interpolation_difference function. - if (dof1.get_fe().dofs_per_vertex==0 && dof2.get_fe().dofs_per_vertex==0 + if (dof1.get_finite_element().dofs_per_vertex==0 && dof2.get_finite_element().dofs_per_vertex==0 && constraints1.n_constraints()==0 && constraints2.n_constraints()==0) - interpolation_difference(dof1, u1, dof2.get_fe(), u1_difference); + interpolation_difference(dof1, u1, dof2.get_finite_element(), u1_difference); else { internal::interpolation_difference(dof1, constraints1, u1, dof2, constraints2, u1_difference); @@ -622,8 +622,8 @@ namespace FETools OutVector &u2) { Assert(&dof1.get_triangulation()==&dof2.get_triangulation(), ExcTriangulationMismatch()); - Assert(dof1.get_fe().n_components() == dof2.get_fe().n_components(), - ExcDimensionMismatch(dof1.get_fe().n_components(), dof2.get_fe().n_components())); + Assert(dof1.get_finite_element(0).n_components() == dof2.get_finite_element(0).n_components(), + ExcDimensionMismatch(dof1.get_finite_element(0).n_components(), dof2.get_finite_element(0).n_components())); Assert(u1.size()==dof1.n_dofs(), ExcDimensionMismatch(u1.size(), dof1.n_dofs())); Assert(u2.size()==dof2.n_dofs(), ExcDimensionMismatch(u2.size(), dof2.n_dofs())); @@ -631,15 +631,15 @@ namespace FETools typename DoFHandler::active_cell_iterator cell2 = dof2.begin_active(); typename DoFHandler::active_cell_iterator end = dof2.end(); - const unsigned int n1 = dof1.get_fe().dofs_per_cell; - const unsigned int n2 = dof2.get_fe().dofs_per_cell; + const unsigned int n1 = dof1.get_finite_element().dofs_per_cell; + const unsigned int n2 = dof2.get_finite_element().dofs_per_cell; Vector u1_local(n1); Vector u2_local(n2); std::vector dofs(n2); FullMatrix matrix(n2,n1); - get_projection_matrix(dof1.get_fe(), dof2.get_fe(), matrix); + get_projection_matrix(dof1.get_finite_element(), dof2.get_finite_element(), matrix); u2 = 0; while (cell2 != end) diff --git a/include/deal.II/hp/dof_faces.h b/include/deal.II/hp/dof_faces.h index 587e8fb512..479a6e9bb0 100644 --- a/include/deal.II/hp/dof_faces.h +++ b/include/deal.II/hp/dof_faces.h @@ -54,7 +54,7 @@ namespace internal * documentation of the internal::DoFHandler::DoFLevel class, we can * compute the location of the first line DoF, for example, by calculating * the offset as line_index * - * dof_handler.get_fe().dofs_per_line. This of course doesn't work + * dof_handler.get_finite_element().dofs_per_line. This of course doesn't work * any more if different lines may have different numbers of degrees of * freedom associated with them. Consequently, rather than using this * simple multiplication, the dofs array has an associated array @@ -371,12 +371,12 @@ namespace internal Assert ((fe_index != dealii::hp::DoFHandler::default_fe_index), ExcMessage ("You need to specify a FE index when working " "with hp DoFHandlers")); - Assert (fe_index < dof_handler.get_fe().size(), - ExcIndexRange (fe_index, 0, dof_handler.get_fe().size())); + Assert (fe_index < dof_handler.get_fe_collection().size(), + ExcIndexRange (fe_index, 0, dof_handler.get_fe_collection().size())); Assert (local_index < - dof_handler.get_fe()[fe_index].template n_dofs_per_object(), + dof_handler.get_finite_element(fe_index).template n_dofs_per_object(), ExcIndexRange(local_index, 0, - dof_handler.get_fe()[fe_index] + dof_handler.get_finite_element(fe_index) .template n_dofs_per_object())); Assert (obj_index < dof_offsets.size(), ExcIndexRange (obj_index, 0, dof_offsets.size())); @@ -406,7 +406,7 @@ namespace internal return *(pointer + 1 + local_index); else pointer += static_cast( - dof_handler.get_fe()[*pointer] + dof_handler.get_finite_element(*pointer) .template n_dofs_per_object() + 1); } } @@ -428,12 +428,12 @@ namespace internal Assert ((fe_index != dealii::hp::DoFHandler::default_fe_index), ExcMessage ("You need to specify a FE index when working " "with hp DoFHandlers")); - Assert (fe_index < dof_handler.get_fe().size(), - ExcIndexRange (fe_index, 0, dof_handler.get_fe().size())); + Assert (fe_index < dof_handler.get_fe_collection().size(), + ExcIndexRange (fe_index, 0, dof_handler.get_fe_collection().size())); Assert (local_index < - dof_handler.get_fe()[fe_index].template n_dofs_per_object(), + dof_handler.get_finite_element(fe_index).template n_dofs_per_object(), ExcIndexRange(local_index, 0, - dof_handler.get_fe()[fe_index] + dof_handler.get_finite_element(fe_index) .template n_dofs_per_object())); Assert (obj_index < dof_offsets.size(), ExcIndexRange (obj_index, 0, dof_offsets.size())); @@ -465,7 +465,7 @@ namespace internal return; } else - pointer += dof_handler.get_fe()[*pointer] + pointer += dof_handler.get_finite_element(*pointer) .template n_dofs_per_object() + 1; } } @@ -507,7 +507,7 @@ namespace internal else { ++counter; - pointer += dof_handler.get_fe()[*pointer] + pointer += dof_handler.get_finite_element(*pointer) .template n_dofs_per_object() + 1; } } @@ -557,14 +557,14 @@ namespace internal const unsigned int fe_index = *pointer; - Assert (fe_index < dof_handler.get_fe().size(), + Assert (fe_index < dof_handler.get_fe_collection().size(), ExcInternalError()); if (counter == n) return fe_index; ++counter; - pointer += dof_handler.get_fe()[fe_index] + pointer += dof_handler.get_finite_element(fe_index) .template n_dofs_per_object() + 1; } } @@ -586,8 +586,8 @@ namespace internal Assert ((fe_index != dealii::hp::DoFHandler::default_fe_index), ExcMessage ("You need to specify a FE index when working " "with hp DoFHandlers")); - Assert (fe_index < dof_handler.get_fe().size(), - ExcIndexRange (fe_index, 0, dof_handler.get_fe().size())); + Assert (fe_index < dof_handler.get_fe_collection().size(), + ExcIndexRange (fe_index, 0, dof_handler.get_fe_collection().size())); // make sure we are on an // object for which DoFs have @@ -615,7 +615,7 @@ namespace internal return true; else pointer += static_cast( - dof_handler.get_fe()[*pointer] + dof_handler.get_finite_element(*pointer) .template n_dofs_per_object()+1); } } diff --git a/include/deal.II/hp/dof_handler.h b/include/deal.II/hp/dof_handler.h index af6ce0ab9e..c3b1d33b12 100644 --- a/include/deal.II/hp/dof_handler.h +++ b/include/deal.II/hp/dof_handler.h @@ -656,11 +656,26 @@ namespace hp const std::vector & n_locally_owned_dofs_per_processor () const; + /** + * Return a constant reference to the set of finite element objects that + * are used by this @p DoFHandler. + * + * @deprecated Use get_fe_collection() instead. + */ + const hp::FECollection &get_fe () const DEAL_II_DEPRECATED; + + /** + * Return a constant reference to the ith finite element object that is + * used by this @p DoFHandler. + */ + const FiniteElement & + get_finite_element (const unsigned int i) const; + /** * Return a constant reference to the set of finite element objects that * are used by this @p DoFHandler. */ - const hp::FECollection &get_fe () const; + const hp::FECollection &get_fe_collection () const; /** * Return a constant reference to the triangulation underlying this @@ -1071,6 +1086,33 @@ namespace hp + template + inline + const FiniteElement & + DoFHandler::get_finite_element + (const unsigned int number) const + { + Assert (finite_elements != nullptr, + ExcMessage ("No finite element collection is associated with " + "this DoFHandler")); + return (*finite_elements)[number]; + } + + + + template + inline + const hp::FECollection & + DoFHandler::get_fe_collection () const + { + Assert (finite_elements != nullptr, + ExcMessage ("No finite element collection is associated with " + "this DoFHandler")); + return *finite_elements; + } + + + template inline const Triangulation & diff --git a/include/deal.II/matrix_free/cuda_matrix_free.templates.cuh b/include/deal.II/matrix_free/cuda_matrix_free.templates.cuh index e954a2d4c5..8f0fad7b6c 100644 --- a/include/deal.II/matrix_free/cuda_matrix_free.templates.cuh +++ b/include/deal.II/matrix_free/cuda_matrix_free.templates.cuh @@ -439,7 +439,7 @@ namespace CUDAWrappers //TODO: only free if we actually need arrays of different length free(); - const FiniteElement &fe = dof_handler.get_fe(); + const FiniteElement &fe = dof_handler.get_finite_element(); fe_degree = fe.degree; //TODO this should be a templated parameter diff --git a/include/deal.II/matrix_free/matrix_free.templates.h b/include/deal.II/matrix_free/matrix_free.templates.h index e2c244f387..e0b11d4137 100644 --- a/include/deal.II/matrix_free/matrix_free.templates.h +++ b/include/deal.II/matrix_free/matrix_free.templates.h @@ -104,7 +104,7 @@ internal_reinit(const Mapping &mapping, for (unsigned int nq =0; nqget_fe()); + shape_info(no,nq,0,0).reinit(quad[nq][0], dof_handler[no]->get_finite_element()); } } @@ -177,8 +177,8 @@ internal_reinit(const Mapping &mapping, for (unsigned int i=0; iget_fe().element_multiplicity(0); - dof_info[i].dofs_per_cell.push_back(dof_handler[i]->get_fe().dofs_per_cell); + dof_info[i].n_components = dof_handler[i]->get_finite_element().element_multiplicity(0); + dof_info[i].dofs_per_cell.push_back(dof_handler[i]->get_finite_element().dofs_per_cell); dof_info[i].row_starts.resize(size_info.n_macro_cells+1); dof_info[i].row_starts.back()[2] = cell_level_index.size() % VectorizedArray::n_array_elements; @@ -227,7 +227,7 @@ internal_reinit(const Mapping &mapping, unsigned int n_fe_in_collection = 0; for (unsigned int i=0; iget_fe().size()); + dof_handler[i]->get_fe_collection().size()); unsigned int n_quad_in_collection = 0; for (unsigned int q=0; q &mapping, n_fe_in_collection, n_quad_in_collection)); for (unsigned int no=0; noget_fe().size(); ++fe_no) + for (unsigned int fe_no=0; fe_noget_fe_collection().size(); ++fe_no) for (unsigned int nq =0; nqget_fe()[fe_no]); + dof_handler[no]->get_finite_element(fe_no)); } if (additional_data.initialize_indices == true) @@ -310,10 +310,10 @@ internal_reinit(const Mapping &mapping, dummy, dummy); for (unsigned int i=0; iget_fe().size() == 1, ExcNotImplemented()); + Assert(dof_handler[i]->get_fe_collection().size() == 1, ExcNotImplemented()); dof_info[i].dimension = dim; - dof_info[i].n_components = dof_handler[i]->get_fe()[0].element_multiplicity(0); - dof_info[i].dofs_per_cell.push_back(dof_handler[i]->get_fe()[0].dofs_per_cell); + dof_info[i].n_components = dof_handler[i]->get_finite_element(0).element_multiplicity(0); + dof_info[i].dofs_per_cell.push_back(dof_handler[i]->get_finite_element(0).dofs_per_cell); dof_info[i].row_starts.resize(size_info.n_macro_cells+1); dof_info[i].row_starts.back()[2] = cell_level_index.size() % VectorizedArray::n_array_elements; @@ -520,13 +520,13 @@ void MatrixFree::initialize_indices if (dof_handlers.active_dof_handler == DoFHandlers::hp) { const hp::DoFHandler *hpdof = dof_handlers.hp_dof_handler[no]; - const hp::FECollection &fe = hpdof->get_fe(); + const hp::FECollection &fe = hpdof->get_fe_collection(); for (unsigned int f=0; fget_fe().size(); ++ind) + for (unsigned int ind=0; indget_fe_collection().size(); ++ind) dof_info[no].fe_index_conversion[ind] = std::pair(fe[ind].degree, fe[ind].dofs_per_cell); @@ -537,7 +537,7 @@ void MatrixFree::initialize_indices else { const DoFHandler *dofh =&*dof_handlers.dof_handler[no]; - fes.push_back (&dofh->get_fe()); + fes.push_back (&dofh->get_finite_element()); dof_info[no].max_fe_index = 1; dof_info[no].fe_index_conversion.resize (1); dof_info[no].fe_index_conversion[0] = @@ -641,7 +641,7 @@ void MatrixFree::initialize_indices cell_level_index[counter].first, cell_level_index[counter].second, dofh); - if (dofh->get_fe().size() > 1) + if (dofh->get_fe_collection().size() > 1) dof_info[no].cell_active_fe_index[counter] = cell_it->active_fe_index(); local_dof_indices.resize (cell_it->get_fe().dofs_per_cell); diff --git a/include/deal.II/meshworker/dof_info.h b/include/deal.II/meshworker/dof_info.h index 4c70709f5b..d017975672 100644 --- a/include/deal.II/meshworker/dof_info.h +++ b/include/deal.II/meshworker/dof_info.h @@ -290,7 +290,7 @@ namespace MeshWorker level_cell (false) { std::vector aux(1); - aux[0] = dof_handler.get_fe().dofs_per_cell; + aux[0] = dof_handler.get_finite_element().dofs_per_cell; aux_local_indices.reinit(aux); } diff --git a/include/deal.II/multigrid/mg_transfer.templates.h b/include/deal.II/multigrid/mg_transfer.templates.h index 3454f37cc7..b42408abde 100644 --- a/include/deal.II/multigrid/mg_transfer.templates.h +++ b/include/deal.II/multigrid/mg_transfer.templates.h @@ -72,7 +72,7 @@ namespace std::vector target_component, MGLevelObject > &v) { - const unsigned int n_blocks = mg_dof.get_fe().n_blocks(); + const unsigned int n_blocks = mg_dof.get_finite_element().n_blocks(); if (target_component.size()==0) { target_component.resize(n_blocks); diff --git a/include/deal.II/numerics/data_out_dof_data.templates.h b/include/deal.II/numerics/data_out_dof_data.templates.h index e68ca123d8..6f48852094 100644 --- a/include/deal.II/numerics/data_out_dof_data.templates.h +++ b/include/deal.II/numerics/data_out_dof_data.templates.h @@ -980,7 +980,7 @@ add_data_vector_internal "does not have any degrees of freedom, so it is not " "possible to output DoF data in this context.")); const std::string name = names[0]; - const unsigned int n_components = dof_handler->get_fe().n_components(); + const unsigned int n_components = dof_handler->get_finite_element(0).n_components(); deduced_names.resize (n_components); if (n_components > 1) { @@ -1016,9 +1016,9 @@ add_data_vector_internal Exceptions::DataOut::ExcInvalidVectorSize (data_vector.size(), dof_handler->n_dofs(), triangulation->n_active_cells())); - Assert (deduced_names.size() == dof_handler->get_fe().n_components(), + Assert (deduced_names.size() == dof_handler->get_finite_element(0).n_components(), Exceptions::DataOut::ExcInvalidNumberOfNames (deduced_names.size(), - dof_handler->get_fe().n_components())); + dof_handler->get_finite_element(0).n_components())); break; default: Assert (false, ExcInternalError()); @@ -1256,7 +1256,7 @@ std::vector - (this->dof_data[i]->dof_handler->get_fe())); + (this->dof_data[i]->dof_handler->get_fe_collection())); } if (this->dof_data.empty()) { diff --git a/include/deal.II/numerics/error_estimator.templates.h b/include/deal.II/numerics/error_estimator.templates.h index 6e09cfa512..b64df7e7e3 100644 --- a/include/deal.II/numerics/error_estimator.templates.h +++ b/include/deal.II/numerics/error_estimator.templates.h @@ -1104,7 +1104,7 @@ estimate (const Mapping &mapping, = subdomain_id_; #endif - const unsigned int n_components = dof_handler.get_fe().n_components(); + const unsigned int n_components = dof_handler.get_finite_element(0).n_components(); (void)n_components; // sanity checks @@ -1147,7 +1147,7 @@ estimate (const Mapping &mapping, // gathered in the following structures const hp::MappingCollection mapping_collection(mapping); const internal::ParallelData - parallel_data (dof_handler.get_fe(), + parallel_data (dof_handler.get_fe_collection(), face_quadratures, mapping_collection, (!neumann_bc.empty() || (coefficients != nullptr)), diff --git a/include/deal.II/numerics/fe_field_function.templates.h b/include/deal.II/numerics/fe_field_function.templates.h index 155c261b69..2df9a95fe8 100644 --- a/include/deal.II/numerics/fe_field_function.templates.h +++ b/include/deal.II/numerics/fe_field_function.templates.h @@ -40,7 +40,7 @@ namespace Functions const VectorType &myv, const Mapping &mymapping) : - Function(mydh.get_fe().n_components()), + Function(mydh.get_finite_element(0).n_components()), dh(&mydh, "FEFieldFunction"), data_vector(myv), mapping(mymapping), @@ -260,7 +260,7 @@ namespace Functions unsigned int ncells = compute_point_locations(points, cells, qpoints, maps); hp::MappingCollection mapping_collection (mapping); - hp::FECollection fe_collection (dh->get_fe ()); + hp::FECollection fe_collection (dh->get_fe_collection()); hp::QCollection quadrature_collection; // Create quadrature collection for (unsigned int i=0; i mapping_collection (mapping); - hp::FECollection fe_collection (dh->get_fe ()); + hp::FECollection fe_collection (dh->get_fe_collection()); hp::QCollection quadrature_collection; // Create quadrature collection for (unsigned int i=0; i mapping_collection (mapping); - hp::FECollection fe_collection (dh->get_fe ()); + hp::FECollection fe_collection (dh->get_fe_collection()); hp::QCollection quadrature_collection; // Create quadrature collection for (unsigned int i=0; i fe_collection (dof.get_fe()); + hp::FECollection fe_collection (dof.get_finite_element()); hp::QCollection q_collection (q); hp::MappingCollection mapping_collection (mapping); MatrixCreator::internal::AssemblerData::Scratch @@ -736,7 +736,7 @@ namespace MatrixCreator Assert (matrix.n() == dof.n_dofs(), ExcDimensionMismatch (matrix.n(), dof.n_dofs())); - hp::FECollection fe_collection (dof.get_fe()); + hp::FECollection fe_collection (dof.get_finite_element()); hp::QCollection q_collection (q); hp::MappingCollection mapping_collection (mapping); MatrixCreator::internal::AssemblerData::Scratch @@ -794,7 +794,7 @@ namespace MatrixCreator ExcDimensionMismatch (matrix.n(), dof.n_dofs())); MatrixCreator::internal::AssemblerData::Scratch - assembler_data (dof.get_fe(), + assembler_data (dof.get_fe_collection(), update_values | update_JxW_values | (coefficient != nullptr ? update_quadrature_points : UpdateFlags(0)), coefficient, /*rhs_function=*/nullptr, @@ -847,7 +847,7 @@ namespace MatrixCreator ExcDimensionMismatch (matrix.n(), dof.n_dofs())); MatrixCreator::internal::AssemblerData::Scratch - assembler_data (dof.get_fe(), + assembler_data (dof.get_fe_collection(), update_values | update_JxW_values | update_quadrature_points, coefficient, &rhs, @@ -1210,7 +1210,7 @@ namespace MatrixCreator return; } - const FiniteElement &fe = dof.get_fe(); + const FiniteElement &fe = dof.get_finite_element(); const unsigned int n_components = fe.n_components(); Assert (matrix.n() == dof.n_boundary_dofs (boundary_functions), @@ -1627,7 +1627,7 @@ namespace MatrixCreator return; } - const hp::FECollection &fe_collection = dof.get_fe(); + const hp::FECollection &fe_collection = dof.get_fe_collection(); const unsigned int n_components = fe_collection.n_components(); Assert (matrix.n() == dof.n_boundary_dofs (boundary_functions), @@ -1706,7 +1706,7 @@ namespace MatrixCreator Assert (matrix.n() == dof.n_dofs(), ExcDimensionMismatch (matrix.n(), dof.n_dofs())); - hp::FECollection fe_collection (dof.get_fe()); + hp::FECollection fe_collection (dof.get_finite_element()); hp::QCollection q_collection (q); hp::MappingCollection mapping_collection (mapping); MatrixCreator::internal::AssemblerData::Scratch @@ -1764,7 +1764,7 @@ namespace MatrixCreator Assert (matrix.n() == dof.n_dofs(), ExcDimensionMismatch (matrix.n(), dof.n_dofs())); - hp::FECollection fe_collection (dof.get_fe()); + hp::FECollection fe_collection (dof.get_finite_element()); hp::QCollection q_collection (q); hp::MappingCollection mapping_collection (mapping); MatrixCreator::internal::AssemblerData::Scratch @@ -1823,7 +1823,7 @@ namespace MatrixCreator ExcDimensionMismatch (matrix.n(), dof.n_dofs())); MatrixCreator::internal::AssemblerData::Scratch - assembler_data (dof.get_fe(), + assembler_data (dof.get_fe_collection(), update_gradients | update_JxW_values | (coefficient != nullptr ? update_quadrature_points : UpdateFlags(0)), coefficient, /*rhs_function=*/nullptr, @@ -1878,7 +1878,7 @@ namespace MatrixCreator ExcDimensionMismatch (matrix.n(), dof.n_dofs())); MatrixCreator::internal::AssemblerData::Scratch - assembler_data (dof.get_fe(), + assembler_data (dof.get_fe_collection(), update_gradients | update_values | update_JxW_values | update_quadrature_points, coefficient, &rhs, diff --git a/include/deal.II/numerics/vector_tools.h b/include/deal.II/numerics/vector_tools.h index 6b0ab1f95a..9886dbb8bd 100644 --- a/include/deal.II/numerics/vector_tools.h +++ b/include/deal.II/numerics/vector_tools.h @@ -925,7 +925,7 @@ namespace VectorTools VectorType &vec_result); /** - * Same as above but for n_q_points_1d = matrix_free.get_dof_handler().get_fe().degree+1. + * Same as above but for n_q_points_1d = matrix_free.get_dof_handler().get_finite_element().degree+1. */ template void project (std::shared_ptr > data, diff --git a/include/deal.II/numerics/vector_tools.templates.h b/include/deal.II/numerics/vector_tools.templates.h index fb9731be88..5321fb380e 100644 --- a/include/deal.II/numerics/vector_tools.templates.h +++ b/include/deal.II/numerics/vector_tools.templates.h @@ -94,20 +94,20 @@ namespace VectorTools const ComponentMask &component_mask) { typedef typename VectorType::value_type number; - Assert (component_mask.represents_n_components(dof.get_fe().n_components()), + Assert (component_mask.represents_n_components(dof.get_finite_element(0).n_components()), ExcMessage("The number of components in the mask has to be either " "zero or equal to the number of components in the finite " "element.") ); Assert (vec.size() == dof.n_dofs(), ExcDimensionMismatch (vec.size(), dof.n_dofs())); - Assert (dof.get_fe().n_components() == function.n_components, - ExcDimensionMismatch(dof.get_fe().n_components(), + Assert (dof.get_finite_element(0).n_components() == function.n_components, + ExcDimensionMismatch(dof.get_finite_element(0).n_components(), function.n_components)); - Assert (component_mask.n_selected_components(dof.get_fe().n_components()) > 0, + Assert (component_mask.n_selected_components(dof.get_finite_element(0).n_components()) > 0, ComponentMask::ExcNoComponentSelected()); - const hp::FECollection fe (dof.get_fe()); + const hp::FECollection fe (dof.get_fe_collection()); const unsigned int n_components = fe.n_components(); const bool fe_is_system = (n_components != 1); @@ -320,11 +320,11 @@ namespace VectorTools OutVector &data_2) { typedef typename OutVector::value_type number; - Vector cell_data_1(dof_1.get_fe().dofs_per_cell); - Vector cell_data_2(dof_2.get_fe().dofs_per_cell); + Vector cell_data_1(dof_1.get_finite_element().dofs_per_cell); + Vector cell_data_2(dof_2.get_finite_element().dofs_per_cell); std::vector touch_count (dof_2.n_dofs(), 0); //TODO: check on datatype... kinda strange (UK) - std::vector local_dof_indices (dof_2.get_fe().dofs_per_cell); + std::vector local_dof_indices (dof_2.get_finite_element().dofs_per_cell); typename DoFHandler::active_cell_iterator h = dof_1.begin_active(); typename DoFHandler::active_cell_iterator l = dof_2.begin_active(); @@ -338,7 +338,7 @@ namespace VectorTools l->get_dof_indices (local_dof_indices); // distribute cell vector - for (unsigned int j=0; j::add(cell_data_2(j), local_dof_indices[j], data_2); @@ -381,7 +381,7 @@ namespace VectorTools { typedef typename VectorType::value_type number; - Assert( component_mask.represents_n_components(dof.get_fe().n_components()), + Assert( component_mask.represents_n_components(dof.get_finite_element(0).n_components()), ExcMessage("The number of components in the mask has to be either " "zero or equal to the number of components in the finite " "element.") ); @@ -399,12 +399,12 @@ namespace VectorTools iter != function_map.end(); ++iter ) { - Assert( dof.get_fe().n_components() == iter->second->n_components, - ExcDimensionMismatch(dof.get_fe().n_components(), iter->second->n_components) ); + Assert( dof.get_finite_element(0).n_components() == iter->second->n_components, + ExcDimensionMismatch(dof.get_finite_element(0).n_components(), iter->second->n_components) ); } const hp::FECollection - fe(dof.get_fe()); + fe(dof.get_fe_collection()); const unsigned int n_components = fe.n_components(); const bool fe_is_system = (n_components != 1); @@ -840,8 +840,8 @@ namespace VectorTools const bool project_to_boundary_first) { typedef typename VectorType::value_type number; - Assert (dof.get_fe().n_components() == function.n_components, - ExcDimensionMismatch(dof.get_fe().n_components(), + Assert (dof.get_finite_element(0).n_components() == function.n_components, + ExcDimensionMismatch(dof.get_finite_element(0).n_components(), function.n_components)); Assert (vec_result.size() == dof.n_dofs(), ExcDimensionMismatch (vec_result.size(), dof.n_dofs())); @@ -930,14 +930,14 @@ namespace VectorTools (void) project_to_boundary_first; (void) q_boundary; - Assert (dof.get_fe().n_components() == function.n_components, - ExcDimensionMismatch(dof.get_fe().n_components(), + Assert (dof.get_finite_element(0).n_components() == function.n_components, + ExcDimensionMismatch(dof.get_finite_element(0).n_components(), function.n_components)); Assert (fe_degree == -1 || - dof.get_fe().degree == static_cast(fe_degree), - ExcDimensionMismatch(fe_degree, dof.get_fe().degree)); - Assert (dof.get_fe().n_components() == components, - ExcDimensionMismatch(components, dof.get_fe().n_components())); + dof.get_finite_element().degree == static_cast(fe_degree), + ExcDimensionMismatch(fe_degree, dof.get_finite_element().degree)); + Assert (dof.get_finite_element(0).n_components() == components, + ExcDimensionMismatch(components, dof.get_finite_element(0).n_components())); // set up mass matrix and right hand side typename MatrixFree::AdditionalData additional_data; @@ -947,7 +947,7 @@ namespace VectorTools std::shared_ptr > matrix_free( new MatrixFree ()); matrix_free->reinit (mapping, dof, constraints, - QGauss<1>(dof.get_fe().degree+2), additional_data); + QGauss<1>(dof.get_finite_element().degree+2), additional_data); typedef MatrixFreeOperators::MassOperator > MatrixType; MatrixType mass_matrix; mass_matrix.initialize(matrix_free); @@ -998,7 +998,7 @@ namespace VectorTools const Quadrature &q_boundary, const bool project_to_boundary_first) { - switch (dof.get_fe().degree) + switch (dof.get_finite_element().degree) { case 1: project_matrix_free @@ -1041,7 +1041,7 @@ namespace VectorTools const Quadrature &q_boundary, const bool project_to_boundary_first) { - switch (dof.get_fe().n_components()) + switch (dof.get_finite_element(0).n_components()) { case 1: project_matrix_free_degree<1> @@ -1127,14 +1127,14 @@ namespace VectorTools const bool project_to_boundary_first) { // If we can, use the matrix-free implementation - bool use_matrix_free = MatrixFree::is_supported(dof.get_fe()); + bool use_matrix_free = MatrixFree::is_supported(dof.get_finite_element()); // enforce_zero_boundary and project_to_boundary_first // are not yet supported. // We have explicit instantiations only if // the number of components is not too high. if (enforce_zero_boundary || project_to_boundary_first - || dof.get_fe().n_components()>4) + || dof.get_finite_element(0).n_components()>4) use_matrix_free = false; if (use_matrix_free) @@ -1164,14 +1164,14 @@ namespace VectorTools VectorType &vec_result) { typedef typename VectorType::value_type Number; - Assert (dof.get_fe().n_components() == 1, - ExcDimensionMismatch(dof.get_fe().n_components(), + Assert (dof.get_finite_element(0).n_components() == 1, + ExcDimensionMismatch(dof.get_finite_element(0).n_components(), 1)); Assert (vec_result.size() == dof.n_dofs(), ExcDimensionMismatch (vec_result.size(), dof.n_dofs())); Assert (fe_degree == -1 || - dof.get_fe().degree == static_cast(fe_degree), - ExcDimensionMismatch(fe_degree, dof.get_fe().degree)); + dof.get_finite_element().degree == static_cast(fe_degree), + ExcDimensionMismatch(fe_degree, dof.get_finite_element().degree)); // set up mass matrix and right hand side typename MatrixFree::AdditionalData additional_data; @@ -1181,7 +1181,7 @@ namespace VectorTools std::shared_ptr > matrix_free( new MatrixFree()); matrix_free->reinit (mapping, dof, constraints, - QGauss<1>(dof.get_fe().degree+2), additional_data); + QGauss<1>(dof.get_finite_element().degree+2), additional_data); typedef MatrixFreeOperators::MassOperator > MatrixType; MatrixType mass_matrix; mass_matrix.initialize(matrix_free); @@ -1197,10 +1197,10 @@ namespace VectorTools // assemble right hand side: { - FEValues fe_values (mapping, dof.get_fe(), quadrature, + FEValues fe_values (mapping, dof.get_finite_element(), quadrature, update_values | update_JxW_values); - const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = dof.get_finite_element().dofs_per_cell; const unsigned int n_q_points = quadrature.size(); Vector cell_rhs (dofs_per_cell); std::vector local_dof_indices (dofs_per_cell); @@ -1264,14 +1264,14 @@ namespace VectorTools const DoFHandler &dof = matrix_free->get_dof_handler(); typedef typename VectorType::value_type Number; - Assert (dof.get_fe().n_components() == 1, - ExcDimensionMismatch(dof.get_fe().n_components(), + Assert (dof.get_finite_element(0).n_components() == 1, + ExcDimensionMismatch(dof.get_finite_element(0).n_components(), 1)); Assert (vec_result.size() == dof.n_dofs(), ExcDimensionMismatch (vec_result.size(), dof.n_dofs())); Assert (fe_degree == -1 || - dof.get_fe().degree == static_cast(fe_degree), - ExcDimensionMismatch(fe_degree, dof.get_fe().degree)); + dof.get_finite_element().degree == static_cast(fe_degree), + ExcDimensionMismatch(fe_degree, dof.get_finite_element().degree)); typedef MatrixFreeOperators::MassOperator > MatrixType; MatrixType mass_matrix; @@ -1339,7 +1339,7 @@ namespace VectorTools const std::function< typename VectorType::value_type (const typename DoFHandler::active_cell_iterator &, const unsigned int)> func, VectorType &vec_result) { - switch (dof.get_fe().degree) + switch (dof.get_finite_element().degree) { case 1: project_parallel (mapping,dof,constraints,quadrature,func,vec_result); @@ -1365,7 +1365,7 @@ namespace VectorTools VectorType &vec_result) { (void) n_q_points_1d; - const unsigned int fe_degree = matrix_free->get_dof_handler().get_fe().degree; + const unsigned int fe_degree = matrix_free->get_dof_handler().get_finite_element().degree; Assert (fe_degree+1 == n_q_points_1d, ExcNotImplemented()); @@ -1396,7 +1396,7 @@ namespace VectorTools { project (matrix_free, constraints, - matrix_free->get_dof_handler().get_fe().degree+1, + matrix_free->get_dof_handler().get_finite_element().degree+1, func, vec_result); } @@ -1503,7 +1503,7 @@ namespace VectorTools { typedef typename VectorType::value_type Number; - const FiniteElement &fe = dof_handler.get_fe(); + const FiniteElement &fe = dof_handler.get_finite_element(); Assert (fe.n_components() == rhs_function.n_components, ExcDimensionMismatch(fe.n_components(), rhs_function.n_components)); Assert (rhs_vector.size() == dof_handler.n_dofs(), @@ -1629,7 +1629,7 @@ namespace VectorTools { typedef typename VectorType::value_type Number; - const hp::FECollection &fe = dof_handler.get_fe(); + const hp::FECollection &fe = dof_handler.get_fe_collection(); Assert (fe.n_components() == rhs_function.n_components, ExcDimensionMismatch(fe.n_components(), rhs_function.n_components)); Assert (rhs_vector.size() == dof_handler.n_dofs(), @@ -1769,7 +1769,7 @@ namespace VectorTools { Assert (rhs_vector.size() == dof_handler.n_dofs(), ExcDimensionMismatch(rhs_vector.size(), dof_handler.n_dofs())); - Assert (dof_handler.get_fe().n_components() == 1, + Assert (dof_handler.get_finite_element(0).n_components() == 1, ExcMessage ("This function only works for scalar finite elements")); rhs_vector = 0; @@ -1780,11 +1780,11 @@ namespace VectorTools Quadrature q(GeometryInfo::project_to_unit_cell(cell_point.second)); - FEValues fe_values(mapping, dof_handler.get_fe(), + FEValues fe_values(mapping, dof_handler.get_finite_element(), q, UpdateFlags(update_values)); fe_values.reinit(cell_point.first); - const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = dof_handler.get_finite_element().dofs_per_cell; std::vector local_dof_indices (dofs_per_cell); cell_point.first->get_dof_indices (local_dof_indices); @@ -1813,7 +1813,7 @@ namespace VectorTools { Assert (rhs_vector.size() == dof_handler.n_dofs(), ExcDimensionMismatch(rhs_vector.size(), dof_handler.n_dofs())); - Assert (dof_handler.get_fe().n_components() == 1, + Assert (dof_handler.get_finite_element(0).n_components() == 1, ExcMessage ("This function only works for scalar finite elements")); rhs_vector = 0; @@ -1861,7 +1861,7 @@ namespace VectorTools { Assert (rhs_vector.size() == dof_handler.n_dofs(), ExcDimensionMismatch(rhs_vector.size(), dof_handler.n_dofs())); - Assert (dof_handler.get_fe().n_components() == dim, + Assert (dof_handler.get_finite_element(0).n_components() == dim, ExcMessage ("This function only works for vector-valued finite elements.")); rhs_vector = 0; @@ -1873,11 +1873,11 @@ namespace VectorTools const Quadrature q(GeometryInfo::project_to_unit_cell(cell_point.second)); const FEValuesExtractors::Vector vec (0); - FEValues fe_values(mapping, dof_handler.get_fe(), + FEValues fe_values(mapping, dof_handler.get_finite_element(), q, UpdateFlags(update_values)); fe_values.reinit(cell_point.first); - const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = dof_handler.get_finite_element().dofs_per_cell; std::vector local_dof_indices (dofs_per_cell); cell_point.first->get_dof_indices (local_dof_indices); @@ -1908,7 +1908,7 @@ namespace VectorTools { Assert (rhs_vector.size() == dof_handler.n_dofs(), ExcDimensionMismatch(rhs_vector.size(), dof_handler.n_dofs())); - Assert (dof_handler.get_fe().n_components() == dim, + Assert (dof_handler.get_finite_element(0).n_components() == dim, ExcMessage ("This function only works for vector-valued finite elements.")); rhs_vector = 0; @@ -1957,7 +1957,7 @@ namespace VectorTools VectorType &rhs_vector, const std::set &boundary_ids) { - const FiniteElement &fe = dof_handler.get_fe(); + const FiniteElement &fe = dof_handler.get_finite_element(); Assert (fe.n_components() == rhs_function.n_components, ExcDimensionMismatch(fe.n_components(), rhs_function.n_components)); Assert (rhs_vector.size() == dof_handler.n_dofs(), @@ -2096,7 +2096,7 @@ namespace VectorTools VectorType &rhs_vector, const std::set &boundary_ids) { - const hp::FECollection &fe = dof_handler.get_fe(); + const hp::FECollection &fe = dof_handler.get_fe_collection(); Assert (fe.n_components() == rhs_function.n_components, ExcDimensionMismatch(fe.n_components(), rhs_function.n_components)); Assert (rhs_vector.size() == dof_handler.n_dofs(), @@ -2254,7 +2254,7 @@ namespace VectorTools std::map &boundary_values, const ComponentMask &component_mask) { - Assert (component_mask.represents_n_components(dof.get_fe().n_components()), + Assert (component_mask.represents_n_components(dof.get_finite_element(0).n_components()), ExcMessage ("The number of components in the mask has to be either " "zero or equal to the number of components in the finite " "element.")); @@ -2349,7 +2349,7 @@ namespace VectorTools // before we start with the loop over all cells create an hp::FEValues // object that holds the interpolation points of all finite elements // that may ever be in use - dealii::hp::FECollection finite_elements (dof.get_fe()); + dealii::hp::FECollection finite_elements (dof.get_fe_collection()); dealii::hp::QCollection q_collection; for (unsigned int f=0; fsecond->n_components); + AssertDimension (dof.get_finite_element(0).n_components(), boundary_functions.begin()->second->n_components); // I still do not see why i // should create another copy // here - component_mapping.resize(dof.get_fe().n_components()); + component_mapping.resize(dof.get_finite_element(0).n_components()); for (unsigned int i= 0 ; i < component_mapping.size() ; ++i) component_mapping[i] = i; } else - AssertDimension (dof.get_fe().n_components(), component_mapping.size()); + AssertDimension (dof.get_finite_element(0).n_components(), component_mapping.size()); std::vector dof_to_boundary_mapping; std::set selected_boundary_components; @@ -4109,10 +4109,10 @@ namespace VectorTools // ones. Thus we have to solve two linear systems of equations of size // degree * (degree + 1) to obtain the values for the // corresponding degrees of freedom. - const unsigned int superdegree = dof_handler.get_fe ().degree; + const unsigned int superdegree = dof_handler.get_finite_element ().degree; const QGauss reference_face_quadrature (2 * superdegree); - const unsigned int dofs_per_face = dof_handler.get_fe ().dofs_per_face; - hp::FECollection fe_collection (dof_handler.get_fe ()); + const unsigned int dofs_per_face = dof_handler.get_finite_element ().dofs_per_face; + hp::FECollection fe_collection (dof_handler.get_fe_collection ()); hp::MappingCollection mapping_collection (mapping); hp::QCollection face_quadrature_collection; @@ -4314,7 +4314,7 @@ namespace VectorTools ConstraintMatrix &constraints, const hp::MappingCollection &mapping_collection) { - hp::FECollection fe_collection (dof_handler.get_fe ()); + hp::FECollection fe_collection (dof_handler.get_fe_collection ()); hp::QCollection face_quadrature_collection; for (unsigned int i = 0; i < fe_collection.size (); ++i) @@ -5138,7 +5138,7 @@ namespace VectorTools // Create hp FEcollection, dof_handler can be either hp or standard type. // From here on we can treat it like a hp-namespace object. - const hp::FECollection fe_collection (dof_handler.get_fe ()); + const hp::FECollection fe_collection (dof_handler.get_fe_collection ()); // Create face quadrature collection hp::QCollection face_quadrature_collection; @@ -5603,7 +5603,7 @@ namespace VectorTools // normal components of the shape // functions supported on the // boundary. - const FiniteElement &fe = dof_handler.get_fe (); + const FiniteElement &fe = dof_handler.get_finite_element (); QGauss face_quadrature (fe.degree + 1); FEFaceValues fe_face_values (mapping, fe, face_quadrature, update_JxW_values | update_normal_vectors | @@ -5759,7 +5759,7 @@ namespace VectorTools const hp::MappingCollection &mapping_collection) { const unsigned int spacedim = dim; - const hp::FECollection &fe_collection = dof_handler.get_fe (); + const hp::FECollection &fe_collection = dof_handler.get_fe_collection (); hp::QCollection face_quadrature_collection; hp::QCollection quadrature_collection; @@ -5928,7 +5928,7 @@ namespace VectorTools // create FE and mapping collections for all elements in use by this // DoFHandler - hp::FECollection fe_collection (dof_handler.get_fe()); + hp::FECollection fe_collection (dof_handler.get_fe_collection()); hp::MappingCollection mapping_collection; for (unsigned int i=0; i fe_collection (dof_handler.get_fe()); + hp::FECollection fe_collection (dof_handler.get_fe_collection()); hp::MappingCollection mapping_collection; for (unsigned int i=0; i fe_collection (dof.get_fe()); + dealii::hp::FECollection fe_collection (dof.get_fe_collection()); IDScratchData data(mapping, fe_collection, q, update_flags); // loop over all cells @@ -7367,7 +7367,7 @@ namespace VectorTools const Point &point) { typedef typename VectorType::value_type Number; - const FiniteElement &fe = dof.get_fe(); + const FiniteElement &fe = dof.get_finite_element(); Assert(difference.size() == fe.n_components(), ExcDimensionMismatch(difference.size(), fe.n_components())); @@ -7469,7 +7469,7 @@ namespace VectorTools Vector &value) { typedef typename VectorType::value_type Number; - const FiniteElement &fe = dof.get_fe(); + const FiniteElement &fe = dof.get_finite_element(); Assert(value.size() == fe.n_components(), ExcDimensionMismatch(value.size(), fe.n_components())); @@ -7510,7 +7510,7 @@ namespace VectorTools Vector &value) { typedef typename VectorType::value_type Number; - const hp::FECollection &fe = dof.get_fe(); + const hp::FECollection &fe = dof.get_fe_collection(); Assert(value.size() == fe.n_components(), ExcDimensionMismatch(value.size(), fe.n_components())); @@ -7551,7 +7551,7 @@ namespace VectorTools const VectorType &fe_function, const Point &point) { - Assert(dof.get_fe().n_components() == 1, + Assert(dof.get_finite_element(0).n_components() == 1, ExcMessage ("Finite element is not scalar as is necessary for this function")); Vector value(1); @@ -7568,7 +7568,7 @@ namespace VectorTools const VectorType &fe_function, const Point &point) { - Assert(dof.get_fe().n_components() == 1, + Assert(dof.get_finite_element(0).n_components() == 1, ExcMessage ("Finite element is not scalar as is necessary for this function")); Vector value(1); @@ -7644,7 +7644,7 @@ namespace VectorTools const Point &point, std::vector > &gradient) { - const FiniteElement &fe = dof.get_fe(); + const FiniteElement &fe = dof.get_finite_element(); Assert(gradient.size() == fe.n_components(), ExcDimensionMismatch(gradient.size(), fe.n_components())); @@ -7687,7 +7687,7 @@ namespace VectorTools std::vector > &gradient) { typedef typename VectorType::value_type Number; - const hp::FECollection &fe = dof.get_fe(); + const hp::FECollection &fe = dof.get_fe_collection(); Assert(gradient.size() == fe.n_components(), ExcDimensionMismatch(gradient.size(), fe.n_components())); @@ -7727,7 +7727,7 @@ namespace VectorTools const VectorType &fe_function, const Point &point) { - Assert(dof.get_fe().n_components() == 1, + Assert(dof.get_finite_element(0).n_components() == 1, ExcMessage ("Finite element is not scalar as is necessary for this function")); std::vector > gradient(1); @@ -7745,7 +7745,7 @@ namespace VectorTools const VectorType &fe_function, const Point &point) { - Assert(dof.get_fe().n_components() == 1, + Assert(dof.get_finite_element(0).n_components() == 1, ExcMessage ("Finite element is not scalar as is necessary for this function")); std::vector > gradient(1); @@ -7850,16 +7850,16 @@ namespace VectorTools typedef typename VectorType::value_type Number; Assert (v.size() == dof.n_dofs(), ExcDimensionMismatch (v.size(), dof.n_dofs())); - Assert (component < dof.get_fe().n_components(), - ExcIndexRange(component, 0, dof.get_fe().n_components())); + Assert (component < dof.get_finite_element(0).n_components(), + ExcIndexRange(component, 0, dof.get_finite_element(0).n_components())); - FEValues fe(mapping, dof.get_fe(), quadrature, + FEValues fe(mapping, dof.get_finite_element(), quadrature, UpdateFlags(update_JxW_values | update_values)); typename DoFHandler::active_cell_iterator cell; std::vector > values(quadrature.size(), - Vector (dof.get_fe().n_components())); + Vector (dof.get_finite_element(0).n_components())); Number mean = Number(); double area = 0.; @@ -7926,7 +7926,7 @@ namespace VectorTools const ComponentMask &mask) { AssertDimension(vector.size(), dh.n_dofs()); - const FiniteElement &fe = dh.get_fe(); + const FiniteElement &fe = dh.get_finite_element(); // Construct default fe_mask; const ComponentMask fe_mask(mask.size() ? mask : diff --git a/source/dofs/block_info.cc b/source/dofs/block_info.cc index d2b77a6f15..c1e75c5e20 100644 --- a/source/dofs/block_info.cc +++ b/source/dofs/block_info.cc @@ -29,7 +29,7 @@ BlockInfo::initialize(const DoFHandler &dof, bool levels_only, bo { if (!levels_only && dof.has_active_dofs()) { - const FiniteElement &fe = dof.get_fe(); + const FiniteElement &fe = dof.get_finite_element(); std::vector sizes(fe.n_blocks()); DoFTools::count_dofs_per_block(dof, sizes); bi_global.reinit(sizes); @@ -40,7 +40,7 @@ BlockInfo::initialize(const DoFHandler &dof, bool levels_only, bo std::vector > sizes (dof.get_triangulation().n_levels ()); for (unsigned int i = 0; i < sizes.size (); ++i) - sizes[i].resize (dof.get_fe ().n_blocks ()); + sizes[i].resize (dof.get_finite_element ().n_blocks ()); MGTools::count_dofs_per_block (dof, sizes); levels.resize (sizes.size ()); @@ -55,7 +55,7 @@ template void BlockInfo::initialize_local(const DoFHandler &dof) { - const FiniteElement &fe = dof.get_fe(); + const FiniteElement &fe = dof.get_finite_element(); std::vector sizes(fe.n_blocks()); base_elements.resize(fe.n_blocks()); diff --git a/source/dofs/dof_accessor_get.cc b/source/dofs/dof_accessor_get.cc index d937c77fbf..53bb528862 100644 --- a/source/dofs/dof_accessor_get.cc +++ b/source/dofs/dof_accessor_get.cc @@ -70,9 +70,9 @@ get_interpolated_dof_values (const InputVector &values, Vector tmp (this->get_fe().dofs_per_cell); this->get_dof_values (values, tmp); - FullMatrix interpolation (this->dof_handler->get_fe()[fe_index].dofs_per_cell, + FullMatrix interpolation (this->dof_handler->get_finite_element(fe_index).dofs_per_cell, this->get_fe().dofs_per_cell); - this->dof_handler->get_fe()[fe_index].get_interpolation_matrix (this->get_fe(), + this->dof_handler->get_finite_element(fe_index).get_interpolation_matrix (this->get_fe(), interpolation); interpolation.vmult (interpolated_values, tmp); } @@ -99,7 +99,7 @@ get_interpolated_dof_values (const InputVector &values, "of freedom are only distributed on active cells for which " "the active_fe_index has been set.")); - const FiniteElement &fe = this->get_dof_handler().get_fe()[fe_index]; + const FiniteElement &fe = this->get_dof_handler().get_finite_element(fe_index); const unsigned int dofs_per_cell = fe.dofs_per_cell; Assert (this->dof_handler != nullptr, diff --git a/source/dofs/dof_accessor_set.cc b/source/dofs/dof_accessor_set.cc index 33e873cc31..d6399319f9 100644 --- a/source/dofs/dof_accessor_set.cc +++ b/source/dofs/dof_accessor_set.cc @@ -62,12 +62,12 @@ set_dof_values_by_interpolation (const Vector &local_values, this->set_dof_values (local_values, values); else { - Assert (local_values.size() == this->dof_handler->get_fe()[fe_index].dofs_per_cell, + Assert (local_values.size() == this->dof_handler->get_finite_element(fe_index).dofs_per_cell, ExcMessage ("Incorrect size of local_values vector.") ); - FullMatrix interpolation (this->get_fe().dofs_per_cell, this->dof_handler->get_fe()[fe_index].dofs_per_cell); + FullMatrix interpolation (this->get_fe().dofs_per_cell, this->dof_handler->get_finite_element(fe_index).dofs_per_cell); - this->get_fe().get_interpolation_matrix (this->dof_handler->get_fe()[fe_index], + this->get_fe().get_interpolation_matrix (this->dof_handler->get_finite_element(fe_index), interpolation); // do the interpolation to the target space. for historical @@ -96,7 +96,7 @@ set_dof_values_by_interpolation (const Vector &local_values, "of freedom are only distributed on active cells for which " "the active_fe_index has been set.")); - const FiniteElement &fe = this->get_dof_handler().get_fe()[fe_index]; + const FiniteElement &fe = this->get_dof_handler().get_finite_element(fe_index); const unsigned int dofs_per_cell = fe.dofs_per_cell; Assert (this->dof_handler != nullptr, diff --git a/source/dofs/dof_handler.cc b/source/dofs/dof_handler.cc index 942455ea68..9a655fb48b 100644 --- a/source/dofs/dof_handler.cc +++ b/source/dofs/dof_handler.cc @@ -377,7 +377,7 @@ namespace internal dof_handler.clear_mg_space (); const dealii::Triangulation<1, spacedim> &tria = dof_handler.get_triangulation(); - const unsigned int &dofs_per_line = dof_handler.get_fe ().dofs_per_line; + const unsigned int &dofs_per_line = dof_handler.get_finite_element ().dofs_per_line; const unsigned int &n_levels = tria.n_levels (); for (unsigned int i = 0; i < n_levels; ++i) @@ -414,7 +414,7 @@ namespace internal { Assert (min_level[vertex] < n_levels, ExcInternalError ()); Assert (max_level[vertex] >= min_level[vertex], ExcInternalError ()); - dof_handler.mg_vertex_dofs[vertex].init (min_level[vertex], max_level[vertex], dof_handler.get_fe ().dofs_per_vertex); + dof_handler.mg_vertex_dofs[vertex].init (min_level[vertex], max_level[vertex], dof_handler.get_finite_element ().dofs_per_vertex); } else @@ -432,7 +432,7 @@ namespace internal Assert (dof_handler.get_triangulation().n_levels () > 0, ExcMessage ("Invalid triangulation")); dof_handler.clear_mg_space (); - const dealii::FiniteElement<2, spacedim> &fe = dof_handler.get_fe (); + const dealii::FiniteElement<2, spacedim> &fe = dof_handler.get_finite_element (); const dealii::Triangulation<2, spacedim> &tria = dof_handler.get_triangulation(); const unsigned int &n_levels = tria.n_levels (); @@ -491,7 +491,7 @@ namespace internal Assert (dof_handler.get_triangulation().n_levels () > 0, ExcMessage ("Invalid triangulation")); dof_handler.clear_mg_space (); - const dealii::FiniteElement<3, spacedim> &fe = dof_handler.get_fe (); + const dealii::FiniteElement<3, spacedim> &fe = dof_handler.get_finite_element (); const dealii::Triangulation<3, spacedim> &tria = dof_handler.get_triangulation(); const unsigned int &n_levels = tria.n_levels (); @@ -888,7 +888,7 @@ types::global_dof_index DoFHandler::n_boundary_dofs () const { std::set boundary_dofs; - const unsigned int dofs_per_face = get_fe().dofs_per_face; + const unsigned int dofs_per_face = get_finite_element().dofs_per_face; std::vector dofs_on_face(dofs_per_face); // loop over all faces of all cells @@ -930,7 +930,7 @@ DoFHandler::n_boundary_dofs (const std::set &b std::set boundary_dofs; - const unsigned int dofs_per_face = get_fe().dofs_per_face; + const unsigned int dofs_per_face = get_finite_element().dofs_per_face; std::vector dofs_on_face(dofs_per_face); // same as in the previous @@ -1164,10 +1164,10 @@ DoFHandler::max_couplings_between_boundary_dofs () const switch (dim) { case 1: - return get_fe().dofs_per_vertex; + return get_finite_element().dofs_per_vertex; case 2: - return (3*get_fe().dofs_per_vertex + - 2*get_fe().dofs_per_line); + return (3*get_finite_element().dofs_per_vertex + + 2*get_finite_element().dofs_per_line); case 3: // we need to take refinement of // one boundary face into @@ -1185,9 +1185,9 @@ DoFHandler::max_couplings_between_boundary_dofs () const // harm since the matrix will cry // foul if its requirements are // not satisfied - return (19*get_fe().dofs_per_vertex + - 28*get_fe().dofs_per_line + - 8*get_fe().dofs_per_quad); + return (19*get_finite_element().dofs_per_vertex + + 28*get_finite_element().dofs_per_line + + 8*get_finite_element().dofs_per_quad); default: Assert (false, ExcNotImplemented()); return numbers::invalid_unsigned_int; diff --git a/source/dofs/dof_handler_policy.cc b/source/dofs/dof_handler_policy.cc index 17e4797293..4f3dcd98c2 100644 --- a/source/dofs/dof_handler_policy.cc +++ b/source/dofs/dof_handler_policy.cc @@ -287,11 +287,11 @@ namespace internal { // distribute dofs of vertices - if (dof_handler.get_fe().dofs_per_vertex > 0) + if (dof_handler.get_finite_element().dofs_per_vertex > 0) for (unsigned int v=0; v::vertices_per_cell; ++v) { if (cell->vertex_dof_index (v,0) == numbers::invalid_dof_index) - for (unsigned int d=0; dvertex_dof_index (v,d) == numbers::invalid_dof_index), @@ -299,14 +299,14 @@ namespace internal cell->set_vertex_dof_index (v, d, next_free_dof++); } else - for (unsigned int d=0; dvertex_dof_index (v,d) != numbers::invalid_dof_index), ExcInternalError()); } // dofs of line - for (unsigned int d=0; dset_dof_index (d, next_free_dof++); return next_free_dof; @@ -321,17 +321,17 @@ namespace internal const typename DoFHandler<2,spacedim>::active_cell_iterator &cell, types::global_dof_index next_free_dof) { - if (dof_handler.get_fe().dofs_per_vertex > 0) + if (dof_handler.get_finite_element().dofs_per_vertex > 0) // number dofs on vertices for (unsigned int vertex=0; vertex::vertices_per_cell; ++vertex) // check whether dofs for this vertex have been distributed // (checking the first dof should be good enough) if (cell->vertex_dof_index(vertex, 0) == numbers::invalid_dof_index) - for (unsigned int d=0; dset_vertex_dof_index (vertex, d, next_free_dof++); // for the four sides - if (dof_handler.get_fe().dofs_per_line > 0) + if (dof_handler.get_finite_element().dofs_per_line > 0) for (unsigned int side=0; side::faces_per_cell; ++side) { const typename DoFHandler<2,spacedim>::line_iterator @@ -341,14 +341,14 @@ namespace internal // numbered (checking the first dof should be good enough) if (line->dof_index(0) == numbers::invalid_dof_index) // if not: distribute dofs - for (unsigned int d=0; dset_dof_index (d, next_free_dof++); } // dofs of quad - if (dof_handler.get_fe().dofs_per_quad > 0) - for (unsigned int d=0; d 0) + for (unsigned int d=0; dset_dof_index (d, next_free_dof++); return next_free_dof; @@ -363,17 +363,17 @@ namespace internal const typename DoFHandler<3,spacedim>::active_cell_iterator &cell, types::global_dof_index next_free_dof) { - if (dof_handler.get_fe().dofs_per_vertex > 0) + if (dof_handler.get_finite_element().dofs_per_vertex > 0) // number dofs on vertices for (unsigned int vertex=0; vertex::vertices_per_cell; ++vertex) // check whether dofs for this vertex have been distributed // (checking the first dof should be good enough) if (cell->vertex_dof_index(vertex, 0) == numbers::invalid_dof_index) - for (unsigned int d=0; dset_vertex_dof_index (vertex, d, next_free_dof++); // for the lines - if (dof_handler.get_fe().dofs_per_line > 0) + if (dof_handler.get_finite_element().dofs_per_line > 0) for (unsigned int l=0; l::lines_per_cell; ++l) { const typename DoFHandler<3,spacedim>::line_iterator @@ -383,12 +383,12 @@ namespace internal // numbered (checking the first dof should be good enough) if (line->dof_index(0) == numbers::invalid_dof_index) // if not: distribute dofs - for (unsigned int d=0; dset_dof_index (d, next_free_dof++); } // for the quads - if (dof_handler.get_fe().dofs_per_quad > 0) + if (dof_handler.get_finite_element().dofs_per_quad > 0) for (unsigned int q=0; q::quads_per_cell; ++q) { const typename DoFHandler<3,spacedim>::quad_iterator @@ -398,14 +398,14 @@ namespace internal // numbered (checking the first dof should be good enough) if (quad->dof_index(0) == numbers::invalid_dof_index) // if not: distribute dofs - for (unsigned int d=0; dset_dof_index (d, next_free_dof++); } // dofs of hex - if (dof_handler.get_fe().dofs_per_hex > 0) - for (unsigned int d=0; d 0) + for (unsigned int d=0; dset_dof_index (d, next_free_dof++); return next_free_dof; @@ -603,8 +603,8 @@ namespace internal // vertices at all, I can't think of a finite element that // would make that necessary... dealii::Table<2,std::shared_ptr > - vertex_dof_identities (dof_handler.get_fe().size(), - dof_handler.get_fe().size()); + vertex_dof_identities (dof_handler.get_fe_collection().size(), + dof_handler.get_fe_collection().size()); // loop over all vertices and see which one we need to work // on @@ -634,8 +634,8 @@ namespace internal // make sure the entry in the equivalence // table exists ensure_existence_of_dof_identities<0> - (dof_handler.get_fe()[first_fe_index], - dof_handler.get_fe()[other_fe_index], + (dof_handler.get_finite_element(first_fe_index), + dof_handler.get_finite_element(other_fe_index), vertex_dof_identities[first_fe_index][other_fe_index]); // then loop through the identities we @@ -1572,7 +1572,7 @@ namespace internal = dealii::internal::DoFAccessor::Implementation:: nth_active_vertex_fe_index (dof_handler, vertex_index, f); - for (unsigned int d=0; dactive_fe_index (); - for (unsigned int d=0; d(); ++d) + for (unsigned int d=0; d(); ++d) { const types::global_dof_index old_dof_index = cell->dof_index(d,fe_index); if (old_dof_index != numbers::invalid_dof_index) @@ -1679,7 +1679,7 @@ namespace internal const unsigned int fe_index = line->nth_active_fe_index (f); - for (unsigned int d=0; ddof_index(d,fe_index); if (old_dof_index != numbers::invalid_dof_index) @@ -1736,7 +1736,7 @@ namespace internal const unsigned int fe_index = line->nth_active_fe_index (f); - for (unsigned int d=0; ddof_index(d,fe_index); if (old_dof_index != numbers::invalid_dof_index) @@ -1779,7 +1779,7 @@ namespace internal const unsigned int fe_index = quad->nth_active_fe_index (f); - for (unsigned int d=0; ddof_index(d,fe_index); if (old_dof_index != numbers::invalid_dof_index) @@ -1875,17 +1875,17 @@ namespace internal // if the present vertex lives on the current level if ((i->get_coarsest_level() <= level) && (i->get_finest_level() >= level)) - for (unsigned int d=0; dget_index (level, d, dof_handler.get_fe().dofs_per_vertex); + = i->get_index (level, d, dof_handler.get_finite_element().dofs_per_vertex); if (check_validity) Assert(idx != numbers::invalid_dof_index, ExcInternalError ()); if (idx != numbers::invalid_dof_index) i->set_index (level, d, - dof_handler.get_fe().dofs_per_vertex, + dof_handler.get_finite_element().dofs_per_vertex, (indices.size() == 0)? (new_numbers[idx]) : (new_numbers[indices.index_within_set(idx)])); @@ -1956,7 +1956,7 @@ namespace internal const unsigned int level, const bool check_validity) { - if (dof_handler.get_fe().dofs_per_line > 0) + if (dof_handler.get_finite_element().dofs_per_line > 0) { // save user flags as they will be modified std::vector user_flags; @@ -1978,7 +1978,7 @@ namespace internal for (unsigned int l=0; l::lines_per_cell; ++l) if (cell->line(l)->user_flag_set()) { - for (unsigned int d=0; dline(l)->mg_dof_index(level, d); if (check_validity) @@ -2007,8 +2007,8 @@ namespace internal const unsigned int level, const bool check_validity) { - if (dof_handler.get_fe().dofs_per_line > 0 || - dof_handler.get_fe().dofs_per_quad > 0) + if (dof_handler.get_finite_element().dofs_per_line > 0 || + dof_handler.get_finite_element().dofs_per_quad > 0) { // save user flags as they will be modified std::vector user_flags; @@ -2029,7 +2029,7 @@ namespace internal for (unsigned int l=0; l::lines_per_cell; ++l) if (cell->line(l)->user_flag_set()) { - for (unsigned int d=0; dline(l)->mg_dof_index(level, d); if (check_validity) @@ -2055,7 +2055,7 @@ namespace internal for (unsigned int l=0; l::quads_per_cell; ++l) if (cell->quad(l)->user_flag_set()) { - for (unsigned int d=0; dquad(l)->mg_dof_index(level, d); if (check_validity) diff --git a/source/dofs/dof_objects.cc b/source/dofs/dof_objects.cc index 59456fc36d..dfdca3a41c 100644 --- a/source/dofs/dof_objects.cc +++ b/source/dofs/dof_objects.cc @@ -47,14 +47,14 @@ namespace internal (void)fe_index; Assert ((fe_index == dealii::DoFHandler::default_fe_index), ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); - Assert (local_index(), - ExcIndexRange (local_index, 0, dof_handler.get_fe().template n_dofs_per_object())); - Assert (obj_index * dof_handler.get_fe().template n_dofs_per_object()+local_index + Assert (local_index(), + ExcIndexRange (local_index, 0, dof_handler.get_finite_element().template n_dofs_per_object())); + Assert (obj_index * dof_handler.get_finite_element().template n_dofs_per_object()+local_index < dofs.size(), ExcInternalError()); - dofs[obj_index * dof_handler.get_fe() + dofs[obj_index * dof_handler.get_finite_element() .template n_dofs_per_object() + local_index] = global_index; } } diff --git a/source/dofs/dof_renumbering.cc b/source/dofs/dof_renumbering.cc index 763ac0cd9d..34f2dc083e 100644 --- a/source/dofs/dof_renumbering.cc +++ b/source/dofs/dof_renumbering.cc @@ -573,7 +573,7 @@ namespace DoFRenumbering const bool is_level_operation) { const hp::FECollection - fe_collection (start->get_dof_handler().get_fe ()); + fe_collection (start->get_dof_handler().get_fe_collection ()); // do nothing if the FE has only // one component @@ -908,7 +908,7 @@ namespace DoFRenumbering const bool is_level_operation) { const hp::FECollection - fe_collection (start->get_dof_handler().get_fe ()); + fe_collection (start->get_dof_handler().get_fe_collection ()); // do nothing if the FE has only // one component @@ -1447,7 +1447,7 @@ namespace DoFRenumbering ExcDimensionMismatch(reverse.size(), dof.n_dofs(level))); unsigned int n_global_dofs = dof.n_dofs(level); - unsigned int n_cell_dofs = dof.get_fe().n_dofs_per_cell(); + unsigned int n_cell_dofs = dof.get_finite_element().n_dofs_per_cell(); std::vector already_sorted(n_global_dofs, false); std::vector cell_dofs(n_cell_dofs); @@ -1524,7 +1524,7 @@ namespace DoFRenumbering std::vector,unsigned int> > support_point_list (n_dofs); - const hp::FECollection fe_collection (dof.get_fe ()); + const hp::FECollection fe_collection (dof.get_fe_collection()); Assert (fe_collection[0].has_support_points(), typename FiniteElement::ExcFEHasNoSupportPoints()); hp::QCollection quadrature_collection; @@ -1622,19 +1622,19 @@ namespace DoFRenumbering } else { - Assert (dof.get_fe().has_support_points(), + Assert (dof.get_finite_element().has_support_points(), typename FiniteElement::ExcFEHasNoSupportPoints()); const unsigned int n_dofs = dof.n_dofs(level); std::vector,unsigned int> > support_point_list (n_dofs); - Quadrature q_dummy(dof.get_fe().get_unit_support_points()); - FEValues fe_values (dof.get_fe(), q_dummy, + Quadrature q_dummy(dof.get_finite_element().get_unit_support_points()); + FEValues fe_values (dof.get_finite_element(), q_dummy, update_quadrature_points); std::vector already_touched (dof.n_dofs(), false); - const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = dof.get_finite_element().dofs_per_cell; std::vector local_dof_indices (dofs_per_cell); typename DoFHandlerType::level_cell_iterator begin = dof.begin(level); typename DoFHandlerType::level_cell_iterator end = dof.end(level); diff --git a/source/dofs/dof_tools.cc b/source/dofs/dof_tools.cc index 6b9633a109..4fbbdfe0de 100644 --- a/source/dofs/dof_tools.cc +++ b/source/dofs/dof_tools.cc @@ -179,7 +179,7 @@ namespace DoFTools std::vector &dofs_by_component) { const dealii::hp::FECollection - fe_collection (dof.get_fe()); + fe_collection (dof.get_fe_collection()); Assert (fe_collection.n_components() < 256, ExcNotImplemented()); Assert (dofs_by_component.size() == dof.n_locally_owned_dofs(), ExcDimensionMismatch(dofs_by_component.size(), @@ -234,7 +234,7 @@ namespace DoFTools std::vector &dofs_by_block) { const dealii::hp::FECollection - fe_collection (dof.get_fe()); + fe_collection (dof.get_fe_collection()); Assert (fe_collection.n_components() < 256, ExcNotImplemented()); Assert (dofs_by_block.size() == dof.n_locally_owned_dofs(), ExcDimensionMismatch(dofs_by_block.size(), @@ -315,7 +315,7 @@ namespace DoFTools { std::vector component_dofs (dof_handler.n_locally_owned_dofs()); internal::get_component_association (dof_handler, - dof_handler.get_fe().component_mask + dof_handler.get_fe_collection().component_mask (FEValuesExtractors::Scalar(component)), component_dofs); @@ -373,7 +373,7 @@ namespace DoFTools const ComponentMask &component_mask, std::vector &selected_dofs) { - const FiniteElement &fe = dof.get_fe(); + const FiniteElement &fe = dof.get_finite_element(); (void)fe; Assert(component_mask.represents_n_components(fe.n_components()), @@ -491,7 +491,7 @@ namespace DoFTools const ComponentMask &component_mask, std::vector &selected_dofs) { - const FiniteElement &fe = dof.get_fe(); + const FiniteElement &fe = dof.get_finite_element(); Assert(component_mask.represents_n_components(n_components(dof)), ExcMessage ("The given component mask is not sized correctly to represent the " @@ -544,7 +544,7 @@ namespace DoFTools std::vector &selected_dofs) { // simply defer to the other extract_level_dofs() function - extract_level_dofs (level, dof, dof.get_fe().component_mask(block_mask), + extract_level_dofs (level, dof, dof.get_finite_element().component_mask(block_mask), selected_dofs); } @@ -894,7 +894,7 @@ namespace DoFTools // preset all values by false std::fill_n (selected_dofs.begin(), dof_handler.n_dofs(), false); - const FiniteElement &fe = dof_handler.get_fe(); + const FiniteElement &fe = dof_handler.get_finite_element(); // this function is similar to the make_sparsity_pattern function, // see there for more information @@ -929,7 +929,7 @@ namespace DoFTools // preset all values by false std::fill_n (selected_dofs.begin(), dof_handler.n_dofs(), false); - const FiniteElement &fe = dof_handler.get_fe(); + const FiniteElement &fe = dof_handler.get_finite_element(); // this function is similar to the make_sparsity_pattern function, // see there for more information @@ -1166,7 +1166,7 @@ namespace DoFTools const ComponentMask &component_mask, std::vector > &constant_modes) { - const unsigned int n_components = dof_handler.get_fe().n_components(); + const unsigned int n_components = dof_handler.get_finite_element(0).n_components(); Assert (component_mask.represents_n_components(n_components), ExcDimensionMismatch(n_components, component_mask.size())); @@ -1194,7 +1194,7 @@ namespace DoFTools // TODO: We might be able to extend this also for elements which do not // have the same constant modes, but that is messy... const dealii::hp::FECollection - fe_collection (dof_handler.get_fe()); + fe_collection (dof_handler.get_fe_collection()); std::vector > element_constant_modes; std::vector > > constant_mode_to_component_translation(n_components); @@ -1576,9 +1576,9 @@ namespace DoFTools const types::subdomain_id subdomain, std::vector &n_dofs_on_subdomain) { - Assert (n_dofs_on_subdomain.size() == dof_handler.get_fe().n_components(), + Assert (n_dofs_on_subdomain.size() == dof_handler.get_finite_element(0).n_components(), ExcDimensionMismatch (n_dofs_on_subdomain.size(), - dof_handler.get_fe().n_components())); + dof_handler.get_finite_element(0).n_components())); std::fill (n_dofs_on_subdomain.begin(), n_dofs_on_subdomain.end(), 0); // in debug mode, make sure that there are some cells at least with @@ -1607,7 +1607,7 @@ namespace DoFTools internal::get_component_association (dof_handler, std::vector(), component_association); - for (unsigned int c=0; c target_component) { - const unsigned int n_components = dof_handler.get_fe().n_components(); + const unsigned int n_components = dof_handler.get_finite_element(0).n_components(); std::fill (dofs_per_component.begin(), dofs_per_component.end(), types::global_dof_index(0)); @@ -1780,14 +1780,14 @@ namespace DoFTools // next count what we got unsigned int component = 0; - internal::resolve_components(dof_handler.get_fe(), + internal::resolve_components(dof_handler.get_fe_collection(), dofs_by_component, target_component, only_once, dofs_per_component, component); Assert (n_components == component, ExcInternalError()); // finally sanity check. this is only valid if the finite element is // actually primitive, so exclude other elements from this - Assert ((internal::all_elements_are_primitive(dof_handler.get_fe()) == false) + Assert ((internal::all_elements_are_primitive(dof_handler.get_fe_collection()) == false) || (std::accumulate (dofs_per_component.begin(), dofs_per_component.end(), @@ -1825,7 +1825,7 @@ namespace DoFTools std::vector target_block = target_block_; const dealii::hp::FECollection - fe_collection (dof_handler.get_fe()); + fe_collection (dof_handler.get_fe_collection()); Assert (fe_collection.size() < 256, ExcNotImplemented()); for (unsigned int this_fe=0; this_fe fe_collection(dof_handler.get_fe()); + hp::FECollection fe_collection(dof_handler.get_fe_collection()); hp::QCollection q_coll_dummy; for (unsigned int fe_index = 0; fe_index < fe_collection.size(); ++fe_index) @@ -2188,7 +2188,7 @@ namespace DoFTools const Table<2, Coupling> &table, std::vector > &tables_by_block) { - const FiniteElement &fe = dof_handler.get_fe(); + const FiniteElement &fe = dof_handler.get_finite_element(); const unsigned int nb = fe.n_blocks(); tables_by_block.resize(1); @@ -2213,7 +2213,7 @@ namespace DoFTools const Table<2, Coupling> &table, std::vector > &tables_by_block) { - const hp::FECollection &fe_collection = dof_handler.get_fe(); + const hp::FECollection &fe_collection = dof_handler.get_fe_collection(); tables_by_block.resize(fe_collection.size()); for (unsigned int f=0; fis_locally_owned_on_level()) ++i; - block_list.reinit(i, dof_handler.n_dofs(), dof_handler.get_fe().dofs_per_cell); + block_list.reinit(i, dof_handler.n_dofs(), dof_handler.get_finite_element().dofs_per_cell); i=0; for (cell=dof_handler.begin(level); cell != endc; ++cell) if (cell->is_locally_owned_on_level()) @@ -2285,7 +2285,7 @@ namespace DoFTools const unsigned int level, const bool interior_only) { - const FiniteElement &fe = dof_handler.get_fe(); + const FiniteElement &fe = dof_handler.get_finite_element(); block_list.reinit(1, dof_handler.n_dofs(level), dof_handler.n_dofs(level)); typename DoFHandlerType::level_cell_iterator cell; typename DoFHandlerType::level_cell_iterator endc = dof_handler.end(level); @@ -2348,7 +2348,7 @@ namespace DoFTools const typename DoFHandlerType::level_cell_iterator cell = pcell->child(child); // For hp, only this line here would have to be replaced. - const FiniteElement &fe = dof_handler.get_fe(); + const FiniteElement &fe = dof_handler.get_finite_element(); const unsigned int n_dofs = fe.dofs_per_cell; indices.resize(n_dofs); exclude.resize(n_dofs); @@ -2396,7 +2396,7 @@ namespace DoFTools const bool single_cell_patches, const bool invert_vertex_mapping) { - const unsigned int n_blocks = dof_handler.get_fe().n_blocks(); + const unsigned int n_blocks = dof_handler.get_finite_element().n_blocks(); BlockMask exclude_boundary_dofs = BlockMask(n_blocks,interior_only); return make_vertex_patches(block_list, dof_handler, diff --git a/source/dofs/dof_tools_constraints.cc b/source/dofs/dof_tools_constraints.cc index 9c82f18b39..30fd4bf27d 100644 --- a/source/dofs/dof_tools_constraints.cc +++ b/source/dofs/dof_tools_constraints.cc @@ -450,13 +450,13 @@ namespace DoFTools /** * A function that returns how many different finite elements a dof * handler uses. This is one for non-hp DoFHandlers and - * dof_handler.get_fe().size() for the hp-versions. + * dof_handler.get_finite_element().size() for the hp-versions. */ template unsigned int n_finite_elements (const dealii::hp::DoFHandler &dof_handler) { - return dof_handler.get_fe().size(); + return dof_handler.get_fe_collection().size(); } @@ -1023,26 +1023,6 @@ namespace DoFTools } } - namespace internal - { - /** - * get FECollection - */ - template - const dealii::hp::FECollection * - get_fe_collection (const dealii::hp::DoFHandler &dof_handler) - { - return &dof_handler.get_fe(); - } - - template - const dealii::hp::FECollection * - get_fe_collection (const dealii::DoFHandler &) - { - Assert(false, ExcInternalError()); - return nullptr; - } - } template @@ -1281,7 +1261,7 @@ namespace DoFTools ExcInternalError()); const dealii::hp::FECollection &fe_collection = - *internal::get_fe_collection (dof_handler); + dof_handler.get_fe_collection (); // we first have to find the finite element that is // able to generate a space that all the other ones can // be constrained to. @@ -1306,7 +1286,7 @@ namespace DoFTools ExcMessage("Could not find a least face dominating FE.")); const FiniteElement &dominating_fe - = dof_handler.get_fe()[dominating_fe_index]; + = dof_handler.get_finite_element(dominating_fe_index); // first get the interpolation matrix from the mother // to the virtual dofs @@ -1405,7 +1385,7 @@ namespace DoFTools const unsigned int subface_fe_index = cell->face(face)->child(sf)->nth_active_fe_index(0); const FiniteElement &subface_fe - = dof_handler.get_fe()[subface_fe_index]; + = dof_handler.get_finite_element(subface_fe_index); // first get the interpolation matrix from the // subface to the virtual dofs @@ -1581,7 +1561,7 @@ namespace DoFTools fes.insert(this_fe_index); fes.insert(neighbor_fe_index); const dealii::hp::FECollection &fe_collection = - *internal::get_fe_collection (dof_handler); + dof_handler.get_fe_collection (); const unsigned int dominating_fe_index = fe_collection.find_least_face_dominating_fe(fes); AssertThrow(dominating_fe_index != numbers::invalid_unsigned_int, @@ -1734,7 +1714,7 @@ namespace DoFTools // function. If all the FiniteElement or all elements in a FECollection // support the new face constraint matrix, the new code will be used. // Otherwise, the old implementation is used for the moment. - if (dof_handler.get_fe().hp_constraints_are_implemented ()) + if (dof_handler.get_fe_collection().hp_constraints_are_implemented ()) internal:: make_hp_hanging_node_constraints (dof_handler, constraints); @@ -2696,8 +2676,8 @@ namespace DoFTools Assembler::CopyData copy_data; unsigned int n_interesting_dofs = 0; - for (unsigned int local_dof=0; local_dof, std::placeholders::_1, coarse_component, - std::cref(coarse_grid.get_fe()), + std::cref(coarse_grid.get_finite_element()), std::cref(weight_mapping), is_called_in_parallel, std::ref(weights)), @@ -2781,8 +2761,8 @@ namespace DoFTools std::vector &weight_mapping) { // aliases to the finite elements used by the dof handlers: - const FiniteElement &coarse_fe = coarse_grid.get_fe(), - &fine_fe = fine_grid.get_fe(); + const FiniteElement &coarse_fe = coarse_grid.get_finite_element(), + &fine_fe = fine_grid.get_finite_element(); // global numbers of dofs const types::global_dof_index n_coarse_dofs = coarse_grid.n_dofs(), @@ -3036,7 +3016,7 @@ namespace DoFTools std::vector coarse_dof_is_parameter (coarse_grid.n_dofs()); if (true) { - std::vector mask (coarse_grid.get_fe().n_components(), + std::vector mask (coarse_grid.get_finite_element(0).n_components(), false); mask[coarse_component] = true; extract_dofs (coarse_grid, ComponentMask(mask), coarse_dof_is_parameter); @@ -3246,7 +3226,7 @@ namespace DoFTools ConstraintMatrix &zero_boundary_constraints, const ComponentMask &component_mask) { - Assert (component_mask.represents_n_components(dof.get_fe().n_components()), + Assert (component_mask.represents_n_components(dof.get_finite_element(0).n_components()), ExcMessage ("The number of components in the mask has to be either " "zero or equal to the number of components in the finite " "element.")); diff --git a/source/dofs/dof_tools_sparsity.cc b/source/dofs/dof_tools_sparsity.cc index 4c2c05e2f3..9c8cd8cf49 100644 --- a/source/dofs/dof_tools_sparsity.cc +++ b/source/dofs/dof_tools_sparsity.cc @@ -125,10 +125,10 @@ namespace DoFTools ExcDimensionMismatch (sparsity.n_rows(), n_dofs)); Assert (sparsity.n_cols() == n_dofs, ExcDimensionMismatch (sparsity.n_cols(), n_dofs)); - Assert (couplings.n_rows() == dof.get_fe().n_components(), - ExcDimensionMismatch(couplings.n_rows(), dof.get_fe().n_components())); - Assert (couplings.n_cols() == dof.get_fe().n_components(), - ExcDimensionMismatch(couplings.n_cols(), dof.get_fe().n_components())); + Assert (couplings.n_rows() == dof.get_finite_element(0).n_components(), + ExcDimensionMismatch(couplings.n_rows(), dof.get_finite_element(0).n_components())); + Assert (couplings.n_cols() == dof.get_finite_element(0).n_components(), + ExcDimensionMismatch(couplings.n_cols(), dof.get_finite_element(0).n_components())); // If we have a distributed::Triangulation only allow locally_owned // subdomain. Not setting a subdomain is also okay, because we skip @@ -143,7 +143,7 @@ namespace DoFTools "associated DoF handler objects, asking for any subdomain other " "than the locally owned one does not make sense.")); - const hp::FECollection fe_collection (dof.get_fe()); + const hp::FECollection fe_collection (dof.get_fe_collection()); const std::vector > dof_mask //(fe_collection.size()) = dof_couplings_from_component_couplings (fe_collection, @@ -697,7 +697,7 @@ namespace DoFTools const types::subdomain_id subdomain_id) { const FiniteElement - &fe = dof.get_fe(); + &fe = dof.get_finite_element(); std::vector dofs_on_this_cell (fe.dofs_per_cell); std::vector dofs_on_other_cell (fe.dofs_per_cell); @@ -978,7 +978,7 @@ namespace DoFTools // consequently, the implementation here is simpler and probably // less efficient but at least readable... - const dealii::hp::FECollection &fe = dof.get_fe(); + const dealii::hp::FECollection &fe = dof.get_fe_collection(); std::vector dofs_on_this_cell(DoFTools::max_dofs_per_cell(dof)); std::vector dofs_on_other_cell(DoFTools::max_dofs_per_cell(dof)); @@ -1225,7 +1225,7 @@ namespace DoFTools // specialized functions in the internal namespace const types::global_dof_index n_dofs = dof.n_dofs(); (void)n_dofs; - const unsigned int n_comp = dof.get_fe().n_components(); + const unsigned int n_comp = dof.get_finite_element(0).n_components(); (void)n_comp; Assert (sparsity.n_rows() == n_dofs, diff --git a/source/fe/fe_values.cc b/source/fe/fe_values.cc index 3133c8a633..f36d21b3eb 100644 --- a/source/fe/fe_values.cc +++ b/source/fe/fe_values.cc @@ -4287,7 +4287,7 @@ FEFaceValues::reinit // this cell, are the same Assert (static_cast&>(*this->fe) == static_cast&>( - cell->get_dof_handler().get_fe()[cell->active_fe_index ()]), + cell->get_dof_handler().get_finite_element(cell->active_fe_index ())), (typename FEValuesBase::ExcFEDontMatch())); Assert (face_no < GeometryInfo::faces_per_cell, @@ -4454,7 +4454,7 @@ void FESubfaceValues::reinit // this cell, are the same Assert (static_cast&>(*this->fe) == static_cast&>( - cell->get_dof_handler().get_fe()[cell->active_fe_index ()]), + cell->get_dof_handler().get_finite_element(cell->active_fe_index ())), (typename FEValuesBase::ExcFEDontMatch())); Assert (face_no < GeometryInfo::faces_per_cell, ExcIndexRange (face_no, 0, GeometryInfo::faces_per_cell)); diff --git a/source/fe/mapping_fe_field.cc b/source/fe/mapping_fe_field.cc index decdef0fe6..3fa6f052a7 100644 --- a/source/fe/mapping_fe_field.cc +++ b/source/fe/mapping_fe_field.cc @@ -207,7 +207,7 @@ MappingFEField::MappingFEField const ComponentMask mask) : euler_vector(&euler_vector), - fe(&euler_dof_handler.get_fe()), + fe(&euler_dof_handler.get_finite_element()), euler_dof_handler(&euler_dof_handler), fe_mask(mask.size() ? mask : ComponentMask(fe->get_nonzero_components(0).size(), true)), diff --git a/source/fe/mapping_q1_eulerian.cc b/source/fe/mapping_q1_eulerian.cc index b8c9f1c0a3..c3045d7582 100644 --- a/source/fe/mapping_q1_eulerian.cc +++ b/source/fe/mapping_q1_eulerian.cc @@ -59,8 +59,8 @@ get_vertices // object is constructed, which is not necessarily what we want. //TODO: Only one of these two assertions should be relevant - AssertDimension (spacedim, shiftmap_dof_handler->get_fe().n_dofs_per_vertex()); - AssertDimension (shiftmap_dof_handler->get_fe().n_components(), spacedim); + AssertDimension (spacedim, shiftmap_dof_handler->get_finite_element().n_dofs_per_vertex()); + AssertDimension (shiftmap_dof_handler->get_finite_element(0).n_components(), spacedim); AssertDimension (shiftmap_dof_handler->n_dofs(), euler_transform_vectors->size()); @@ -74,7 +74,7 @@ get_vertices Assert (dof_cell->active() == true, ExcInactiveCell()); // now get the values of the shift vectors at the vertices - Vector mapping_values (shiftmap_dof_handler->get_fe().dofs_per_cell); + Vector mapping_values (shiftmap_dof_handler->get_finite_element().dofs_per_cell); dof_cell->get_dof_values (*euler_transform_vectors, mapping_values); for (unsigned int i=0; i::vertices_per_cell; ++i) diff --git a/source/fe/mapping_q_eulerian.cc b/source/fe/mapping_q_eulerian.cc index defebfd2f2..0f95420b86 100644 --- a/source/fe/mapping_q_eulerian.cc +++ b/source/fe/mapping_q_eulerian.cc @@ -47,7 +47,7 @@ MappingQEulerianGeneric (const unsigned int degr MappingQGeneric(degree), mapping_q_eulerian (mapping_q_eulerian), support_quadrature(degree), - fe_values(mapping_q_eulerian.euler_dof_handler->get_fe(), + fe_values(mapping_q_eulerian.euler_dof_handler->get_finite_element(), support_quadrature, update_values | update_quadrature_points) {} @@ -197,7 +197,7 @@ compute_mapping_support_points (const typename Triangulation::cell // or create a separate dof handler for the displacements. const unsigned int n_support_pts = support_quadrature.size(); - const unsigned int n_components = mapping_q_eulerian.euler_dof_handler->get_fe().n_components(); + const unsigned int n_components = mapping_q_eulerian.euler_dof_handler->get_finite_element(0).n_components(); Assert (n_components >= spacedim, ExcDimensionMismatch(n_components, spacedim) ); diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index 91728bb39b..1b41e5927b 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -1636,7 +1636,7 @@ next_cell: const Point &p) { Assert ((mapping.size() == 1) || - (mapping.size() == mesh.get_fe().size()), + (mapping.size() == mesh.get_fe_collection().size()), ExcMessage ("Mapping collection needs to have either size 1 " "or size equal to the number of elements in " "the FECollection.")); diff --git a/source/hp/dof_handler.cc b/source/hp/dof_handler.cc index d0e8ab3eab..fe262e1664 100644 --- a/source/hp/dof_handler.cc +++ b/source/hp/dof_handler.cc @@ -1131,7 +1131,7 @@ namespace hp std::set boundary_dofs; std::vector dofs_on_face; - dofs_on_face.reserve (this->get_fe ().max_dofs_per_face()); + dofs_on_face.reserve (this->get_fe_collection().max_dofs_per_face()); // loop over all faces to check whether they are at a // boundary. note that we need not take special care of single @@ -1169,7 +1169,7 @@ namespace hp // indicators std::set boundary_dofs; std::vector dofs_on_face; - dofs_on_face.reserve (this->get_fe ().max_dofs_per_face()); + dofs_on_face.reserve (this->get_fe_collection().max_dofs_per_face()); typename HpDoFHandler::active_cell_iterator cell = this->begin_active (), endc = this->end(); diff --git a/source/multigrid/mg_tools.cc b/source/multigrid/mg_tools.cc index b848fbdf8e..ea8ad58447 100644 --- a/source/multigrid/mg_tools.cc +++ b/source/multigrid/mg_tools.cc @@ -548,7 +548,7 @@ namespace MGTools Assert (sparsity.n_cols() == n_dofs, ExcDimensionMismatch (sparsity.n_cols(), n_dofs)); - const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = dof.get_finite_element().dofs_per_cell; std::vector dofs_on_this_cell(dofs_per_cell); typename DoFHandlerType::cell_iterator cell = dof.begin(level), endc = dof.end(level); @@ -581,7 +581,7 @@ namespace MGTools Assert (sparsity.n_cols() == n_dofs, ExcDimensionMismatch (sparsity.n_cols(), n_dofs)); - const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = dof.get_finite_element().dofs_per_cell; std::vector dofs_on_this_cell(dofs_per_cell); std::vector dofs_on_other_cell(dofs_per_cell); typename DoFHandler::cell_iterator cell = dof.begin(level), @@ -663,7 +663,7 @@ namespace MGTools Assert (sparsity.n_cols() == fine_dofs, ExcDimensionMismatch (sparsity.n_cols(), fine_dofs)); - const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = dof.get_finite_element().dofs_per_cell; std::vector dofs_on_this_cell(dofs_per_cell); std::vector dofs_on_other_cell(dofs_per_cell); typename DoFHandler::cell_iterator cell = dof.begin(level), @@ -718,7 +718,7 @@ namespace MGTools const Table<2,DoFTools::Coupling> &int_mask, const Table<2,DoFTools::Coupling> &flux_mask) { - const FiniteElement &fe = dof.get_fe(); + const FiniteElement &fe = dof.get_finite_element(); const types::global_dof_index n_dofs = dof.n_dofs(level); const unsigned int n_comp = fe.n_components(); (void)n_dofs; @@ -899,7 +899,7 @@ namespace MGTools const unsigned int level, const Table<2,DoFTools::Coupling> &flux_mask) { - const FiniteElement &fe = dof.get_fe(); + const FiniteElement &fe = dof.get_finite_element(); const unsigned int n_comp = fe.n_components(); (void)n_comp; @@ -922,7 +922,7 @@ namespace MGTools Assert (flux_mask.n_cols() == n_comp, ExcDimensionMismatch (flux_mask.n_cols(), n_comp)); - const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = dof.get_finite_element().dofs_per_cell; std::vector dofs_on_this_cell(dofs_per_cell); std::vector dofs_on_other_cell(dofs_per_cell); Table<2,bool> support_on_face(dofs_per_cell, GeometryInfo::faces_per_cell); @@ -989,7 +989,7 @@ namespace MGTools bool only_once, std::vector target_component) { - const FiniteElement &fe = dof_handler.get_fe(); + const FiniteElement &fe = dof_handler.get_finite_element(); const unsigned int n_components = fe.n_components(); const unsigned int nlevels = dof_handler.get_triangulation().n_global_levels(); @@ -1071,7 +1071,7 @@ namespace MGTools } } // finally sanity check - Assert (!dof_handler.get_fe().is_primitive() + Assert (!dof_handler.get_finite_element().is_primitive() || std::accumulate (result[l].begin(), result[l].end(), 0U) @@ -1091,7 +1091,7 @@ namespace MGTools std::vector > &dofs_per_block, std::vector target_block) { - const FiniteElement &fe = dof_handler.get_fe(); + const FiniteElement &fe = dof_handler.get_finite_element(); const unsigned int n_blocks = fe.n_blocks(); const unsigned int n_levels = dof_handler.get_triangulation().n_global_levels(); @@ -1366,7 +1366,7 @@ namespace MGTools ExcDimensionMismatch (non_interface_dofs.size(), mg_dof_handler.get_triangulation().n_global_levels())); - const FiniteElement &fe = mg_dof_handler.get_fe(); + const FiniteElement &fe = mg_dof_handler.get_finite_element(); const unsigned int dofs_per_cell = fe.dofs_per_cell; const unsigned int dofs_per_face = fe.dofs_per_face; @@ -1438,7 +1438,7 @@ namespace MGTools std::vector > tmp_interface_dofs(interface_dofs.size()); - const FiniteElement &fe = mg_dof_handler.get_fe(); + const FiniteElement &fe = mg_dof_handler.get_finite_element(); const unsigned int dofs_per_cell = fe.dofs_per_cell; const unsigned int dofs_per_face = fe.dofs_per_face; diff --git a/source/multigrid/mg_transfer_block.cc b/source/multigrid/mg_transfer_block.cc index ebae1c360a..c7bf27f1c4 100644 --- a/source/multigrid/mg_transfer_block.cc +++ b/source/multigrid/mg_transfer_block.cc @@ -100,7 +100,7 @@ namespace const unsigned int selected_block, std::vector > &ndofs) { - const unsigned int n_blocks = mg_dof.get_fe().n_blocks(); + const unsigned int n_blocks = mg_dof.get_finite_element().n_blocks(); Assert(selected_block < n_blocks, ExcIndexRange(selected_block, 0, n_blocks)); std::vector selected(n_blocks, false); @@ -198,7 +198,7 @@ void MGTransferBlockBase::build_matrices ( const DoFHandler &, const DoFHandler &mg_dof) { - const FiniteElement &fe = mg_dof.get_fe(); + const FiniteElement &fe = mg_dof.get_finite_element(); const unsigned int n_blocks = fe.n_blocks(); const unsigned int dofs_per_cell = fe.dofs_per_cell; const unsigned int n_levels = mg_dof.get_triangulation().n_levels(); @@ -336,7 +336,7 @@ void MGTransferBlockBase::build_matrices ( // prolongation matrix for // this child const FullMatrix &prolongation - = mg_dof.get_fe().get_prolongation_matrix (child, cell->refinement_case()); + = mg_dof.get_finite_element().get_prolongation_matrix (child, cell->refinement_case()); cell->child(child)->get_mg_dof_indices (dof_indices_child); @@ -375,7 +375,7 @@ void MGTransferBlockBase::build_matrices ( // prolongation matrix for // this child const FullMatrix &prolongation - = mg_dof.get_fe().get_prolongation_matrix (child, cell->refinement_case()); + = mg_dof.get_finite_element().get_prolongation_matrix (child, cell->refinement_case()); cell->child(child)->get_mg_dof_indices (dof_indices_child); @@ -454,8 +454,8 @@ void MGTransferBlockSelect::build_matrices ( const DoFHandler &mg_dof, unsigned int select) { - const FiniteElement &fe = mg_dof.get_fe(); - unsigned int n_blocks = mg_dof.get_fe().n_blocks(); + const FiniteElement &fe = mg_dof.get_finite_element(); + unsigned int n_blocks = mg_dof.get_finite_element().n_blocks(); selected_block = select; selected.resize(n_blocks, false); @@ -538,8 +538,8 @@ void MGTransferBlock::build_matrices ( const DoFHandler &mg_dof, const std::vector &sel) { - const FiniteElement &fe = mg_dof.get_fe(); - unsigned int n_blocks = mg_dof.get_fe().n_blocks(); + const FiniteElement &fe = mg_dof.get_finite_element(); + unsigned int n_blocks = mg_dof.get_finite_element().n_blocks(); if (sel.size() != 0) { diff --git a/source/multigrid/mg_transfer_component.cc b/source/multigrid/mg_transfer_component.cc index 5c2d2617b6..f754231ac6 100644 --- a/source/multigrid/mg_transfer_component.cc +++ b/source/multigrid/mg_transfer_component.cc @@ -85,7 +85,7 @@ namespace { std::vector selected=sel; std::vector target_component=target_comp; - const unsigned int ncomp = mg_dof.get_fe().n_components(); + const unsigned int ncomp = mg_dof.get_finite_element(0).n_components(); // If the selected and // target_component have size 0, @@ -260,16 +260,16 @@ void MGTransferComponentBase::build_matrices ( // is empty if (target_component.size() == 0) { - target_component.resize(mg_dof.get_fe().n_components()); + target_component.resize(mg_dof.get_finite_element(0).n_components()); for (unsigned int i=0; i &fe = mg_dof.get_fe(); + const FiniteElement &fe = mg_dof.get_finite_element(); // Effective number of components // is the maximum entry in @@ -432,7 +432,7 @@ void MGTransferComponentBase::build_matrices ( // prolongation matrix for // this child const FullMatrix &prolongation - = mg_dof.get_fe().get_prolongation_matrix (child, cell->refinement_case()); + = mg_dof.get_finite_element().get_prolongation_matrix (child, cell->refinement_case()); cell->child(child)->get_mg_dof_indices (dof_indices_child); @@ -469,7 +469,7 @@ void MGTransferComponentBase::build_matrices ( // prolongation matrix for // this child const FullMatrix &prolongation - = mg_dof.get_fe().get_prolongation_matrix (child, cell->refinement_case()); + = mg_dof.get_finite_element().get_prolongation_matrix (child, cell->refinement_case()); cell->child(child)->get_mg_dof_indices (dof_indices_child); @@ -553,8 +553,8 @@ void MGTransferSelect::build_matrices ( const std::vector &mg_t_component, const std::vector > &bdry_indices) { - const FiniteElement &fe = mg_dof.get_fe(); - unsigned int ncomp = mg_dof.get_fe().n_components(); + const FiniteElement &fe = mg_dof.get_finite_element(); + unsigned int ncomp = mg_dof.get_finite_element(0).n_components(); target_component = t_component; mg_target_component = mg_t_component; diff --git a/source/multigrid/mg_transfer_internal.cc b/source/multigrid/mg_transfer_internal.cc index 9d157ddf49..75e7dfff91 100644 --- a/source/multigrid/mg_transfer_internal.cc +++ b/source/multigrid/mg_transfer_internal.cc @@ -82,7 +82,7 @@ namespace internal IndexSet globally_relevant; DoFTools::extract_locally_relevant_dofs(mg_dof, globally_relevant); - const unsigned int dofs_per_cell = mg_dof.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = mg_dof.get_finite_element().dofs_per_cell; std::vector global_dof_indices (dofs_per_cell); std::vector level_dof_indices (dofs_per_cell); @@ -395,10 +395,10 @@ namespace internal const dealii::DoFHandler &mg_dof) { // currently, we have only FE_Q and FE_DGQ type elements implemented - elem_info.n_components = mg_dof.get_fe().element_multiplicity(0); + elem_info.n_components = mg_dof.get_finite_element().element_multiplicity(0); AssertDimension(Utilities::fixed_power(fe.dofs_per_cell)*elem_info.n_components, - mg_dof.get_fe().dofs_per_cell); - AssertDimension(fe.degree, mg_dof.get_fe().degree); + mg_dof.get_finite_element().dofs_per_cell); + AssertDimension(fe.degree, mg_dof.get_finite_element().degree); elem_info.fe_degree = fe.degree; elem_info.element_is_continuous = fe.dofs_per_vertex > 0; Assert(fe.dofs_per_vertex < 2, ExcNotImplemented()); @@ -430,7 +430,7 @@ namespace internal elem_info.n_child_cell_dofs = elem_info.n_components*Utilities::fixed_power(n_child_dofs_1d); const Quadrature<1> dummy_quadrature(std::vector >(1, Point<1>())); internal::MatrixFreeFunctions::ShapeInfo shape_info; - shape_info.reinit(dummy_quadrature, mg_dof.get_fe(), 0); + shape_info.reinit(dummy_quadrature, mg_dof.get_finite_element(), 0); elem_info.lexicographic_numbering = shape_info.lexicographic_numbering; // step 1.4: get the 1d prolongation matrix and combine from both children @@ -494,8 +494,8 @@ namespace internal // ---------------------------- 1. Extract 1D info about the finite element // step 1.1: create a 1D copy of the finite element from FETools where we // substitute the template argument - AssertDimension(mg_dof.get_fe().n_base_elements(), 1); - std::string fe_name = mg_dof.get_fe().base_element(0).get_name(); + AssertDimension(mg_dof.get_finite_element().n_base_elements(), 1); + std::string fe_name = mg_dof.get_finite_element().base_element(0).get_name(); { const std::size_t template_starts = fe_name.find_first_of('<'); Assert (fe_name[template_starts+1] == (dim==1?'1':(dim==2?'2':'3')), @@ -518,7 +518,7 @@ namespace internal for (unsigned int level=0; level local_dof_indices(mg_dof.get_fe().dofs_per_cell); + std::vector local_dof_indices(mg_dof.get_finite_element().dofs_per_cell); dirichlet_indices.resize(n_levels-1); // We use the vectors stored ghosted_level_vector in the base class for @@ -616,13 +616,13 @@ namespace internal parent_index = start_index/elem_info.n_child_cell_dofs + tria.n_cells(level); parent_child_connect[level][child_index] = std::make_pair(parent_index, c); - AssertIndexRange(mg_dof.get_fe().dofs_per_cell, + AssertIndexRange(mg_dof.get_finite_element().dofs_per_cell, static_cast(-1)); // set Dirichlet boundary conditions (as a list of // constrained DoFs) for the child if (mg_constrained_dofs != nullptr) - for (unsigned int i=0; iis_boundary_index(level, local_dof_indices[elem_info.lexicographic_numbering[i]])) dirichlet_indices[level][child_index].push_back(i); @@ -660,7 +660,7 @@ namespace internal dirichlet_indices[0].emplace_back(); if (mg_constrained_dofs != nullptr) - for (unsigned int i=0; iis_boundary_index(0, local_dof_indices[elem_info.lexicographic_numbering[i]])) dirichlet_indices[0].back().push_back(i); } diff --git a/source/multigrid/mg_transfer_prebuilt.cc b/source/multigrid/mg_transfer_prebuilt.cc index 098eac5d3d..926137365e 100644 --- a/source/multigrid/mg_transfer_prebuilt.cc +++ b/source/multigrid/mg_transfer_prebuilt.cc @@ -151,7 +151,7 @@ void MGTransferPrebuilt::build_matrices (const DoFHandler &mg_dof) { const unsigned int n_levels = mg_dof.get_triangulation().n_global_levels(); - const unsigned int dofs_per_cell = mg_dof.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = mg_dof.get_finite_element().dofs_per_cell; this->sizes.resize(n_levels); for (unsigned int l=0; l::build_matrices { // set an alias to the prolongation matrix for this child const FullMatrix &prolongation - = mg_dof.get_fe().get_prolongation_matrix (child, - cell->refinement_case()); + = mg_dof.get_finite_element().get_prolongation_matrix (child, + cell->refinement_case()); Assert (prolongation.n() != 0, ExcNoProlongation()); @@ -274,8 +274,8 @@ void MGTransferPrebuilt::build_matrices { // set an alias to the prolongation matrix for this child prolongation - = mg_dof.get_fe().get_prolongation_matrix (child, - cell->refinement_case()); + = mg_dof.get_finite_element().get_prolongation_matrix (child, + cell->refinement_case()); if (this->mg_constrained_dofs != nullptr && this->mg_constrained_dofs->have_boundary_indices()) diff --git a/source/numerics/data_out_stack.cc b/source/numerics/data_out_stack.cc index 9a786137e5..ae53e75c7d 100644 --- a/source/numerics/data_out_stack.cc +++ b/source/numerics/data_out_stack.cc @@ -135,7 +135,7 @@ template void DataOutStack::add_data_vector (const Vector &vec, const std::string &name) { - const unsigned int n_components = dof_handler->get_fe().n_components (); + const unsigned int n_components = dof_handler->get_finite_element(0).n_components (); std::vector names; // if only one component or vector @@ -176,9 +176,9 @@ void DataOutStack::add_data_vector (const Vectorn_dofs()) && - (names.size() == dof_handler->get_fe().n_components())), + (names.size() == dof_handler->get_finite_element(0).n_components())), Exceptions::DataOut::ExcInvalidNumberOfNames (names.size(), - dof_handler->get_fe().n_components())); + dof_handler->get_finite_element(0).n_components())); for (unsigned int i=0; i::build_patches (const unsigned in this->validate_dataset_names(); - const unsigned int n_components = dof_handler->get_fe().n_components(); + const unsigned int n_components = dof_handler->get_finite_element(0).n_components(); const unsigned int n_datasets = dof_data.size() * n_components + cell_data.size(); @@ -275,11 +275,11 @@ void DataOutStack::build_patches (const unsigned in // single quadratures, // and finite elements. if we have // an hp DoFHandler, - // dof_handler.get_fe() returns a + // dof_handler.get_finite_element() returns a // collection of which we do a // shallow copy instead const hp::QCollection q_collection (patch_points); - const hp::FECollection fe_collection(dof_handler->get_fe()); + const hp::FECollection fe_collection(dof_handler->get_fe_collection()); hp::FEValues x_fe_patch_values (fe_collection, q_collection, update_values); diff --git a/source/numerics/derivative_approximation.cc b/source/numerics/derivative_approximation.cc index 35dc8f5fdb..c77d601186 100644 --- a/source/numerics/derivative_approximation.cc +++ b/source/numerics/derivative_approximation.cc @@ -774,11 +774,11 @@ namespace DerivativeApproximation // single quadratures, mappings, // and finite elements. if we have // an hp DoFHandler, - // dof_handler.get_fe() returns a + // dof_handler.get_finite_element() returns a // collection of which we do a // shallow copy instead const hp::QCollection q_collection (midpoint_rule); - const hp::FECollection fe_collection(dof_handler.get_fe()); + const hp::FECollection fe_collection(dof_handler.get_fe_collection()); const hp::MappingCollection mapping_collection (mapping); hp::FEValues x_fe_midpoint_value (mapping_collection, fe_collection, @@ -977,8 +977,8 @@ namespace DerivativeApproximation Assert (derivative_norm.size() == dof_handler.get_triangulation().n_active_cells(), ExcVectorLengthVsNActiveCells (derivative_norm.size(), dof_handler.get_triangulation().n_active_cells())); - Assert (component < dof_handler.get_fe().n_components(), - ExcIndexRange (component, 0, dof_handler.get_fe().n_components())); + Assert (component < dof_handler.get_finite_element(0).n_components(), + ExcIndexRange (component, 0, dof_handler.get_finite_element(0).n_components())); typedef std::tuple, false> >, diff --git a/source/numerics/error_estimator_1d.cc b/source/numerics/error_estimator_1d.cc index baef5624eb..230c2979e3 100644 --- a/source/numerics/error_estimator_1d.cc +++ b/source/numerics/error_estimator_1d.cc @@ -248,7 +248,7 @@ estimate (const Mapping<1,spacedim> &mapping, = subdomain_id_; #endif - const unsigned int n_components = dof_handler.get_fe().n_components(); + const unsigned int n_components = dof_handler.get_finite_element(0).n_components(); const unsigned int n_solution_vectors = solutions.size(); // sanity checks @@ -324,7 +324,7 @@ estimate (const Mapping<1,spacedim> &mapping, const QGauss<0> face_quadrature(1); const hp::QCollection<0> q_face_collection(face_quadrature); - const hp::FECollection<1,spacedim> fe (dof_handler.get_fe()); + const hp::FECollection<1,spacedim> fe (dof_handler.get_fe_collection()); hp::MappingCollection<1,spacedim> mapping_collection; mapping_collection.push_back (mapping); diff --git a/source/numerics/point_value_history.cc b/source/numerics/point_value_history.cc index 61ce839040..c4f175b2c6 100644 --- a/source/numerics/point_value_history.cc +++ b/source/numerics/point_value_history.cc @@ -191,7 +191,7 @@ void PointValueHistory // Implementation assumes that support // points locations are dofs locations - AssertThrow (dof_handler->get_fe ().has_support_points (), ExcNotImplemented ()); + AssertThrow (dof_handler->get_finite_element().has_support_points (), ExcNotImplemented ()); // While in general quadrature points seems // to refer to Gauss quadrature points, in @@ -199,14 +199,14 @@ void PointValueHistory // forced to be the support points of the // FE. Quadrature - support_point_quadrature (dof_handler->get_fe ().get_unit_support_points ()); - FEValues fe_values (dof_handler->get_fe (), + support_point_quadrature (dof_handler->get_finite_element().get_unit_support_points ()); + FEValues fe_values (dof_handler->get_finite_element(), support_point_quadrature, update_quadrature_points); unsigned int n_support_points - = dof_handler->get_fe ().get_unit_support_points ().size (); + = dof_handler->get_finite_element().get_unit_support_points ().size (); unsigned int n_components - = dof_handler->get_fe ().n_components (); + = dof_handler->get_finite_element(0).n_components (); // set up a loop over all the cells in the // DoFHandler @@ -229,7 +229,7 @@ void PointValueHistory // setup valid data in the empty // vectors unsigned int component - = dof_handler->get_fe ().system_to_component_index (support_point).first; + = dof_handler->get_finite_element().system_to_component_index (support_point).first; current_points [component] = fe_values.quadrature_point (support_point); current_fe_index [component] = support_point; } @@ -252,7 +252,7 @@ void PointValueHistory support_point < n_support_points; support_point++) { unsigned int component - = dof_handler->get_fe ().system_to_component_index (support_point).first; + = dof_handler->get_finite_element().system_to_component_index (support_point).first; Point test_point = fe_values.quadrature_point (support_point); @@ -269,7 +269,7 @@ void PointValueHistory std::vector - local_dof_indices (dof_handler->get_fe ().dofs_per_cell); + local_dof_indices (dof_handler->get_finite_element().dofs_per_cell); std::vector new_solution_indices; current_cell->get_dof_indices (local_dof_indices); // there is an implicit assumption here @@ -292,7 +292,7 @@ void PointValueHistory // a vector of points, and does not seem to // be intrinsicly faster than this method. for (unsigned int component = 0; - component < dof_handler->get_fe ().n_components (); component++) + component < dof_handler->get_finite_element(0).n_components (); component++) { new_solution_indices .push_back (local_dof_indices[current_fe_index [component]]); @@ -334,17 +334,17 @@ void PointValueHistory // Implementation assumes that support // points locations are dofs locations - AssertThrow (dof_handler->get_fe ().has_support_points (), ExcNotImplemented ()); + AssertThrow (dof_handler->get_finite_element().has_support_points (), ExcNotImplemented ()); // While in general quadrature points seems // to refer to Gauss quadrature points, in // this case the quadrature points are // forced to be the support points of the // FE. - Quadrature support_point_quadrature (dof_handler->get_fe ().get_unit_support_points ()); - FEValues fe_values (dof_handler->get_fe (), support_point_quadrature, update_quadrature_points); - unsigned int n_support_points = dof_handler->get_fe ().get_unit_support_points ().size (); - unsigned int n_components = dof_handler->get_fe ().n_components (); + Quadrature support_point_quadrature (dof_handler->get_finite_element().get_unit_support_points ()); + FEValues fe_values (dof_handler->get_finite_element(), support_point_quadrature, update_quadrature_points); + unsigned int n_support_points = dof_handler->get_finite_element().get_unit_support_points ().size (); + unsigned int n_components = dof_handler->get_finite_element(0).n_components (); // set up a loop over all the cells in the // DoFHandler @@ -367,7 +367,7 @@ void PointValueHistory { // setup valid data in the empty // vectors - unsigned int component = dof_handler->get_fe ().system_to_component_index (support_point).first; + unsigned int component = dof_handler->get_finite_element().system_to_component_index (support_point).first; temp_points [component] = fe_values.quadrature_point (support_point); temp_fe_index [component] = support_point; } @@ -388,7 +388,7 @@ void PointValueHistory fe_values.reinit (cell); for (unsigned int support_point = 0; support_point < n_support_points; support_point++) { - unsigned int component = dof_handler->get_fe ().system_to_component_index (support_point).first; + unsigned int component = dof_handler->get_finite_element().system_to_component_index (support_point).first; Point test_point = fe_values.quadrature_point (support_point); for (unsigned int point = 0; point < locations.size (); point++) @@ -404,13 +404,13 @@ void PointValueHistory } } - std::vector local_dof_indices (dof_handler->get_fe ().dofs_per_cell); + std::vector local_dof_indices (dof_handler->get_finite_element().dofs_per_cell); for (unsigned int point = 0; point < locations.size (); point++) { current_cell[point]->get_dof_indices (local_dof_indices); std::vector new_solution_indices; - for (unsigned int component = 0; component < dof_handler->get_fe ().n_components (); component++) + for (unsigned int component = 0; component < dof_handler->get_finite_element(0).n_components (); component++) { new_solution_indices.push_back (local_dof_indices[current_fe_index[point][component]]); } @@ -454,7 +454,7 @@ void PointValueHistory component_mask.insert (std::make_pair (vector_name, mask)); else component_mask.insert (std::make_pair (vector_name, - ComponentMask(std::vector(dof_handler->get_fe().n_components(), true)))); + ComponentMask(std::vector(dof_handler->get_finite_element(0).n_components(), true)))); // insert an empty vector of strings // to ensure each field has an entry @@ -471,7 +471,7 @@ void PointValueHistory ? mask.n_selected_components() : - dof_handler->get_fe().n_components()); + dof_handler->get_finite_element(0).n_components()); int n_datastreams = point_geometry_data.size () * n_stored; // each point has n_stored sub parts std::vector < std::vector > vector_size (n_datastreams, @@ -576,7 +576,7 @@ PointValueHistory::evaluate_field (const std::string &vector_name, typename std::map ::iterator mask = component_mask.find(vector_name); Assert (mask != component_mask.end(), ExcMessage("vector_name not in class")); - unsigned int n_stored = mask->second.n_selected_components(dof_handler->get_fe ().n_components ()); + unsigned int n_stored = mask->second.n_selected_components(dof_handler->get_finite_element(0).n_components ()); typename std::vector >::iterator point = point_geometry_data.begin (); for (unsigned int data_store_index = 0; point != point_geometry_data.end (); ++point, ++data_store_index) @@ -586,7 +586,7 @@ PointValueHistory::evaluate_field (const std::string &vector_name, // access the data associated with // those components - for (unsigned int store_index = 0, comp = 0; comp < dof_handler->get_fe ().n_components (); comp++) + for (unsigned int store_index = 0, comp = 0; comp < dof_handler->get_finite_element(0).n_components (); comp++) { if (mask->second[comp]) { @@ -626,8 +626,8 @@ PointValueHistory::evaluate_field (const std::vector &vector_ Assert (!(update_flags & update_normal_vectors), ExcMessage("The update of normal vectors may not be requested for evaluation of " "data on cells via DataPostprocessor.")); - FEValues fe_values (dof_handler->get_fe (), quadrature, update_flags); - unsigned int n_components = dof_handler->get_fe ().n_components (); + FEValues fe_values (dof_handler->get_finite_element(), quadrature, update_flags); + unsigned int n_components = dof_handler->get_finite_element(0).n_components (); unsigned int n_quadrature_points = quadrature.size(); unsigned int n_output_variables = data_postprocessor.get_names().size(); @@ -837,10 +837,10 @@ void PointValueHistory typename std::map ::iterator mask = component_mask.find(vector_name); Assert (mask != component_mask.end(), ExcMessage("vector_name not in class")); - unsigned int n_stored = mask->second.n_selected_components(dof_handler->get_fe ().n_components ()); + unsigned int n_stored = mask->second.n_selected_components(dof_handler->get_finite_element(0).n_components ()); typename std::vector >::iterator point = point_geometry_data.begin (); - Vector value (dof_handler->get_fe().n_components()); + Vector value (dof_handler->get_finite_element(0).n_components()); for (unsigned int data_store_index = 0; point != point_geometry_data.end (); ++point, ++data_store_index) { // Make a Vector for the value @@ -984,7 +984,7 @@ void PointValueHistory // comments to_gnuplot << "# Requested location: " << point->requested_location << "\n"; to_gnuplot << "# DoF_index : Support location (for each component)\n"; - for (unsigned int component = 0; component < dof_handler->get_fe ().n_components (); component++) + for (unsigned int component = 0; component < dof_handler->get_finite_element(0).n_components (); component++) { to_gnuplot << "# " << point->solution_indices[component] << " : " << point->support_point_locations [component] << "\n"; } @@ -1090,7 +1090,7 @@ Vector PointValueHistory typename std::vector >::iterator point = point_geometry_data.begin (); for (; point != point_geometry_data.end (); ++point) { - for (unsigned int component = 0; component < dof_handler->get_fe ().n_components (); component++) + for (unsigned int component = 0; component < dof_handler->get_finite_element(0).n_components (); component++) { dof_vector (point->solution_indices[component]) = 1; } @@ -1135,7 +1135,7 @@ void PointValueHistory locations = std::vector > (); - FEValues fe_values (dof_handler->get_fe (), quadrature, update_quadrature_points); + FEValues fe_values (dof_handler->get_finite_element(), quadrature, update_quadrature_points); unsigned int n_quadrature_points = quadrature.size(); std::vector > evaluation_points; @@ -1191,7 +1191,7 @@ void PointValueHistory { out << "# Requested location: " << point->requested_location << "\n"; out << "# DoF_index : Support location (for each component)\n"; - for (unsigned int component = 0; component < dof_handler->get_fe ().n_components (); component++) + for (unsigned int component = 0; component < dof_handler->get_finite_element(0).n_components (); component++) { out << point->solution_indices[component] << " : " << point->support_point_locations [component] << "\n"; } diff --git a/source/numerics/solution_transfer.cc b/source/numerics/solution_transfer.cc index 8f6b8add53..04a711f2fb 100644 --- a/source/numerics/solution_transfer.cc +++ b/source/numerics/solution_transfer.cc @@ -148,7 +148,7 @@ SolutionTransfer::refine_interpolate // function { const unsigned int this_fe_index = pointerstruct->second.active_fe_index; - const unsigned int dofs_per_cell=cell->get_dof_handler().get_fe()[this_fe_index].dofs_per_cell; + const unsigned int dofs_per_cell=cell->get_dof_handler().get_finite_element(this_fe_index).dofs_per_cell; local_values.reinit(dofs_per_cell, true); // make sure that the size of the stored indices is the same as @@ -191,7 +191,7 @@ namespace internal void extract_interpolation_matrices (const dealii::hp::DoFHandler &dof, dealii::Table<2,FullMatrix > &matrices) { - const dealii::hp::FECollection &fe = dof.get_fe(); + const dealii::hp::FECollection &fe = dof.get_fe_collection(); matrices.reinit (fe.size(), fe.size()); for (unsigned int i=0; i &all_in) std::vector > restriction_is_additive; internal::extract_interpolation_matrices (*dof_handler, interpolation_hp); - internal::restriction_additive (dof_handler->get_fe(), restriction_is_additive); + internal::restriction_additive (dof_handler->get_fe_collection(), restriction_is_additive); // we need counters for // the 'to_stay_or_refine' cells 'n_sr' and @@ -362,9 +362,9 @@ prepare_for_coarsening_and_refinement(const std::vector &all_in) if (cell->child(child)->get_fe().dofs_per_cell > cell->child(most_general_child)->get_fe().dofs_per_cell) most_general_child = child; - const unsigned int target_fe_index = cell->child(most_general_child)->active_fe_index(); + const unsigned int target_finite_element_index = cell->child(most_general_child)->active_fe_index(); - const unsigned int dofs_per_cell=cell->get_dof_handler().get_fe()[target_fe_index].dofs_per_cell; + const unsigned int dofs_per_cell=cell->get_dof_handler().get_finite_element(target_finite_element_index).dofs_per_cell; std::vector >(in_size, Vector(dofs_per_cell)) @@ -378,9 +378,9 @@ prepare_for_coarsening_and_refinement(const std::vector &all_in) for (unsigned int j=0; jget_interpolated_dof_values(all_in[j], dof_values_on_cell[n_cf][j], - target_fe_index); + target_finite_element_index); cell_map[std::make_pair(cell->level(), cell->index())] - = Pointerstruct(&dof_values_on_cell[n_cf], target_fe_index); + = Pointerstruct(&dof_values_on_cell[n_cf], target_finite_element_index); ++n_cf; } } diff --git a/tests/numerics/data_out_11.debug.output b/tests/numerics/data_out_11.debug.output index ff48e342be..0d21cb56d9 100644 --- a/tests/numerics/data_out_11.debug.output +++ b/tests/numerics/data_out_11.debug.output @@ -1,4 +1,4 @@ -DEAL::Exceptions::DataOut::ExcInvalidNumberOfNames (deduced_names.size(), dof_handler->get_fe().n_components()) -DEAL::Exceptions::DataOut::ExcInvalidNumberOfNames (deduced_names.size(), dof_handler->get_fe().n_components()) +DEAL::Exceptions::DataOut::ExcInvalidNumberOfNames (deduced_names.size(), dof_handler->get_finite_element(0).n_components()) +DEAL::Exceptions::DataOut::ExcInvalidNumberOfNames (deduced_names.size(), dof_handler->get_finite_element(0).n_components()) DEAL::OK