4 #include "ester-config.h"
182 add(ieq,ivar,
'd',&d,NULL,NULL,NULL);
186 add(ieq,ivar,
'l',&d,&l,NULL,NULL);
190 add(ieq,ivar,
'r',&d,NULL,&r,NULL);
194 add(ieq,ivar,
'f',&d,&l,&r,NULL);
198 add(ieq,ivar,
'm',&d,&l,NULL,&i);
202 add(ieq,ivar,
's',&d,NULL,&r,&i);
206 add(ieq,ivar,
'g',&d,&l,&r,&i);
257 void init(
int nblock,
int nvar,
const char *solver_type);
260 void reset(
int iblock);
261 void reset(
int iblock,
int ieq);
262 void reset(
int iblock,
const char *eq_name);
263 void reset(
const char *eq_name);
264 void regvar(
const char *var_name,
int dependent=0);
268 int get_id(
const char *varn);
275 void solve(
int *info=NULL);
283 void add(
int iblock,
const char *eqn,
const char *varn,
const char *block_type,
char type,
const matrix *d,
const matrix *l,
const matrix *r,
const matrix *i);
286 inline void add_d(
const char *eqn,
const char *varn,
const matrix &d) {
287 add(eqn,varn,
"block",
'd',&d,NULL,NULL,NULL);
290 add(eqn,varn,
"block",
'l',&d,&l,NULL,NULL);
293 add(eqn,varn,
"block",
'r',&d,NULL,&r,NULL);
296 add(eqn,varn,
"block",
'f',&d,&l,&r,NULL);
299 add(eqn,varn,
"block",
'm',&d,&l,NULL,&i);
302 add(eqn,varn,
"block",
's',&d,NULL,&r,&i);
305 add(eqn,varn,
"block",
'g',&d,&l,&r,&i);
309 add(eqn,varn,
"bc_pol",
'd',&d,NULL,NULL,NULL);
312 add(eqn,varn,
"bc_pol",
'l',&d,&l,NULL,NULL);
315 add(eqn,varn,
"bc_pol",
'r',&d,NULL,&r,NULL);
318 add(eqn,varn,
"bc_pol",
'f',&d,&l,&r,NULL);
321 add(eqn,varn,
"bc_pol",
'm',&d,&l,NULL,&i);
324 add(eqn,varn,
"bc_pol",
's',&d,NULL,&r,&i);
327 add(eqn,varn,
"bc_pol",
'g',&d,&l,&r,&i);
331 add(eqn,varn,
"bc_eq",
'd',&d,NULL,NULL,NULL);
334 add(eqn,varn,
"bc_eq",
'l',&d,&l,NULL,NULL);
337 add(eqn,varn,
"bc_eq",
'r',&d,NULL,&r,NULL);
340 add(eqn,varn,
"bc_eq",
'f',&d,&l,&r,NULL);
343 add(eqn,varn,
"bc_eq",
'm',&d,&l,NULL,&i);
346 add(eqn,varn,
"bc_eq",
's',&d,NULL,&r,&i);
349 add(eqn,varn,
"bc_eq",
'g',&d,&l,&r,&i);
352 inline void add_d(
int iblock,
const char *eqn,
const char *varn,
const matrix &d) {
353 add(iblock,eqn,varn,
"block",
'd',&d,NULL,NULL,NULL);
355 inline void add_l(
int iblock,
const char *eqn,
const char *varn,
const matrix &d,
const matrix &l) {
356 add(iblock,eqn,varn,
"block",
'l',&d,&l,NULL,NULL);
358 inline void add_r(
int iblock,
const char *eqn,
const char *varn,
const matrix &d,
const matrix &r) {
359 add(iblock,eqn,varn,
"block",
'r',&d,NULL,&r,NULL);
362 add(iblock,eqn,varn,
"block",
'f',&d,&l,&r,NULL);
365 add(iblock,eqn,varn,
"block",
'm',&d,&l,NULL,&i);
368 add(iblock,eqn,varn,
"block",
's',&d,NULL,&r,&i);
371 add(iblock,eqn,varn,
"block",
'g',&d,&l,&r,&i);
375 add(iblock,eqn,varn,
"bc_pol",
'd',&d,NULL,NULL,NULL);
378 add(iblock,eqn,varn,
"bc_pol",
'l',&d,&l,NULL,NULL);
381 add(iblock,eqn,varn,
"bc_pol",
'r',&d,NULL,&r,NULL);
384 add(iblock,eqn,varn,
"bc_pol",
'f',&d,&l,&r,NULL);
387 add(iblock,eqn,varn,
"bc_pol",
'm',&d,&l,NULL,&i);
390 add(iblock,eqn,varn,
"bc_pol",
's',&d,NULL,&r,&i);
393 add(iblock,eqn,varn,
"bc_pol",
'g',&d,&l,&r,&i);
397 add(iblock,eqn,varn,
"bc_eq",
'd',&d,NULL,NULL,NULL);
400 add(iblock,eqn,varn,
"bc_eq",
'l',&d,&l,NULL,NULL);
403 add(iblock,eqn,varn,
"bc_eq",
'r',&d,NULL,&r,NULL);
406 add(iblock,eqn,varn,
"bc_eq",
'f',&d,&l,&r,NULL);
409 add(iblock,eqn,varn,
"bc_eq",
'm',&d,&l,NULL,&i);
412 add(iblock,eqn,varn,
"bc_eq",
's',&d,NULL,&r,&i);
415 add(iblock,eqn,varn,
"bc_eq",
'g',&d,&l,&r,&i);
419 add(iblock,eqn,varn,
"bc_bot1",
'd',&d,NULL,NULL,NULL);
422 add(iblock,eqn,varn,
"bc_bot1",
'l',&d,&l,NULL,NULL);
425 add(iblock,eqn,varn,
"bc_bot1",
'r',&d,NULL,&r,NULL);
428 add(iblock,eqn,varn,
"bc_bot1",
'f',&d,&l,&r,NULL);
431 add(iblock,eqn,varn,
"bc_bot1",
'm',&d,&l,NULL,&i);
434 add(iblock,eqn,varn,
"bc_bot1",
's',&d,NULL,&r,&i);
437 add(iblock,eqn,varn,
"bc_bot1",
'g',&d,&l,&r,&i);
441 add(iblock,eqn,varn,
"bc_bot2",
'd',&d,NULL,NULL,NULL);
444 add(iblock,eqn,varn,
"bc_bot2",
'l',&d,&l,NULL,NULL);
447 add(iblock,eqn,varn,
"bc_bot2",
'r',&d,NULL,&r,NULL);
450 add(iblock,eqn,varn,
"bc_bot2",
'f',&d,&l,&r,NULL);
453 add(iblock,eqn,varn,
"bc_bot2",
'm',&d,&l,NULL,&i);
456 add(iblock,eqn,varn,
"bc_bot2",
's',&d,NULL,&r,&i);
459 add(iblock,eqn,varn,
"bc_bot2",
'g',&d,&l,&r,&i);
463 add(iblock,eqn,varn,
"bc_top1",
'd',&d,NULL,NULL,NULL);
466 add(iblock,eqn,varn,
"bc_top1",
'l',&d,&l,NULL,NULL);
469 add(iblock,eqn,varn,
"bc_top1",
'r',&d,NULL,&r,NULL);
472 add(iblock,eqn,varn,
"bc_top1",
'f',&d,&l,&r,NULL);
475 add(iblock,eqn,varn,
"bc_top1",
'm',&d,&l,NULL,&i);
478 add(iblock,eqn,varn,
"bc_top1",
's',&d,NULL,&r,&i);
481 add(iblock,eqn,varn,
"bc_top1",
'g',&d,&l,&r,&i);
485 add(iblock,eqn,varn,
"bc_top2",
'd',&d,NULL,NULL,NULL);
488 add(iblock,eqn,varn,
"bc_top2",
'l',&d,&l,NULL,NULL);
491 add(iblock,eqn,varn,
"bc_top2",
'r',&d,NULL,&r,NULL);
494 add(iblock,eqn,varn,
"bc_top2",
'f',&d,&l,&r,NULL);
497 add(iblock,eqn,varn,
"bc_top2",
'm',&d,&l,NULL,&i);
500 add(iblock,eqn,varn,
"bc_top2",
's',&d,NULL,&r,&i);
503 add(iblock,eqn,varn,
"bc_top2",
'g',&d,&l,&r,&i);
511 #define RK_INTERMEDIATE 2
525 int get_id(
const char *varn);
533 void regvar(
const char *var_name,
const matrix &initial_value);
542 int solve(
double t0,
double t1);
659 int get_id(
const char *varn);
672 void init(
int nvar,
const char *type);
675 void regvar(
const char *var_name,
const matrix &initial_value);
692 int solve(
double t0,
double t1);
void bc_top2_add_lri(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l, const matrix &r, const matrix &i)
Definition: solver.h:502
Stores one term of an equation.
Definition: solver.h:94
void add_d(const char *eqn, const char *varn, const matrix &d)
Definition: solver.h:286
int check_struct_block(int n, int i, int j)
Definition: solver.cpp:1624
void bc_pol_add_r(const char *eqn, const char *varn, const matrix &d, const matrix &r)
Definition: solver.h:314
int ** var_nbot
var_nbot[i][j] is the resolution of the i-th bottom boundary condition on the j-th variable ...
Definition: solver.h:216
void bc_eq_add_ri(const char *eqn, const char *varn, const matrix &d, const matrix &r, const matrix &i)
Definition: solver.h:345
void bc_top2_add_ri(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &r, const matrix &i)
Definition: solver.h:499
void init_sdirk2()
Definition: SDIRK_solver.cpp:378
matrix solve(const matrix &a)
Definition: solver.h:61
solver()
Definition: solver.cpp:97
matrix b
Definition: solver.h:654
matrix x0
Definition: solver.h:655
void bc_bot2_add_r(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &r)
Definition: solver.h:446
void bc_top2_add_li(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l, const matrix &i)
Definition: solver.h:496
void set_block(int iblock, matrix &)
Definition: solver_full.cpp:73
void init(int nvar, const char *type)
Definition: SDIRK_solver.cpp:18
int check_struct_bc_th(int n, int i, int j, const char *bctype)
Definition: solver.cpp:1711
virtual ~solver_operator()
Definition: solver.h:17
void set_nr(int *nr)
Definition: solver.cpp:268
matrix dep
Definition: solver.h:221
int check_struct_bc(int n, int i, int j, const char *bctype)
Definition: solver.cpp:1783
void add_l(const char *eqn, const char *varn, const matrix &d, const matrix_block_diag &l)
Definition: solver.h:289
int nb
Number of blocks defined in the problem.
Definition: solver.h:211
matrix R
Definition: solver.h:105
void bc_top1_add_lr(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l, const matrix &r)
Definition: solver.h:471
void bc_top2_add_lr(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l, const matrix &r)
Definition: solver.h:493
void bc_eq_add_d(int iblock, const char *eqn, const char *varn, const matrix &d)
Definition: solver.h:396
double get_t()
Definition: RKF_solver.cpp:136
void bc_top1_add_lri(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l, const matrix &r, const matrix &i)
Definition: solver.h:480
void bc_pol_add_lr(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l, const matrix &r)
Definition: solver.h:383
void * mult_context
Definition: solver.h:253
~SDIRK_solver()
Definition: solver.h:674
void bc_top2_add_r(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &r)
Definition: solver.h:490
void bc_eq_add_lri(const char *eqn, const char *varn, const matrix &d, const matrix_block_diag &l, const matrix &r, const matrix &i)
Definition: solver.h:348
solver_full(int nblocks, int offcore=0)
Definition: solver_full.cpp:19
A solver object stores a system of equation to solve.
Definition: solver.h:73
int debug
Definition: solver.h:250
int oc
Definition: solver.h:26
void solve_block(int i, char trans, matrix &x)
Definition: solver_full.cpp:200
matrix * c
Definition: solver.h:24
int nv
Definition: solver.h:514
int check_struct()
Definition: solver.cpp:1521
void set_initial_derivative(const char *var_name, const matrix &initial_value)
Definition: SDIRK_solver.cpp:206
~RKF_solver()
Definition: solver.h:532
matrix * sol
Definition: solver.h:230
int verbose
Definition: solver.h:249
The matrix class is used to facilitate the work with regular dense matrices.
Definition: matrix.h:9
double get_t()
Definition: SDIRK_solver.cpp:251
matrix b5
Definition: solver.h:518
void bc_top2_add_l(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l)
Definition: solver.h:487
void(* mult_fcn)(matrix *, void *context)
Definition: solver.h:252
solver_block * block
Definition: solver.h:223
void add_d(int iblock, const char *eqn, const char *varn, const matrix &d)
Definition: solver.h:352
solver_block * bc_top1
Definition: solver.h:226
matrix * y
Definition: solver.h:518
void add_lri(int ieq, int ivar, const matrix &d, const matrix &l, const matrix &r, const matrix &i)
Introduces a term of type 'g'.
Definition: solver.h:205
char tempdir[50]
Definition: solver.h:27
void unwrap(const matrix *, matrix *)
Definition: RKF_solver.cpp:170
double t_eval
Definition: solver.h:519
void unwrap(const matrix *, matrix *)
Performs the inverse operation of the wrap function: restore the single vector x into the blocked vec...
Definition: solver.cpp:1303
int * N
Definition: solver.h:26
void bc_bot1_add_lr(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l, const matrix &r)
Definition: solver.h:427
void add_ri(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &r, const matrix &i)
Definition: solver.h:367
void add_li(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l, const matrix &i)
Definition: solver.h:364
int get_id(const char *varn)
Definition: SDIRK_solver.cpp:236
double abs_tol
Definition: solver.h:251
void set_blocksup(int iblock, matrix &)
Definition: solver_full.cpp:85
void regvars(const matrix_map &vars)
Definition: SDIRK_solver.cpp:198
void bc_eq_add_ri(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &r, const matrix &i)
Definition: solver.h:411
void add_r(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &r)
Definition: solver.h:358
solver_block * bc_bot1
Definition: solver.h:224
The matrix_block_diag class is used to store block diagonal matrices.
Definition: matrix.h:202
solver_operator* op
Definition: solver.h:222
int get_id(const char *varn)
Definition: solver.cpp:311
void check_method()
Definition: SDIRK_solver.cpp:87
int solve(double t0, double t1)
Definition: SDIRK_solver.cpp:306
void read_blockinf(int i)
Definition: solver_full.cpp:311
matrix get_var(const char *varn)
Definition: solver.cpp:365
matrix_map get_vars()
Definition: solver.cpp:372
void add(int ieq, int ivar, char type, const matrix *d, const matrix *l, const matrix *r, const matrix *i)
Introduces a term in an equation of the block.
Definition: solver.cpp:68
void regvar(const char *var_name, const matrix &initial_value)
Definition: RKF_solver.cpp:71
matrix * y
Definition: solver.h:655
void bc_top2_add_d(int iblock, const char *eqn, const char *varn, const matrix &d)
Definition: solver.h:484
void bc_pol_add_d(const char *eqn, const char *varn, const matrix &d)
Definition: solver.h:308
void check_struct_error(const char *err_msg, int n, int i, int j, solver_elem *p)
Definition: solver.cpp:1866
void bc_pol_add_li(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l, const matrix &i)
Definition: solver.h:386
void add_r(const char *eqn, const char *varn, const matrix &d, const matrix &r)
Definition: solver.h:292
int ** ipiv
Definition: solver.h:28
matrix x_eval
Definition: solver.h:518
matrix deriv
Definition: solver.h:518
void flush_block(int i)
Definition: solver_full.cpp:305
void regvar_dep(const char *var_name)
Definition: solver.h:265
double rel_tol
Definition: solver.h:528
matrix * dy
Definition: solver.h:518
int nb
Definition: solver.h:26
void set_blockinf(int iblock, matrix &)
Definition: solver_full.cpp:93
void reset()
Definition: solver.cpp:222
int initd
Definition: solver.h:220
matrix ipiv_flag
Definition: solver.h:25
void init(int nvar)
Definition: RKF_solver.cpp:18
double rel_tol
Definition: solver.h:251
matrix k[6]
Definition: solver.h:518
int ** var_nth
var_nr[i][j] is the azimuthal resolution of the j-th variable in the i-th equation ...
Definition: solver.h:214
void subst_dep()
Substitutes dependent variables defined in the solver.
Definition: solver.cpp:1899
void wrap(const matrix *, matrix *)
Stores distributed (ie. split into several blocks) matrix y into the single vector x...
Definition: solver.cpp:1249
solver_block * bc_eq
Definition: solver.h:229
void mult(matrix *)
Definition: solver.cpp:505
void bc_bot2_add_lr(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l, const matrix &r)
Definition: solver.h:449
void left_precond(matrix &x)
Definition: solver.h:49
void init(int nblock, int nvar, const char *solver_type)
Initialize the solver object for nblock blocks, nvar variables, using a solver operator of type solve...
Definition: solver.cpp:115
void read_blocksup(int i)
Definition: solver_full.cpp:352
double get_step()
Definition: SDIRK_solver.cpp:167
void fwd_subs(matrix &)
Definition: solver_full.cpp:218
void flush_blockinf(int i)
Definition: solver_full.cpp:346
void bc_eq_add_l(const char *eqn, const char *varn, const matrix &d, const matrix_block_diag &l)
Definition: solver.h:333
void write_blocksup(int i, const matrix &)
Definition: solver_full.cpp:369
void check_init()
Definition: SDIRK_solver.cpp:80
matrix x
Definition: solver.h:655
void set_var(const char *var_name, const matrix &value)
Definition: SDIRK_solver.cpp:222
void destroy()
Definition: solver.cpp:178
void set_derivs(const matrix_map &values)
Definition: RKF_solver.cpp:144
void add_lr(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l, const matrix &r)
Definition: solver.h:361
void regvar(const char *var_name, int dependent=0)
Definition: solver.cpp:276
void bc_pol_add_ri(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &r, const matrix &i)
Definition: solver.h:389
int * nr
nr[i] is the radial resolution of the i-th variable
Definition: solver.h:143
matrix I
Definition: solver.h:105
void lu_block(int i)
Definition: solver_full.cpp:162
void bc_eq_add_r(const char *eqn, const char *varn, const matrix &d, const matrix &r)
Definition: solver.h:336
void write_block(int i, const matrix &)
Definition: solver_full.cpp:285
void add_li(const char *eqn, const char *varn, const matrix &d, const matrix_block_diag &l, const matrix &i)
Definition: solver.h:298
~solver_block()
Definition: solver.h:158
void add_ri(int ieq, int ivar, const matrix &d, const matrix &r, const matrix &i)
Introduces a term of type 's'.
Definition: solver.h:201
double t_eval
Definition: solver.h:656
int order
Definition: solver.h:646
int stage
Definition: solver.h:522
void bc_pol_add_lr(const char *eqn, const char *varn, const matrix &d, const matrix_block_diag &l, const matrix &r)
Definition: solver.h:317
void bc_top1_add_li(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l, const matrix &i)
Definition: solver.h:474
void add_li(int ieq, int ivar, const matrix &d, const matrix &l, const matrix &i)
Introduces a term of type 'm'.
Definition: solver.h:197
void init(int nvar)
Initializes the object with nvar variables.
Definition: solver.cpp:10
void init_sdirk4()
Definition: SDIRK_solver.cpp:409
void right_precond(matrix &)
Definition: solver.h:60
void bc_bot2_add_ri(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &r, const matrix &i)
Definition: solver.h:455
void subst_dep_elem(int i, int k, solver_block *bb, solver_elem *p, const matrix &d, int n2, int m2)
Definition: solver.cpp:2014
double t
Definition: solver.h:519
int ** var_ntop
var_ntop[i][j] is the resolution of the i-th top boundary condition on the j-th variable ...
Definition: solver.h:215
matrix * r
Definition: solver.h:24
matrix * dy
Definition: solver.h:655
matrix * msup
Definition: solver.h:24
matrix b4
Definition: solver.h:518
void add_ri(const char *eqn, const char *varn, const matrix &d, const matrix &r, const matrix &i)
Definition: solver.h:301
virtual void right_precond(matrix &)=0
void init_esdirk4()
Definition: SDIRK_solver.cpp:439
void destroy()
Destroys the object and frees memory.
Definition: solver.cpp:27
void init_sdirk3()
Definition: SDIRK_solver.cpp:391
void regvars(const matrix_map &vars)
Definition: RKF_solver.cpp:96
matrix eq_set
eq_set(i) is 1 if the i-th equation is defined in this block.
Definition: solver.h:154
void fill_void_blocks()
Definition: solver.cpp:326
int maxit_cgs
Definition: solver.h:249
int nv
The number of variables (and equation) of the problem.
Definition: solver.h:141
matrix L
Definition: solver.h:105
void bc_bot1_add_li(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l, const matrix &i)
Definition: solver.h:430
matrix blk_index
Definition: solver.h:25
char ** var
Definition: solver.h:515
int maxit_ref
Definition: solver.h:249
int number_of_implicit_stages()
Definition: SDIRK_solver.cpp:169
void add_r(int ieq, int ivar, const matrix &d, const matrix &r)
Introduces a term of type 'r'.
Definition: solver.h:189
virtual void left_precond(matrix &)=0
void destroy()
Definition: SDIRK_solver.cpp:63
void bc_eq_add_r(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &r)
Definition: solver.h:402
void bc_bot1_add_r(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &r)
Definition: solver.h:424
void set_deriv(const char *var_name, const matrix &value)
Definition: RKF_solver.cpp:140
int get_nblocks()
Definition: solver.cpp:305
void bc_bot2_add_d(int iblock, const char *eqn, const char *varn, const matrix &d)
Definition: solver.h:440
void add_lri(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l, const matrix &r, const matrix &i)
Definition: solver.h:370
void set_vars(const matrix_map &values)
Definition: SDIRK_solver.cpp:226
int number_of_stages()
Definition: SDIRK_solver.cpp:168
void add_lr(int ieq, int ivar, const matrix &d, const matrix &l, const matrix &r)
Introduces a term of type 'f'.
Definition: solver.h:193
void set_step(double)
Definition: SDIRK_solver.cpp:232
RKF_solver()
Definition: RKF_solver.cpp:10
void bc_pol_add_l(const char *eqn, const char *varn, const matrix &d, const matrix_block_diag &l)
Definition: solver.h:311
matrix get_rhs(const char *eqn)
Definition: solver.cpp:358
void back_subs(matrix &)
Definition: solver_full.cpp:239
matrix get_var(const char *var_name)
Definition: SDIRK_solver.cpp:259
int * nc
Definition: solver.h:516
void bc_eq_add_lri(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l, const matrix &r, const matrix &i)
Definition: solver.h:414
void bc_eq_add_lr(const char *eqn, const char *varn, const matrix &d, const matrix_block_diag &l, const matrix &r)
Definition: solver.h:339
void bc_eq_add_li(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l, const matrix &i)
Definition: solver.h:408
void solve_dep()
Solves dependent variables: compute in the sol field the values of dependent variables (have to be ca...
Definition: solver.cpp:2110
matrix a
Definition: solver.h:518
matrix_map get_vars()
Definition: SDIRK_solver.cpp:263
void check_init()
Definition: RKF_solver.cpp:64
matrix * minf
Definition: solver.h:24
matrix * rhs
Definition: solver.h:230
char type[21]
Definition: solver.h:219
matrix get_var(const char *var_name)
Definition: RKF_solver.cpp:123
double get_delta()
Definition: SDIRK_solver.cpp:255
void add_l(int ieq, int ivar, const matrix &d, const matrix &l)
Introduces a term of type 'l'.
Definition: solver.h:185
matrix c
Definition: solver.h:654
void bc_top1_add_d(int iblock, const char *eqn, const char *varn, const matrix &d)
Definition: solver.h:462
matrix * m
Definition: solver.h:24
int sync
Definition: solver.h:220
SDIRK_solver()
Definition: SDIRK_solver.cpp:10
void unwrap(const matrix *, matrix *)
Definition: SDIRK_solver.cpp:293
void bc_pol_add_lri(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l, const matrix &r, const matrix &i)
Definition: solver.h:392
void add_lr(const char *eqn, const char *varn, const matrix &d, const matrix_block_diag &l, const matrix &r)
Definition: solver.h:295
int * nc
Definition: solver.h:649
bool needs_initial_derivative()
Definition: SDIRK_solver.cpp:171
int * nr
Definition: solver.h:649
double t
Definition: solver.h:656
double abs_tol
Definition: solver.h:528
void flush_blocksup(int i)
Definition: solver_full.cpp:387
void bc_bot1_add_l(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l)
Definition: solver.h:421
solver_block * bc_pol
Definition: solver.h:228
matrix reg
Definition: solver.h:221
void bc_bot2_add_li(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l, const matrix &i)
Definition: solver.h:452
int nv
Definition: solver.h:646
int nv
Number of variables of the problem.
Definition: solver.h:212
void bc_pol_add_r(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &r)
Definition: solver.h:380
int cgs(const matrix &rhs, matrix &x, int maxit)
Definition: solver.cpp:772
void set_rhs(const char *eqn, const matrix &b)
Definition: solver.cpp:345
void set_initial_derivatives(const matrix_map &vars)
Definition: SDIRK_solver.cpp:213
void bc_eq_add_lr(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l, const matrix &r)
Definition: solver.h:405
bool initd
Definition: solver.h:520
matrix x
Definition: solver.h:518
char type
Definition: solver.h:104
void mult_op(matrix *)
Definition: solver.cpp:512
void reset()
Resets all equations of the block.
Definition: solver.cpp:40
int get_id(const char *varn)
Definition: RKF_solver.cpp:108
void bc_bot1_add_ri(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &r, const matrix &i)
Definition: solver.h:433
void add_l(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l)
Definition: solver.h:355
matrix D
Definition: solver.h:105
int solver_N
Definition: solver.h:217
void bc_pol_add_li(const char *eqn, const char *varn, const matrix &d, const matrix_block_diag &l, const matrix &i)
Definition: solver.h:320
int stage
Definition: solver.h:653
void init_cn()
Definition: SDIRK_solver.cpp:367
void regvar(const char *var_name, const matrix &initial_value)
Definition: SDIRK_solver.cpp:173
void solve(int *info=NULL)
Solves the set of equations stored in the operator object.
Definition: solver.cpp:392
int * def_nr
def_nr[i] is the number of radial points in the i-th block
Definition: solver.h:218
void check_full(int n, const matrix &opi, int pos)
Definition: solver.cpp:1206
double step
Definition: solver.h:652
Stores all the equations for a given block (a block can either be a domain or a set of boundary condi...
Definition: solver.h:140
void bc_pol_add_lri(const char *eqn, const char *varn, const matrix &d, const matrix_block_diag &l, const matrix &r, const matrix &i)
Definition: solver.h:326
void add_d(int ieq, int ivar, const matrix &d)
Introduces a term of type 'd' for the ivar-th variable in the ieq-th equation.
Definition: solver.h:181
void right_precond(matrix &x)
Definition: solver.h:50
void set_step(double)
Definition: RKF_solver.cpp:104
void bc_eq_add_l(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l)
Definition: solver.h:399
void add_lri(const char *eqn, const char *varn, const matrix &d, const matrix_block_diag &l, const matrix &r, const matrix &i)
Definition: solver.h:304
bool * reg
Definition: solver.h:517
int nstages
Definition: solver.h:646
int * nr
Definition: solver.h:516
int verbose
Definition: solver.h:16
void lu_calc()
Definition: solver_full.cpp:120
bool initd
Definition: solver.h:651
void bc_eq_add_li(const char *eqn, const char *varn, const matrix &d, const matrix_block_diag &l, const matrix &i)
Definition: solver.h:342
int lu_flag
Definition: solver.h:26
bool first_explicit
Definition: solver.h:651
matrix a
Definition: solver.h:654
void bc_top1_add_ri(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &r, const matrix &i)
Definition: solver.h:477
~solver_full()
Definition: solver_full.cpp:49
void bc_pol_add_ri(const char *eqn, const char *varn, const matrix &d, const matrix &r, const matrix &i)
Definition: solver.h:323
virtual matrix solve(const matrix &)=0
void wrap(const matrix *, matrix *)
Definition: SDIRK_solver.cpp:273
bool * reg
Definition: solver.h:650
void bc_eq_add_d(const char *eqn, const char *varn, const matrix &d)
Definition: solver.h:330
void bc_pol_add_l(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l)
Definition: solver.h:377
void create_full()
Creates a solver operator of type "full".
Definition: solver.cpp:868
solver_elem *** eq
Pointers to all the terms of all the equations of the block.
Definition: solver.h:152
solver_elem * next
Pointer to the next term in the equation.
Definition: solver.h:107
void bc_bot2_add_l(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l)
Definition: solver.h:443
matrix solve(const matrix &)
Solves the set of equation stored in the object given the right hand side rhs.
Definition: solver_full.cpp:106
void init_be()
Definition: SDIRK_solver.cpp:360
void destroy()
Definition: RKF_solver.cpp:48
int ** var_nr
var_nr[i][j] is the radial resolution of the j-th variable in the i-th equation
Definition: solver.h:213
void bc_bot1_add_d(int iblock, const char *eqn, const char *varn, const matrix &d)
Definition: solver.h:418
solver_iter()
Definition: solver.h:57
void write_blockinf(int i, const matrix &)
Definition: solver_full.cpp:328
void bc_top1_add_r(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &r)
Definition: solver.h:468
int solve(double t0, double t1)
Definition: RKF_solver.cpp:183
double step
Definition: solver.h:521
void bc_top1_add_l(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l)
Definition: solver.h:465
double alpha
Definition: solver.h:647
char ** var
Definition: solver.h:219
void subst_dep_eq(const char *block_type, solver_block *, int n, int i, int j)
Definition: solver.cpp:1964
~solver_iter()
Definition: solver.h:58
void bc_bot1_add_lri(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l, const matrix &r, const matrix &i)
Definition: solver.h:436
void bc_pol_add_d(int iblock, const char *eqn, const char *varn, const matrix &d)
Definition: solver.h:374
int use_cgs
Definition: solver.h:249
~solver()
Definition: solver.h:256
solver_block()
Definition: solver.h:157
void create()
Creates the solver solver operator depending on the type of solver configured (defined when calling s...
Definition: solver.cpp:840
solver_block * bc_bot2
Definition: solver.h:225
void bc_bot2_add_lri(int iblock, const char *eqn, const char *varn, const matrix &d, const matrix &l, const matrix &r, const matrix &i)
Definition: solver.h:458
int * nth
nth[i] is the azimuthal resolution of the i-th variable.
Definition: solver.h:145
matrix c
Definition: solver.h:518
void add(int iblock, const char *eqn, const char *varn, const char *block_type, char type, const matrix *d, const matrix *l, const matrix *r, const matrix *i)
Definition: solver.cpp:1452
matrix_map get_vars()
Definition: RKF_solver.cpp:127
int get_nvar()
Definition: solver.cpp:299
int get_order()
Definition: SDIRK_solver.cpp:170
void read_block(int i)
Definition: solver_full.cpp:268
double delta
Definition: solver.h:656
solver_block * bc_top2
Definition: solver.h:227
char ** var
Definition: solver.h:648
void left_precond(matrix &)
Definition: solver.h:59
void init_esdirk3()
Definition: SDIRK_solver.cpp:424
void wrap(const matrix *, matrix *)
Definition: RKF_solver.cpp:150
matrix * k
Definition: solver.h:655