From 3208c349b33fafcadf06b01f93c0293185b23c03 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Sun, 10 Jul 2016 23:28:09 +0200 Subject: [PATCH] Replace get_fe_from_name by get_fe_by_name everywhere --- include/deal.II/fe/fe_tools.h | 12 +++++------ source/fe/fe_abf.cc | 2 +- source/fe/fe_bdm.cc | 2 +- source/fe/fe_bernstein.cc | 2 +- source/fe/fe_dg_vector.cc | 8 +++----- source/fe/fe_dgp.cc | 2 +- source/fe/fe_dgp_monomial.cc | 2 +- source/fe/fe_dgp_nonparametric.cc | 2 +- source/fe/fe_dgq.cc | 4 ++-- source/fe/fe_face.cc | 8 ++++---- source/fe/fe_nedelec.cc | 2 +- source/fe/fe_q.cc | 2 +- source/fe/fe_q_bubbles.cc | 2 +- source/fe/fe_q_dg0.cc | 2 +- source/fe/fe_q_hierarchical.cc | 2 +- source/fe/fe_q_iso_q1.cc | 2 +- source/fe/fe_raviart_thomas.cc | 2 +- source/fe/fe_raviart_thomas_nodal.cc | 2 +- source/fe/fe_system.cc | 2 +- source/fe/fe_tools.cc | 22 ++++++++++----------- source/fe/fe_tools.inst.in | 2 +- source/fe/fe_trace.cc | 4 ++-- source/multigrid/mg_transfer_matrix_free.cc | 2 +- tests/bits/fe_tools_09.cc | 6 +++--- tests/bits/fe_tools_10.cc | 6 +++--- tests/bits/fe_tools_11.cc | 6 +++--- tests/fe/fe_tools_01.cc | 2 +- tests/lac/constraints_block_01.cc | 4 ++-- 28 files changed, 57 insertions(+), 59 deletions(-) diff --git a/include/deal.II/fe/fe_tools.h b/include/deal.II/fe/fe_tools.h index 31227841ad..cbf3c2677e 100644 --- a/include/deal.II/fe/fe_tools.h +++ b/include/deal.II/fe/fe_tools.h @@ -67,7 +67,7 @@ namespace FETools * degree. Derived classes are called whenever one wants to have a * transparent way to create a finite element object. * - * This class is used in the FETools::get_fe_from_name() and + * This class is used in the FETools::get_fe_by_name() and * FETools::add_fe_name() functions. * * @author Guido Kanschat, 2006 @@ -1150,7 +1150,7 @@ namespace FETools /** * Extend the list of finite elements that can be generated by - * get_fe_from_name() by the one given as @p name. If get_fe_from_name() is + * get_fe_by_name() by the one given as @p name. If get_fe_by_name() is * later called with this name, it will use the object given as second * argument to create a finite element object. * @@ -1165,7 +1165,7 @@ namespace FETools * used anymore. * * In most cases, if you want objects of type MyFE be created - * whenever the name my_fe is given to get_fe_from_name, you + * whenever the name my_fe is given to get_fe_by_name, you * will want the second argument to this function be of type * FEFactory@, but you can of course create your custom finite * element factory class. @@ -1175,7 +1175,7 @@ namespace FETools * object will be deleted at the end of the program's lifetime. * * If the name of the element is already in use, an exception is thrown. - * Thus, functionality of get_fe_from_name() can only be added, not changed. + * Thus, functionality of get_fe_by_name() can only be added, not changed. * * @note This function manipulates a global table (one table for each space * dimension). It is thread safe in the sense that every access to this @@ -1195,7 +1195,7 @@ namespace FETools const FEFactoryBase *factory); /** - * The string used for get_fe_from_name() cannot be translated to a finite + * The string used for get_fe_by_name() cannot be translated to a finite * element. * * Either the string is badly formatted or you are using a custom element @@ -1209,7 +1209,7 @@ namespace FETools << arg1 << "'."); /** - * The string used for get_fe_from_name() cannot be translated to a finite + * The string used for get_fe_by_name() cannot be translated to a finite * element. * * Dimension arguments in finite element names should be avoided. If they diff --git a/source/fe/fe_abf.cc b/source/fe/fe_abf.cc index 32b7046a42..b7ccb126bb 100644 --- a/source/fe/fe_abf.cc +++ b/source/fe/fe_abf.cc @@ -110,7 +110,7 @@ std::string FE_ABF::get_name () const { // note that the - // FETools::get_fe_from_name + // FETools::get_fe_by_name // function depends on the // particular format of the string // this function returns, so they diff --git a/source/fe/fe_bdm.cc b/source/fe/fe_bdm.cc index b51b641ce2..46cd58045b 100644 --- a/source/fe/fe_bdm.cc +++ b/source/fe/fe_bdm.cc @@ -107,7 +107,7 @@ std::string FE_BDM::get_name () const { // note that the - // FETools::get_fe_from_name + // FETools::get_fe_by_name // function depends on the // particular format of the string // this function returns, so they diff --git a/source/fe/fe_bernstein.cc b/source/fe/fe_bernstein.cc index 6fd68ab662..5f01973433 100644 --- a/source/fe/fe_bernstein.cc +++ b/source/fe/fe_bernstein.cc @@ -304,7 +304,7 @@ template std::string FE_Bernstein::get_name () const { - // note that the FETools::get_fe_from_name function depends on the + // note that the FETools::get_fe_by_name function depends on the // particular format of the string this function returns, so they have to be // kept in synch diff --git a/source/fe/fe_dg_vector.cc b/source/fe/fe_dg_vector.cc index e657e5badc..43385f0044 100644 --- a/source/fe/fe_dg_vector.cc +++ b/source/fe/fe_dg_vector.cc @@ -32,9 +32,7 @@ template std::string FE_DGNedelec::get_name () const { - // note that the - // FETools::get_fe_from_name - // function depends on the + // note that the FETools::get_fe_by_nam function depends on the // particular format of the string // this function returns, so they // have to be kept in synch @@ -59,7 +57,7 @@ std::string FE_DGRaviartThomas::get_name () const { // note that the - // FETools::get_fe_from_name + // FETools::get_fe_by_name // function depends on the // particular format of the string // this function returns, so they @@ -85,7 +83,7 @@ std::string FE_DGBDM::get_name () const { // note that the - // FETools::get_fe_from_name + // FETools::get_fe_by_name // function depends on the // particular format of the string // this function returns, so they diff --git a/source/fe/fe_dgp.cc b/source/fe/fe_dgp.cc index 62d55adbb7..d9fc284278 100644 --- a/source/fe/fe_dgp.cc +++ b/source/fe/fe_dgp.cc @@ -48,7 +48,7 @@ template std::string FE_DGP::get_name () const { - // note that the FETools::get_fe_from_name function depends on the + // note that the FETools::get_fe_by_name function depends on the // particular format of the string this function returns, so they have to be // kept in sync diff --git a/source/fe/fe_dgp_monomial.cc b/source/fe/fe_dgp_monomial.cc index 9ad2899c1b..8a0d1e0df2 100644 --- a/source/fe/fe_dgp_monomial.cc +++ b/source/fe/fe_dgp_monomial.cc @@ -141,7 +141,7 @@ std::string FE_DGPMonomial::get_name () const { // note that the - // FETools::get_fe_from_name + // FETools::get_fe_by_name // function depends on the // particular format of the string // this function returns, so they diff --git a/source/fe/fe_dgp_nonparametric.cc b/source/fe/fe_dgp_nonparametric.cc index 584ed1cc33..70dbf84791 100644 --- a/source/fe/fe_dgp_nonparametric.cc +++ b/source/fe/fe_dgp_nonparametric.cc @@ -98,7 +98,7 @@ std::string FE_DGPNonparametric::get_name () const { // note that the - // FETools::get_fe_from_name + // FETools::get_fe_by_name // function depends on the // particular format of the string // this function returns, so they diff --git a/source/fe/fe_dgq.cc b/source/fe/fe_dgq.cc index 12c1973c4c..1eb6709a9d 100644 --- a/source/fe/fe_dgq.cc +++ b/source/fe/fe_dgq.cc @@ -94,7 +94,7 @@ template std::string FE_DGQ::get_name () const { - // note that the FETools::get_fe_from_name function depends on the + // note that the FETools::get_fe_by_name function depends on the // particular format of the string this function returns, so they have to be // kept in sync @@ -667,7 +667,7 @@ template std::string FE_DGQArbitraryNodes::get_name () const { - // note that the FETools::get_fe_from_name function does not work for + // note that the FETools::get_fe_by_name function does not work for // FE_DGQArbitraryNodes since there is no initialization by a degree value. std::ostringstream namebuf; bool equidistant = true; diff --git a/source/fe/fe_face.cc b/source/fe/fe_face.cc index 186dcbe03c..b0662792ff 100644 --- a/source/fe/fe_face.cc +++ b/source/fe/fe_face.cc @@ -114,7 +114,7 @@ template std::string FE_FaceQ::get_name () const { - // note that the FETools::get_fe_from_name function depends on the + // note that the FETools::get_fe_by_name function depends on the // particular format of the string this function returns, so they have to be // kept in synch std::ostringstream namebuf; @@ -341,7 +341,7 @@ template std::string FE_FaceQ<1,spacedim>::get_name () const { - // note that the FETools::get_fe_from_name function depends on the + // note that the FETools::get_fe_by_name function depends on the // particular format of the string this function returns, so they have to be // kept in synch std::ostringstream namebuf; @@ -539,7 +539,7 @@ template std::string FE_FaceP::get_name () const { - // note that the FETools::get_fe_from_name function depends on the + // note that the FETools::get_fe_by_name function depends on the // particular format of the string this function returns, so they have to be // kept in synch std::ostringstream namebuf; @@ -763,7 +763,7 @@ template std::string FE_FaceP<1,spacedim>::get_name () const { - // note that the FETools::get_fe_from_name function depends on the + // note that the FETools::get_fe_by_name function depends on the // particular format of the string this function returns, so they have to be // kept in synch std::ostringstream namebuf; diff --git a/source/fe/fe_nedelec.cc b/source/fe/fe_nedelec.cc index 2954d25e5d..1ef22756d3 100644 --- a/source/fe/fe_nedelec.cc +++ b/source/fe/fe_nedelec.cc @@ -192,7 +192,7 @@ std::string FE_Nedelec::get_name () const { // note that the - // FETools::get_fe_from_name + // FETools::get_fe_by_name // function depends on the // particular format of the string // this function returns, so they diff --git a/source/fe/fe_q.cc b/source/fe/fe_q.cc index 2147adffba..b4bb63eed5 100644 --- a/source/fe/fe_q.cc +++ b/source/fe/fe_q.cc @@ -75,7 +75,7 @@ template std::string FE_Q::get_name () const { - // note that the FETools::get_fe_from_name function depends on the + // note that the FETools::get_fe_by_name function depends on the // particular format of the string this function returns, so they have to be // kept in synch diff --git a/source/fe/fe_q_bubbles.cc b/source/fe/fe_q_bubbles.cc index 9868ae39ab..a7a7e6b86c 100644 --- a/source/fe/fe_q_bubbles.cc +++ b/source/fe/fe_q_bubbles.cc @@ -247,7 +247,7 @@ template std::string FE_Q_Bubbles::get_name () const { - // note that the FETools::get_fe_from_name function depends on the + // note that the FETools::get_fe_by_name function depends on the // particular format of the string this function returns, so they have to be // kept in synch diff --git a/source/fe/fe_q_dg0.cc b/source/fe/fe_q_dg0.cc index d2218eadc9..4e0fe23ab3 100644 --- a/source/fe/fe_q_dg0.cc +++ b/source/fe/fe_q_dg0.cc @@ -88,7 +88,7 @@ template std::string FE_Q_DG0::get_name () const { - // note that the FETools::get_fe_from_name function depends on the + // note that the FETools::get_fe_by_name function depends on the // particular format of the string this function returns, so they have to be // kept in synch diff --git a/source/fe/fe_q_hierarchical.cc b/source/fe/fe_q_hierarchical.cc index a3a7641eaa..f146a71825 100644 --- a/source/fe/fe_q_hierarchical.cc +++ b/source/fe/fe_q_hierarchical.cc @@ -110,7 +110,7 @@ std::string FE_Q_Hierarchical::get_name () const { // note that the - // FETools::get_fe_from_name + // FETools::get_fe_by_name // function depends on the // particular format of the string // this function returns, so they diff --git a/source/fe/fe_q_iso_q1.cc b/source/fe/fe_q_iso_q1.cc index 35747b15e6..4b2bb7f124 100644 --- a/source/fe/fe_q_iso_q1.cc +++ b/source/fe/fe_q_iso_q1.cc @@ -54,7 +54,7 @@ template std::string FE_Q_iso_Q1::get_name () const { - // note that the FETools::get_fe_from_name function depends on the + // note that the FETools::get_fe_by_name function depends on the // particular format of the string this function returns, so they have to be // kept in sync diff --git a/source/fe/fe_raviart_thomas.cc b/source/fe/fe_raviart_thomas.cc index 39b7b1e822..7503a5736f 100644 --- a/source/fe/fe_raviart_thomas.cc +++ b/source/fe/fe_raviart_thomas.cc @@ -111,7 +111,7 @@ std::string FE_RaviartThomas::get_name () const { // note that the - // FETools::get_fe_from_name + // FETools::get_fe_by_name // function depends on the // particular format of the string // this function returns, so they diff --git a/source/fe/fe_raviart_thomas_nodal.cc b/source/fe/fe_raviart_thomas_nodal.cc index 7a103be2a6..3556c6851a 100644 --- a/source/fe/fe_raviart_thomas_nodal.cc +++ b/source/fe/fe_raviart_thomas_nodal.cc @@ -108,7 +108,7 @@ std::string FE_RaviartThomasNodal::get_name () const { // note that the - // FETools::get_fe_from_name + // FETools::get_fe_by_name // function depends on the // particular format of the string // this function returns, so they diff --git a/source/fe/fe_system.cc b/source/fe/fe_system.cc index f51088b4cf..862dc641b1 100644 --- a/source/fe/fe_system.cc +++ b/source/fe/fe_system.cc @@ -292,7 +292,7 @@ std::string FESystem::get_name () const { // note that the - // FETools::get_fe_from_name + // FETools::get_fe_by_name // function depends on the // particular format of the string // this function returns, so they diff --git a/source/fe/fe_tools.cc b/source/fe/fe_tools.cc index 58e0bbc736..b297ab6ce2 100644 --- a/source/fe/fe_tools.cc +++ b/source/fe/fe_tools.cc @@ -1165,7 +1165,7 @@ namespace static Threads::Mutex fe_name_map_lock; - // This is the map used by FETools::get_fe_from_name and + // This is the map used by FETools::get_fe_by_name and // FETools::add_fe_name. It is only accessed by functions in this // file, so it is safe to make it a static variable here. It must be // static so that we can link several dimensions together. @@ -2262,10 +2262,10 @@ namespace FETools // smarter? template FiniteElement * - get_fe_from_name_ext (std::string &name, - const std::map > - &fe_name_map) + get_fe_by_name_ext (std::string &name, + const std::map > + &fe_name_map) { // Extract the name of the // finite element class, which only @@ -2309,8 +2309,8 @@ namespace FETools // Now, the name of the // first base element is // first... Let's get it - base_fes.push_back (get_fe_from_name_ext (name, - fe_name_map)); + base_fes.push_back (get_fe_by_name_ext (name, + fe_name_map)); // next check whether // FESystem placed a // multiplicity after @@ -2511,9 +2511,9 @@ namespace FETools template - FiniteElement *get_fe_from_name (std::string &name) + FiniteElement *get_fe_by_name (std::string &name) { - return get_fe_from_name_ext (name, fe_name_map[dim][spacedim]); + return get_fe_by_name_ext (name, fe_name_map[dim][spacedim]); } } } @@ -2591,7 +2591,7 @@ namespace FETools try { - FiniteElement *fe = internal::get_fe_from_name (name); + FiniteElement *fe = internal::get_fe_by_name (name); // Make sure the auxiliary function // ate up all characters of the name. @@ -2613,7 +2613,7 @@ namespace FETools template FiniteElement * - get_fe_from_name (const std::string ¶meter_name) + get_fe_by_name (const std::string ¶meter_name) { return get_fe_by_name (parameter_name); } diff --git a/source/fe/fe_tools.inst.in b/source/fe/fe_tools.inst.in index b87a95e25f..cab12e7e59 100644 --- a/source/fe/fe_tools.inst.in +++ b/source/fe/fe_tools.inst.in @@ -140,7 +140,7 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS template class FEFactoryBase; template FiniteElement * - get_fe_from_name (const std::string &); + get_fe_by_name (const std::string &); template void compute_node_matrix( diff --git a/source/fe/fe_trace.cc b/source/fe/fe_trace.cc index 1e0509ee29..78992e00ed 100644 --- a/source/fe/fe_trace.cc +++ b/source/fe/fe_trace.cc @@ -68,7 +68,7 @@ template std::string FE_TraceQ::get_name () const { - // note that the FETools::get_fe_from_name function depends on the + // note that the FETools::get_fe_by_name function depends on the // particular format of the string this function returns, so they have to be // kept in synch @@ -232,7 +232,7 @@ template std::string FE_TraceQ<1,spacedim>::get_name () const { - // note that the FETools::get_fe_from_name function depends on the + // note that the FETools::get_fe_by_name function depends on the // particular format of the string this function returns, so they have to be // kept in synch std::ostringstream namebuf; diff --git a/source/multigrid/mg_transfer_matrix_free.cc b/source/multigrid/mg_transfer_matrix_free.cc index 3c727441cc..b6857eb90e 100644 --- a/source/multigrid/mg_transfer_matrix_free.cc +++ b/source/multigrid/mg_transfer_matrix_free.cc @@ -235,7 +235,7 @@ void MGTransferMatrixFree::build fe_name[template_starts+1] = '1'; } std_cxx11::shared_ptr > fe_1d - (FETools::get_fe_from_name<1>(fe_name)); + (FETools::get_fe_by_name<1,1>(fe_name)); const FiniteElement<1> &fe = *fe_1d; unsigned int n_child_dofs_1d = numbers::invalid_unsigned_int; diff --git a/tests/bits/fe_tools_09.cc b/tests/bits/fe_tools_09.cc index 6a86c9e6b1..d058e3d72f 100644 --- a/tests/bits/fe_tools_09.cc +++ b/tests/bits/fe_tools_09.cc @@ -19,7 +19,7 @@ #include // check -// FETools::get_fe_from_name +// FETools::get_fe_by_name std::string output_file_name = "output"; @@ -39,7 +39,7 @@ check_this (const FiniteElement &fe1, // pretty good indication that the // two FEs are actually the same deallog << fe1.get_name(); - p1 = FETools::get_fe_from_name (fe1.get_name()); + p1 = FETools::get_fe_by_name (fe1.get_name()); AssertThrow (fe1.get_name() == p1->get_name(), ExcInternalError()); deallog << " ok" << std::endl; @@ -47,7 +47,7 @@ check_this (const FiniteElement &fe1, // same for fe2 deallog << fe2.get_name(); - p2 = FETools::get_fe_from_name (fe2.get_name()); + p2 = FETools::get_fe_by_name (fe2.get_name()); AssertThrow (fe2.get_name() == p2->get_name(), ExcInternalError()); deallog << " ok" << std::endl; diff --git a/tests/bits/fe_tools_10.cc b/tests/bits/fe_tools_10.cc index deeb254a28..915f4dbbbf 100644 --- a/tests/bits/fe_tools_10.cc +++ b/tests/bits/fe_tools_10.cc @@ -19,7 +19,7 @@ #include // check -// FETools::get_fe_from_name +// FETools::get_fe_by_name // like fe_tools_09, but with the difference that we use the generic // "" marker in the finite element name, instead of the one with // the concrete dimension (see the documentation) @@ -59,7 +59,7 @@ check_this (const FiniteElement &fe1, // pretty good indication that the // two FEs are actually the same deallog << modify_name (fe1.get_name()); - p1 = FETools::get_fe_from_name (modify_name (fe1.get_name())); + p1 = FETools::get_fe_by_name (modify_name (fe1.get_name())); AssertThrow (fe1.get_name() == p1->get_name(), ExcInternalError()); deallog << " ok" << std::endl; @@ -67,7 +67,7 @@ check_this (const FiniteElement &fe1, // same for fe2 deallog << modify_name (fe2.get_name()); - p2 = FETools::get_fe_from_name (modify_name (fe2.get_name())); + p2 = FETools::get_fe_by_name (modify_name (fe2.get_name())); AssertThrow (fe2.get_name() == p2->get_name(), ExcInternalError()); deallog << " ok" << std::endl; diff --git a/tests/bits/fe_tools_11.cc b/tests/bits/fe_tools_11.cc index 731d767ff1..dcd2918647 100644 --- a/tests/bits/fe_tools_11.cc +++ b/tests/bits/fe_tools_11.cc @@ -19,7 +19,7 @@ #include // check -// FETools::get_fe_from_name +// FETools::get_fe_by_name // like fe_tools_09 and fe_tools_10, but this time with no dimension // marker at all (see the documentation) @@ -58,7 +58,7 @@ check_this (const FiniteElement &fe1, // pretty good indication that the // two FEs are actually the same deallog << modify_name (fe1.get_name()); - p1 = FETools::get_fe_from_name (modify_name (fe1.get_name())); + p1 = FETools::get_fe_by_name (modify_name (fe1.get_name())); AssertThrow (fe1.get_name() == p1->get_name(), ExcInternalError()); deallog << " ok" << std::endl; @@ -66,7 +66,7 @@ check_this (const FiniteElement &fe1, // same for fe2 deallog << modify_name (fe2.get_name()); - p2 = FETools::get_fe_from_name (modify_name (fe2.get_name())); + p2 = FETools::get_fe_by_name (modify_name (fe2.get_name())); AssertThrow (fe2.get_name() == p2->get_name(), ExcInternalError()); deallog << " ok" << std::endl; diff --git a/tests/fe/fe_tools_01.cc b/tests/fe/fe_tools_01.cc index d9f5d90828..b5f9cd47bb 100644 --- a/tests/fe/fe_tools_01.cc +++ b/tests/fe/fe_tools_01.cc @@ -30,7 +30,7 @@ template void test_fe(const char *name) { - FiniteElement *fe = FETools::get_fe_from_name(std::string(name)); + FiniteElement *fe = FETools::get_fe_by_name(std::string(name)); deallog << fe->get_name() << std::endl << '\t' << fe->dofs_per_cell diff --git a/tests/lac/constraints_block_01.cc b/tests/lac/constraints_block_01.cc index fff3f93253..2c36c0bc3d 100644 --- a/tests/lac/constraints_block_01.cc +++ b/tests/lac/constraints_block_01.cc @@ -114,8 +114,8 @@ int main () std::string fluid_fe_name = "FESystem[FE_Nothing()^2-FE_Nothing()^2-FE_Q(2)^2-FE_Q(1)-FE_Q(2)^2]"; hp::FECollection fe_collection; - FiniteElement *solid_fe = FETools::get_fe_from_name(solid_fe_name); - FiniteElement *fluid_fe = FETools::get_fe_from_name(fluid_fe_name); + FiniteElement *solid_fe = FETools::get_fe_by_name(solid_fe_name); + FiniteElement *fluid_fe = FETools::get_fe_by_name(fluid_fe_name); deallog << "Solid FE Space: " << solid_fe->get_name() << std::endl; deallog << "Fluid/Mesh FE Space: " << fluid_fe->get_name() << std::endl; -- 2.39.5