atrstm

Load and structure a combustion gas mixture
git clone git://git.meso-star.fr/atrstm.git
Log | Files | Refs | README | LICENSE

atrstm_rdgfa_simd4.h (1515B)


      1 /* Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com)
      2  * Copyright (C) 2020, 2021 Centre National de la Recherche Scientifique
      3  *
      4  * This program is free software: you can redistribute it and/or modify
      5  * it under the terms of the GNU General Public License as published by
      6  * the Free Software Foundation, either version 3 of the License, or
      7  * (at your option) any later version.
      8  *
      9  * This program is distributed in the hope that it will be useful,
     10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     12  * GNU General Public License for more details.
     13  *
     14  * You should have received a copy of the GNU General Public License
     15  * along with this program. If not, see <http://www.gnu.org/licenses/>. */
     16 
     17 #ifndef ATRSTM_RDGFA_SIMD4_H
     18 #define ATRSTM_RDGFA_SIMD4_H
     19 
     20 #include <rsys/rsys.h>
     21 
     22 #include <rsimd/math.h>
     23 #include <rsimd/rsimd.h>
     24 
     25 static FINLINE v4f_T /* In nanometer */
     26 compute_gyration_radius_simd4
     27   (const v4f_T fractal_prefactor,
     28    const v4f_T fractal_dimension,
     29    const v4f_T soot_primary_particles_count,
     30    const v4f_T soot_primary_particles_diameter)
     31 {
     32   const v4f_T kf = fractal_prefactor;
     33   const v4f_T Df = fractal_dimension;
     34   const v4f_T Np = soot_primary_particles_count;
     35   const v4f_T Dp = soot_primary_particles_diameter;
     36   const v4f_T tmp = v4f_pow(v4f_div(Np, kf), v4f_rcp(Df));
     37   const v4f_T Rg = v4f_mul(v4f_mul(v4f_set1(0.5f), Dp), tmp); /* [nm] */
     38   return Rg;
     39 }
     40 
     41 #endif /* ATRSTM_RDGFA_SIMD4_H */
     42