forked from goma/goma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmm_sol_nonlinear.h
224 lines (200 loc) · 10.4 KB
/
mm_sol_nonlinear.h
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
/************************************************************************ *
* Goma - Multiphysics finite element software *
* Sandia National Laboratories *
* *
* Copyright (c) 2022 Goma Developers, National Technology & Engineering *
* Solutions of Sandia, LLC (NTESS) *
* *
* Under the terms of Contract DE-NA0003525, the U.S. Government retains *
* certain rights in this software. *
* *
* This software is distributed under the GNU General Public License. *
* See LICENSE file. *
\************************************************************************/
#ifndef GOMA_MM_SOL_NONLINEAR_H
#define GOMA_MM_SOL_NONLINEAR_H
#include "dp_types.h"
#include "dpi.h"
#include "exo_struct.h"
#include "mm_prob_def.h"
#include "rf_io_structs.h"
#include "std.h"
struct GomaLinearSolverData;
#ifdef EXTERN
#undef EXTERN
#endif
#ifdef GOMA_MM_SOL_NONLINEAR_C
#define EXTERN
#
#endif
#ifndef GOMA_MM_SOL_NONLINEAR_C
#define EXTERN extern
#endif
EXTERN int
solve_nonlinear_problem(struct GomaLinearSolverData *, /* ams - ptrs to Aztec linear *
* systems */
double[], /* x - soln vector on this proc */
double, /* delta_t - time step size */
double, /* theta - parameter to vary time *
* integration from explicit (theta = 1) to *
* implicit (theta = 0) */
double[], /* x_old - soln vector @ previous time */
double[], /* x_older - soln vector @ prev2 time */
double[], /* xdot - dxdt predicted for new time */
double[], /* xdot_old - dxdt for previous time */
double[], /* resid_vector */
double[], /* x_update */
double[], /* scale - Scale factor for modified newton *
* resolves */
int *, /* converged - whether the Newton iteration *
* has converged (out) */
int *, /* nprint - counter for time step number */
int, /* tev - total number elem variables to *
* output to EXODUS II file */
int, /* tev_post - extra element post processing *
* results */
double[], /* global variable values */
RESULTS_DESCRIPTION_STRUCT *, /* rd - details about post proc vars */
int *, /* gindex */
int *, /* gsize */
double *, /* gvec */
double ***, /* gvec_elem */
double, /* time_value */
Exo_DB *, /* exo */
Dpi *, /* dpi */
Comm_Ex *, /* cx */
int, /* nt */
int *, /* time_step_reform */
int, /* is_steady_state */
double[], /* x_AC - updating evp quantities */
double[], /* x_AC_dot - */
double, /* lambda */
double *, /* resid_vector_sens */
double *, /* x_sens */
double **, /* x_sens_p - solution sensitivities */
void *); /* con_ptr pointer */
EXTERN double L2_norm /* mm_sol_nonlinear.c */
(double *, /* vector */
int); /* nloc */
EXTERN double L2_norm_diff /* mm_sol_nonlinear.c */
(double *, /* vector 1 */
double *, /* vector 2 */
int); /* nloc */
EXTERN double L2_norm_r /* mm_sol_nonlinear.c */
(double *, /* vector */
double *, /* vector scale */
int); /* nloc */
EXTERN double L1_norm /* mm_sol_nonlinear.c */
(double *, /* vector */
int); /* nloc */
EXTERN double L1_norm_r /* mm_sol_nonlinear.c */
(double *, /* vector */
double *, /* vector scale */
int); /* nloc */
EXTERN double Loo_norm /* mm_sol_nonlinear.c */
(double *, /* vector */
int, /* nloc */
int *, /* num_unk - save the index! */
char *); /* dofname_x - dof name for num_unk */
EXTERN double Loo_norm_r /* mm_sol_nonlinear.c */
(double *, /* vector */
double *, /* vector scale */
int, /* nloc */
int *, /* num_unk - save the index! */
char *); /* dofname_r - dof name for num_unk */
EXTERN double L2_norm_1p /* mm_sol_nonlinear.c */
(double *, /* vector */
int); /* nloc */
EXTERN double L2_norm_diff_1p /* mm_sol_nonlinear.c */
(double *, /* vector 1 */
double *, /* vector 2 */
int); /* nloc */
EXTERN double L2_norm_r_1p /* mm_sol_nonlinear.c */
(double *, /* vector */
double *, /* vector scale */
int); /* nloc */
EXTERN double L1_norm_1p /* mm_sol_nonlinear.c */
(double *, /* vector */
int); /* nloc */
EXTERN double L1_norm_r_1p /* mm_sol_nonlinear.c */
(double *, /* vector */
double *, /* vector scale */
int); /* nloc */
EXTERN double Loo_norm_1p /* mm_sol_nonlinear.c */
(double *, /* vector */
int, /* nloc */
int *, /* num_unk - save the index! */
char *); /* dofname_x - dof name for num_unk */
EXTERN double Loo_norm_r_1p /* mm_sol_nonlinear.c */
(double *, /* vector */
double *, /* vector scale */
int, /* nloc */
int *, /* num_unk - save the index! */
char *); /* dofname_r - dof name for num_unk */
EXTERN void print_array /* mm_sol_nonlinear.c */
(const void *, /* array - generic pointer */
const int, /* length - of the array */
const char *, /* name - used to print name[23] = value */
const Edt, /* datatype - std.h, type_int or type_double */
const int); /* procid */
/*
* EDW: Moved here from mm_sol_nonlinear.c ---
* The interface to Bob Benner's frontal solver is here for now. If it
* were fully road tested you'd expect a nice function prototype declaration
* in the appropriate include file. To be fair, though, the interface
* does involve passing a function pointer for a element stiffness matrix
* assembly routine that could vary substantially depending on the application.
*/
#ifdef HAVE_FRONT
extern int mf_solve_lineqn(int *, /* re_solve */
double *, /* rhs */
int, /* nrhs */
int *, /* nsetbc */
double *, /* bcvalue */
double *, /* smallpiv */
double *, /* singpiv */
int *, /* iautopiv */
int *, /* iscale */
void (*)(struct Aztec_Linear_Solver_System *,
double[],
double[],
double[],
double[],
double[],
double[],
double[],
double *,
double *,
struct elem_side_bc_struct *[],
double *,
Exo_DB *,
Dpi *,
int *,
int *,
dbl *,
dbl *,
dbl *,
int), /* matrix_fill(), anyone? see mm_fill.h */
double *, /* lhs */
double *, /* scaling_max */
double *, /* r_scale */
struct Aztec_Linear_Solver_System *,
double[],
double[],
double[],
double[],
double[],
double[],
double[],
double *,
double *,
struct elem_side_bc_struct *[],
double *,
Exo_DB *,
Dpi *,
int *, /* &num_total_nodes */
dbl *, /* &h_elem_avg */
dbl * /* &U_norm */
);
#endif
#endif /* GOMA_MM_SOL_NONLINEAR_H */