hxt_linear_system_lu.h 2.47 KB
Newer Older
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
1
2
/*
 * Marblesbag - Copyright (C) <2010-2018>
3
4
 * <Universite catholique de Louvain (UCL), Belgium>
 * <Universite de Montpellier, France>
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 * 	
 * List of the contributors to the development of SLIM: see AUTHORS file.
 * Description and complete License: see LICENSE file.
 * 	
 * This program (Marblesbag) is free software: 
 * you can redistribute it and/or modify it under the terms of the GNU General 
 * Public License as published by the Free Software Foundation, either version
 * 3 of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program (see COPYING file).  If not, 
 * see <http://www.gnu.org/licenses/>.
 */

Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef HEXTREME_LINEAR_SYSTEM_LU_H
#define HEXTREME_LINEAR_SYSTEM_LU_H
#include <stdint.h>
#include "hxt_message.h"

typedef struct HXTLinearSystemLUStruct HXTLinearSystemLU;

HXTStatus hxtLinearSystemLUAddToMatrix(HXTLinearSystemLU *lsys, int el0, int el1, const double *localMatrix);
HXTStatus hxtLinearSystemLUAddMatrixEntry(HXTLinearSystemLU *lsys, int node0, int field0, int node1, int field1, double entry);
HXTStatus hxtLinearSystemLUAddToRhs(HXTLinearSystemLU *lsys, double *rhs, int el0, const double *localVector);
HXTStatus hxtLinearSystemLUZeroMatrix(HXTLinearSystemLU *lsys);
HXTStatus hxtLinearSystemLUSolve(HXTLinearSystemLU *lsys, double *rhs, double *solution);
HXTStatus hxtLinearSystemLUSetMatrixRowIdentity(HXTLinearSystemLU *lsys, int node, int field);
HXTStatus hxtLinearSystemLUSetMatrixRowFieldCombinaison(HXTLinearSystemLU *system, int node, int field, double *coeff);
HXTStatus hxtLinearSystemLUSetRhsEntry(HXTLinearSystemLU *lsys, double *rhs, int node, int field, double v);
HXTStatus hxtLinearSystemLUAddRhsEntry(HXTLinearSystemLU *lsys, double *rhs, int node, int field, double v);
HXTStatus hxtLinearSystemLUDelete(HXTLinearSystemLU **pSystem);
HXTStatus hxtLinearSystemLUHasConverged(HXTLinearSystemLU *lsys, int *converged); 
HXTStatus hxtLinearSystemLUGetRhsNorm(HXTLinearSystemLU *lsys, double *rhs, double *norm);
HXTStatus hxtLinearSystemLUCreate(HXTLinearSystemLU **pSystem, int nElements, int nNodesByElement, int nFields, uint32_t *elements);
HXTStatus hxtLinearSystemLUSize(HXTLinearSystemLU *lsys, int *size);

#endif