1 /******************************************************************************
2  * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other
3  * HYPRE Project Developers. See the top-level COPYRIGHT file for details.
4  *
5  * SPDX-License-Identifier: (Apache-2.0 OR MIT)
6  ******************************************************************************/
7 
8 /**************************************************************************
9   Module:  LLNL_FEI_LSCore.h
10   Purpose: custom implementation of the FEI/LSC
11  **************************************************************************/
12 
13 #ifndef _LLNL_FEI_LSCORE_H_
14 #define _LLNL_FEI_LSCORE_H_
15 
16 //New FEI 2.23.02
17 #include "fei_defs.h"
18 #include "fei_Data.hpp"
19 #include "fei_Lookup.hpp"
20 #include "fei_LinearSystemCore.hpp"
21 #include "cfei_hypre.h"
22 
23 typedef enum {
24   UNDEFINED_SolverLib = -1,
25   HYPRE =2
26 } SolverLib_t;
27 
28 /******************************************************************************
29   This is the definition for the base LLNL_FEI_LSCore class.
30   *****************************************************************************/
31 
32 class LLNL_FEI_LSCore
33 {
34   private :
35 
36   public :
37 
38   LinearSystemCore *lsc_;
39 
40   LLNL_FEI_LSCore( SolverLib_t tmp );
41   ~LLNL_FEI_LSCore();
42 
43   int setGlobalOffsets(int leng, int *nodeOffsets, int *eqnOffsets,
44                        int *blkEqnOffsets);
45 
46   int setMatrixStructure(int **ptColIndices, int *ptRowLengths,
47                          int **blkColIndices, int *blkRowLengths,
48                          int *ptRowsPerBlkRow);
49 
50   int sumIntoSystemMatrix(int nRows, const int *rows, int nCols,
51                           const int* cols, const double* const* vals);
52 
53   int putIntoSystemMatrix(int nRows, const int *rows, int nCols,
54                           const int* cols, const double* const* vals);
55 
56   int matrixLoadComplete();
57 
58   int sumIntoRHSVector(int num, const double *vals, const int *indices);
59 
60   int putIntoRHSVector(int num, const double *vals, const int *indices);
61 
62   int putInitialGuess(const int *eqnNumbers, const double *values, int leng);
63 
64   int parameters(int nParams, char **params);
65 
66   int solve(int *status, int *iterations);
67 
68   int formResidual( double* values, int leng);
69 
70   int getSolution(double *answers, int leng);
71 
72   int getSolnEntry(int eqnNum, double *answers);
73 
74 };
75 
76 #endif /* endif for _LLNL_FEI_LSCORE_H_ */
77 
78