From: Wolfgang Bangerth Date: Sun, 19 May 2024 14:42:10 +0000 (-0600) Subject: Avoid the use of deprecated functions. X-Git-Tag: v9.6.0-rc1~252^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d876c3baace06d148a54ea14eeb43ace1a5de59f;p=dealii.git Avoid the use of deprecated functions. --- diff --git a/source/fe/fe_system.cc b/source/fe/fe_system.cc index d54003b608..6825732313 100644 --- a/source/fe/fe_system.cc +++ b/source/fe/fe_system.cc @@ -296,16 +296,19 @@ template FESystem::FESystem(const FiniteElement &fe, const unsigned int n_elements) : FiniteElement( - FETools::Compositing::multiply_dof_numbers(&fe, n_elements), - FETools::Compositing::compute_restriction_is_additive_flags(&fe, - n_elements), - FETools::Compositing::compute_nonzero_components(&fe, n_elements)) + FETools::Compositing::multiply_dof_numbers({&fe}, + {n_elements}), + FETools::Compositing::compute_restriction_is_additive_flags( + {&fe}, + {n_elements}), + FETools::Compositing::compute_nonzero_components( + {&fe}, + {n_elements})) , base_elements((n_elements > 0)) { - std::vector *> fes; - fes.push_back(&fe); - std::vector multiplicities; - multiplicities.push_back(n_elements); + const std::vector *> fes = {&fe}; + const std::vector multiplicities = {n_elements}; initialize(fes, multiplicities); } @@ -317,20 +320,19 @@ FESystem::FESystem(const FiniteElement &fe1, const FiniteElement &fe2, const unsigned int n2) : FiniteElement( - FETools::Compositing::multiply_dof_numbers(&fe1, n1, &fe2, n2), - FETools::Compositing::compute_restriction_is_additive_flags(&fe1, - n1, - &fe2, - n2), - FETools::Compositing::compute_nonzero_components(&fe1, n1, &fe2, n2)) + FETools::Compositing::multiply_dof_numbers({&fe1, &fe2}, + {n1, n2}), + FETools::Compositing::compute_restriction_is_additive_flags( + {&fe1, &fe2}, + {n1, n2}), + FETools::Compositing::compute_nonzero_components({&fe1, + &fe2}, + {n1, n2})) , base_elements(static_cast(n1 > 0) + static_cast(n2 > 0)) { - std::vector *> fes; - fes.push_back(&fe1); - fes.push_back(&fe2); - std::vector multiplicities; - multiplicities.push_back(n1); - multiplicities.push_back(n2); + const std::vector *> fes = {&fe1, &fe2}; + const std::vector multiplicities = {n1, n2}; initialize(fes, multiplicities); } @@ -344,30 +346,23 @@ FESystem::FESystem(const FiniteElement &fe1, const FiniteElement &fe3, const unsigned int n3) : FiniteElement( - FETools::Compositing::multiply_dof_numbers(&fe1, n1, &fe2, n2, &fe3, n3), - FETools::Compositing::compute_restriction_is_additive_flags(&fe1, - n1, - &fe2, - n2, - &fe3, - n3), - FETools::Compositing::compute_nonzero_components(&fe1, - n1, - &fe2, - n2, - &fe3, - n3)) + FETools::Compositing::multiply_dof_numbers( + {&fe1, &fe2, &fe3}, + {n1, n2, n3}), + FETools::Compositing::compute_restriction_is_additive_flags( + {&fe1, &fe2, &fe3}, + {n1, n2, n3}), + FETools::Compositing::compute_nonzero_components( + {&fe1, &fe2, &fe3}, + {n1, n2, n3})) , base_elements(static_cast(n1 > 0) + static_cast(n2 > 0) + static_cast(n3 > 0)) { - std::vector *> fes; - fes.push_back(&fe1); - fes.push_back(&fe2); - fes.push_back(&fe3); - std::vector multiplicities; - multiplicities.push_back(n1); - multiplicities.push_back(n2); - multiplicities.push_back(n3); + const std::vector *> fes = {&fe1, + &fe2, + &fe3}; + const std::vector multiplicities = {n1, n2, n3}; initialize(fes, multiplicities); } @@ -383,43 +378,24 @@ FESystem::FESystem(const FiniteElement &fe1, const FiniteElement &fe4, const unsigned int n4) : FiniteElement( - FETools::Compositing::multiply_dof_numbers(&fe1, - n1, - &fe2, - n2, - &fe3, - n3, - &fe4, - n4), - FETools::Compositing::compute_restriction_is_additive_flags(&fe1, - n1, - &fe2, - n2, - &fe3, - n3, - &fe4, - n4), - FETools::Compositing::compute_nonzero_components(&fe1, - n1, - &fe2, - n2, - &fe3, - n3, - &fe4, - n4)) + FETools::Compositing::multiply_dof_numbers( + {&fe1, &fe2, &fe3, &fe4}, + {n1, n2, n3, n4}), + FETools::Compositing::compute_restriction_is_additive_flags( + {&fe1, &fe2, &fe3, &fe4}, + {n1, n2, n3, n4}), + FETools::Compositing::compute_nonzero_components( + {&fe1, &fe2, &fe3, &fe4}, + {n1, n2, n3, n4})) , base_elements(static_cast(n1 > 0) + static_cast(n2 > 0) + static_cast(n3 > 0) + static_cast(n4 > 0)) { - std::vector *> fes; - fes.push_back(&fe1); - fes.push_back(&fe2); - fes.push_back(&fe3); - fes.push_back(&fe4); - std::vector multiplicities; - multiplicities.push_back(n1); - multiplicities.push_back(n2); - multiplicities.push_back(n3); - multiplicities.push_back(n4); + const std::vector *> fes = {&fe1, + &fe2, + &fe3, + &fe4}; + const std::vector multiplicities = {n1, n2, n3, n4}; initialize(fes, multiplicities); } @@ -437,44 +413,23 @@ FESystem::FESystem(const FiniteElement &fe1, const FiniteElement &fe5, const unsigned int n5) : FiniteElement( - FETools::Compositing:: - multiply_dof_numbers(&fe1, n1, &fe2, n2, &fe3, n3, &fe4, n4, &fe5, n5), - FETools::Compositing::compute_restriction_is_additive_flags(&fe1, - n1, - &fe2, - n2, - &fe3, - n3, - &fe4, - n4, - &fe5, - n5), - FETools::Compositing::compute_nonzero_components(&fe1, - n1, - &fe2, - n2, - &fe3, - n3, - &fe4, - n4, - &fe5, - n5)) + FETools::Compositing::multiply_dof_numbers( + {&fe1, &fe2, &fe3, &fe4, &fe5}, + {n1, n2, n3, n4, n5}), + FETools::Compositing::compute_restriction_is_additive_flags( + {&fe1, &fe2, &fe3, &fe4, &fe5}, + {n1, n2, n3, n4, n5}), + FETools::Compositing::compute_nonzero_components( + {&fe1, &fe2, &fe3, &fe4, &fe5}, + {n1, n2, n3, n4, n5})) , base_elements(static_cast(n1 > 0) + static_cast(n2 > 0) + static_cast(n3 > 0) + static_cast(n4 > 0) + static_cast(n5 > 0)) { - std::vector *> fes; - fes.push_back(&fe1); - fes.push_back(&fe2); - fes.push_back(&fe3); - fes.push_back(&fe4); - fes.push_back(&fe5); - std::vector multiplicities; - multiplicities.push_back(n1); - multiplicities.push_back(n2); - multiplicities.push_back(n3); - multiplicities.push_back(n4); - multiplicities.push_back(n5); + const std::vector *> fes = { + &fe1, &fe2, &fe3, &fe4, &fe5}; + const std::vector multiplicities = {n1, n2, n3, n4, n5}; initialize(fes, multiplicities); }