From 9a49a6c59955850343e1a0f7c7d8883ededf78f7 Mon Sep 17 00:00:00 2001 From: Johan Mabille Date: Thu, 24 Sep 2020 17:09:59 +0200 Subject: [PATCH] Replaced initialization and obvious computation with STL algorithms --- proteus/mprans/RANS2P2D.h | 114 +++++++++++++++----------------------- 1 file changed, 44 insertions(+), 70 deletions(-) diff --git a/proteus/mprans/RANS2P2D.h b/proteus/mprans/RANS2P2D.h index a490ad70df..6bc5711ce3 100644 --- a/proteus/mprans/RANS2P2D.h +++ b/proteus/mprans/RANS2P2D.h @@ -24,6 +24,17 @@ const double DM3=1.0;//1-point-wise divergence, 0-point-wise rate of volume cha const double inertial_term=1.0; namespace proteus { + + namespace detail + { + template + inline std::array make_array(const T& t) + { + std::array res; + std::fill_n(res.begin(), N, t); + } + } + template using GeneralizedFunctions = equivalent_polynomials::GeneralizedFunctions_mix; @@ -1682,35 +1693,22 @@ namespace proteus for(int eN=0;eN(0.0); + register auto elementResidual_p_check = detail::make_array(0.0); + register auto elementResidual_mesh = detail::make_array(0.0); + register auto elementResidual_u = detail::make_array(0.0); + register auto elementResidual_v = detail::make_array(0.0); + register auto pelementResidual_u = detail::make_array(0.0); + register auto pelementResidual_v = detail::make_array(0.0); + register auto velocityErrorElement = detail::make_array(0.0); + double eps_rho,eps_mu; bool element_active=false; elementIsActive[eN]=false; const double* elementResidual_w(NULL); double mesh_volume_conservation_element=0.0, mesh_volume_conservation_element_weak=0.0; - for (int i=0;i 0) { for (int I=0;I