NoMassCGSolver.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 NOMASSCGSOLVER_HPP_INCLUDED
25 #define NOMASSCGSOLVER_HPP_INCLUDED
26 
27 #include <stdio.h>
28 #include <set>
29 
30 #include "FFEA_return_codes.h"
31 #include "mat_vec_types.h"
32 #include "mesh_node.h"
33 #include "tetra_element_linear.h"
34 #include "SimulationParams.h"
35 #include "Solver.h"
36 #include "NoMassCGSolver.h"
37 #include "SparseMatrixTypes.h"
38 #include "SparsityPattern.h"
40 
41 class NoMassCGSolver : public Solver {
42 public:
43 
46 
49 
51  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);
52 
54  int solve(vector3* x);
55 
56  /* */
58 
59 private:
60 
63 
66 
68  int i_max;
69 
71  int num_rows;
72 
74  int num_nodes;
75 
78 
80  vector3 *r, *p, *z, *q, *f;
81 
84 
85  /* */
87 
88  /* */
89  scalar residual2();
90 
91  /* */
92  scalar modx(vector3 *x);
93 
95 
96  /* */
98 
99  /* */
100  void check(vector3 *x);
101 
102  /* */
103  void apply_matrix(scalar *in, scalar *result) {
104  }
105 
106 };
107 
108 #endif
Definition: tetra_element_linear.h:136
int solve(vector3 *x)
Definition: NoMassCGSolver.cpp:165
void check(vector3 *x)
Definition: NoMassCGSolver.cpp:294
scalar one
Definition: NoMassCGSolver.h:83
scalar * preconditioner
Definition: NoMassCGSolver.h:77
scalar conjugate_gradient_residual_assume_x_zero(vector3 *b)
Definition: NoMassCGSolver.cpp:205
static const int x
Definition: rod_math_v9.h:52
int num_nodes
Definition: NoMassCGSolver.h:74
Definition: SparseMatrixFixedPattern.h:36
const scalar force
force = E/l
Definition: dimensions.h:37
scalar residual2()
Definition: NoMassCGSolver.cpp:233
Definition: NoMassCGSolver.h:41
SparseMatrixFixedPattern * V
Definition: NoMassCGSolver.h:62
scalar modx(vector3 *x)
Definition: NoMassCGSolver.cpp:250
~NoMassCGSolver()
Definition: NoMassCGSolver.cpp:41
void apply_matrix(scalar *in, scalar *result)
Definition: NoMassCGSolver.h:103
void print_matrices(vector3 *force)
Definition: NoMassCGSolver.cpp:200
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: NoMassCGSolver.cpp:63
NoMassCGSolver()
Definition: NoMassCGSolver.cpp:26
Definition: mesh_node.h:39
Definition: SimulationParams.h:75
Definition: Solver.h:30
scalar parallel_apply_preconditioner()
Definition: NoMassCGSolver.cpp:278
vector3 * p
Definition: NoMassCGSolver.h:80
scalar get_alpha_denominator()
Definition: NoMassCGSolver.cpp:261
vector3 * q
Definition: NoMassCGSolver.h:80
int i_max
Definition: NoMassCGSolver.h:68
scalar epsilon2
Definition: NoMassCGSolver.h:65
Definition: mat_vec_types.h:90
vector3 * f
Definition: NoMassCGSolver.h:80
double scalar
Definition: mat_vec_types.h:36
vector3 * z
Definition: NoMassCGSolver.h:80
vector3 * r
Definition: NoMassCGSolver.h:80
int num_rows
Definition: NoMassCGSolver.h:71