hxt_linear_system.h 2.08 KB
Newer Older
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef HEXTREME_LINEAR_SYSTEM_H
#define HEXTREME_LINEAR_SYSTEM_H
#include <stdint.h>
#include "hxt_message.h"

typedef struct HXTLinearSystemStruct HXTLinearSystem;

HXTStatus hxtLinearSystemAddToMatrix(HXTLinearSystem *lsys, int el0, int el1, const double *localMatrix);
HXTStatus hxtLinearSystemAddMatrixEntry(HXTLinearSystem *lsys, int node0, int field0, int node1, int field1, double entry);
HXTStatus hxtLinearSystemAddToRhs(HXTLinearSystem *lsys, double *rhs, int el0, const double *localVector);
HXTStatus hxtLinearSystemSize(HXTLinearSystem *lsys, int *size);
HXTStatus hxtLinearSystemZeroMatrix(HXTLinearSystem *lsys);
HXTStatus hxtLinearSystemSolve(HXTLinearSystem *lsys, double *rhs, double *solution);
HXTStatus hxtLinearSystemSetMatrixRowIdentity(HXTLinearSystem *lsys, int node, int field);
HXTStatus hxtLinearSystemSetMatrixRowFieldCombinaison(HXTLinearSystem *system, int node, int field, double *coeff);
HXTStatus hxtLinearSystemSetRhsEntry(HXTLinearSystem *lsys, double *rhs, int node, int field, double v);
HXTStatus hxtLinearSystemAddRhsEntry(HXTLinearSystem *lsys, double *rhs, int node, int field, double v);
HXTStatus hxtLinearSystemDelete(HXTLinearSystem **pSystem);
HXTStatus hxtLinearSystemGetRhsNorm(HXTLinearSystem *lsys, double *rhs, double *norm);
HXTStatus hxtLinearSystemHasConverged(HXTLinearSystem *lsys, int *converged);

HXTStatus hxtLinearSystemCreateLU(HXTLinearSystem **sys, int nElement, int nNodesByElement, int nFields, uint32_t *elements);
typedef struct HXTLinearSystemLUStruct HXTLinearSystemLU;
HXTStatus hxtLinearSystemGetLinearSystemLU(HXTLinearSystem *sys, HXTLinearSystemLU **psys);

#ifdef HXT_HAVE_PETSC
typedef struct HXTLinearSystemPETScStruct HXTLinearSystemPETSc;
HXTStatus hxtLinearSystemCreatePETSc(HXTLinearSystem **sys, int nElement, int nNodesByElement, int nFields, uint32_t *elements, const char *petscOptions);
HXTStatus hxtLinearSystemGetLinearSystemPETSc(HXTLinearSystem *sys, HXTLinearSystemPETSc **psys);
30
HXTStatus hxtPETScInsertOptions(const char *options, const char *prefix);
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
31
32
33
34
35
#endif

HXTStatus hxtInitializeLinearSystems(int *argc, char ***argv);

#endif