SparseSubstitutionSolver.h
Go to the documentation of this file.
1 //
2 // This file is part of the FFEA simulation package
3 //
4 // Copyright (c) by the Theory and Development FFEA teams,
5 // as they appear in the README.md file.
6 //
7 // FFEA is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // FFEA is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with FFEA. If not, see <http://www.gnu.org/licenses/>.
19 //
20 // To help us fund FFEA development, we humbly ask that you cite
21 // the research papers on the package.
22 //
23 
24 #ifndef SPARSESUBSTITUTIONSOLVER_H_INCLUDED
25 #define SPARSESUBSTITUTIONSOLVER_H_INCLUDED
26 
27 #include <stdio.h>
28 #include <stdlib.h>
29 #include <math.h>
30 
31 #include "FFEA_return_codes.h"
32 #include "mat_vec_types.h"
33 #include "mesh_node.h"
34 #include "tetra_element_linear.h"
35 #include "SimulationParams.h"
36 #include "Solver.h"
38 
39 #define INDEX(I, J) ((I) * num_rows + (J))
40 
42 public:
45 
48 
50  int init(int num_nodes, int num_elements, mesh_node *node, tetra_element_linear *elem, SimulationParams *params, int num_pinned_nodes, int *pinned_nodes_list, set<int> bsite_pinned_node_list);
51 
61  int solve(vector3 *x);
62 
63  void apply_matrix(scalar *in, scalar *result);
64 
65 private:
66 
68  int num_rows;
69 
71 
77  int *L_key, *U_key;
79 
82 
85 
87 
94  scalar *L, *U;
96 };
97 
98 #endif
Definition: tetra_element_linear.h:136
Definition: SparseSubstitutionSolver.h:41
~SparseSubstitutionSolver()
Definition: SparseSubstitutionSolver.cpp:36
int * U_key
Definition: SparseSubstitutionSolver.h:77
int * L_key
Definition: SparseSubstitutionSolver.h:77
void apply_matrix(scalar *in, scalar *result)
Definition: SparseSubstitutionSolver.cpp:238
scalar * inverse_diag
Definition: SparseSubstitutionSolver.h:84
scalar * U
Definition: SparseSubstitutionSolver.h:94
static const int x
Definition: rod_math_v9.h:52
int init(int num_nodes, int num_elements, mesh_node *node, tetra_element_linear *elem, SimulationParams *params, int num_pinned_nodes, int *pinned_nodes_list, set< int > bsite_pinned_node_list)
Definition: SparseSubstitutionSolver.cpp:50
scalar * L
Definition: SparseSubstitutionSolver.h:94
Definition: mesh_node.h:39
Definition: SimulationParams.h:75
int num_rows
Definition: SparseSubstitutionSolver.h:68
int total_entries_in_U
Definition: SparseSubstitutionSolver.h:81
Definition: Solver.h:30
Definition: mat_vec_types.h:90
double scalar
Definition: mat_vec_types.h:36
int solve(vector3 *x)
Definition: SparseSubstitutionSolver.cpp:198
SparseSubstitutionSolver()
Definition: SparseSubstitutionSolver.cpp:26