Documentation 6b54b78464
Loading...
Searching...
No Matches
CNumericsSIMD.hpp
Go to the documentation of this file.
1/*!
2 * \file CNumericsSIMD.hpp
3 * \brief Vectorized (SIMD) numerics classes.
4 * \author P. Gomes
5 * \version 8.5.0 "Harrier"
6 *
7 * SU2 Project Website: https://su2code.github.io
8 *
9 * The SU2 Project is maintained by the SU2 Foundation
10 * (http://su2foundation.org)
11 *
12 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
13 *
14 * SU2 is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2.1 of the License, or (at your option) any later version.
18 *
19 * SU2 is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
26 */
27
28#pragma once
29
30#include "../../../Common/include/parallelization/vectorization.hpp"
31#include "../numerics/util.hpp"
32
33/*!
34 * \brief Define Double and Int SIMD types.
35 */
38
39/*--- Forward declare a few classes used in name only by the interface. ---*/
40class CConfig;
41class CGeometry;
42class CVariable;
43
44/*!
45 * \class CNumericsSIMD
46 * \ingroup ConvDiscr
47 * \brief Base class to define the interface.
48 * \note See CNumericsEmptyDecorator.
49 */
51public:
52 /*!
53 * \brief Interface for edge flux computation.
54 * \param[in] iEdge - The edges for flux computation.
55 * \param[in] config - Problem definitions.
56 * \param[in] geometry - Problem geometry.
57 * \param[in] solution - Solution variables.
58 * \param[in] updateType - Type of update done on vector and matrix.
59 * \param[in] updateMask - SIMD array of 1's and 0's, the latter prevent the update.
60 * \param[in,out] vector - Target for the fluxes.
61 * \param[in,out] matrix - Target for the flux Jacobians.
62 * \param[out] edgeMassFluxes - Optional, per-edge mass flux (density-equation flux),
63 * used by "bounded scalar" discretization of transported scalars (turbulence, species).
64 * \note The update mask is used to handle "remainder" edges (nEdge mod simdSize).
65 */
66 virtual void ComputeFlux(Int iEdge,
67 const CConfig& config,
68 const CGeometry& geometry,
69 const CVariable& solution,
70 UpdateType updateType,
71 Double updateMask,
73 SparseMatrixType& matrix,
74 su2activevector* edgeMassFluxes) const = 0;
75
76 /*! \brief Destructor of the class. */
77 virtual ~CNumericsSIMD(void) = default;
78
79 /*!
80 * \brief Factory method.
81 * \param[in] config - Problem definitions.
82 * \param[in] nDim - 2D or 3D.
83 * \param[in] iMesh - Grid index.
84 * \param[in] turbVars - Turbulence variables.
85 */
86 static CNumericsSIMD* CreateNumerics(const CConfig& config, int nDim, int iMesh, const CVariable* turbVars = nullptr);
87
88};
A templated matrix/vector-like object.
Definition C2DContainer.hpp:374
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
Parent class for defining the geometry of the problem (complete geometry, multigrid agglomerated geom...
Definition CGeometry.hpp:75
Base class to define the interface.
Definition CNumericsSIMD.hpp:50
virtual void ComputeFlux(Int iEdge, const CConfig &config, const CGeometry &geometry, const CVariable &solution, UpdateType updateType, Double updateMask, CSysVector< su2double > &vector, SparseMatrixType &matrix, su2activevector *edgeMassFluxes) const =0
Interface for edge flux computation.
static CNumericsSIMD * CreateNumerics(const CConfig &config, int nDim, int iMesh, const CVariable *turbVars=nullptr)
Factory method.
Definition CNumericsSIMD.cpp:142
virtual ~CNumericsSIMD(void)=default
Destructor of the class.
Class for holding and manipulating vectors needed by linear solvers.
Definition CSysVector.hpp:195
Main class for defining the variables.
Definition CVariable.hpp:50
UpdateType
Ways to update vectors and system matrices. COLORING is the typical i/j update, whereas for REDUCTION...
Definition util.hpp:44