TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Solv_Externe.h
1/****************************************************************************
2* Copyright (c) 2026, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15
16#ifndef Solv_Externe_included
17#define Solv_Externe_included
18
19#include <SolveurSys_base.h>
20#include <Solv_tools.h>
21
22class Matrice_Morse;
24
25/*! @brief Common stuff for several external solvers.
26 *
27 * Note: here we use trustIdType for potentially big identifiers, this maps to PetscInt type in Solv_Petsc class
28 * (type equality between the both is checked when creating the solver).
29 */
31{
32 Declare_base_sans_constructeur_ni_destructeur(Solv_Externe);
33public:
38
39protected:
43 public_for_cuda
44 template<typename ExecSpace>
45 void Update_lhs_rhs(const DoubleVect& b, DoubleVect& x);
46 template<typename ExecSpace>
47 void Update_solution(DoubleVect& x);
48protected:
49 const ArrOfInt& indice_coeff_to_keep(const Matrice_Morse&);
50
51 int matrice_symetrique_; // Flag for matrix symmetry
52 ArrOfDouble lhs_; // Left-hand side without shared items
53 ArrOfDouble rhs_; // Right-hand side without shared items
54private:
55 ArrOfInt indice_coeff_to_keep_; // CSR matrix coefficients to keep in the TRUST matrix
56};
57
58
59#endif //TRUST_SOLV_EXTERNE_H
Matrice_Base class - Base class of the matrix hierarchy.
Matrice_Morse_Sym class - Represents a sparse symmetric matrix M stored in Morse format.
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
int matrice_symetrique_
ArrOfDouble lhs_
public_for_cuda void Update_lhs_rhs(const DoubleVect &b, DoubleVect &x)
ArrOfDouble rhs_
void Create_lhs_rhs_onDevice()
void MorseSymToMorse(const Matrice_Morse_Sym &MS, Matrice_Morse &M)
const ArrOfInt & indice_coeff_to_keep(const Matrice_Morse &)
void construit_matrice_morse_intermediaire(const Matrice_Base &, Matrice_Morse &)
void Update_solution(DoubleVect &x)