Skip to content

Commit

Permalink
MAINT: simplify a bit
Browse files Browse the repository at this point in the history
[test lsoda] [test radau5]
  • Loading branch information
WarrenWeckesser committed Sep 24, 2024
1 parent 1d8703d commit 418eb6a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 69 deletions.
24 changes: 6 additions & 18 deletions src/vf_auto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,9 @@ void VectorField::PrintAUTO(map<string, string> options)
fout << " dimension u_(" << nv << "), F_(" << nv << ")\n";
fout << " dimension par_(" << np << ")\n";
fout << " dimension DFDU_(" << nv << "," << nv << "), DFDP_(" << nv << "," << np << ")\n";
if (nc > 0) {
F77Declare(fout, conname_list);
}
if (np > 0) {
F77Declare(fout, parname_list);
}
if (na > 0) {
F77Declare(fout, exprname_list);
}
F77Declare(fout, conname_list);
F77Declare(fout, parname_list);
F77Declare(fout, exprname_list);
F77Declare(fout, varname_list);
fout << endl;
if (nc > 0) {
Expand Down Expand Up @@ -156,15 +150,9 @@ void VectorField::PrintAUTO(map<string, string> options)
fout << " double precision u_, par_\n";
fout << " dimension u_(" << nv << "), par_(" << np << ")\n";

if (nc > 0) {
F77Declare(fout, conname_list);
}
if (np > 0) {
F77Declare(fout, parname_list);
}
if (na > 0) {
F77Declare(fout, exprname_list);
}
F77Declare(fout, conname_list);
F77Declare(fout, parname_list);
F77Declare(fout, exprname_list);
F77Declare(fout, varname_list);
if (HasPi) {
fout << " double precision Pi\n";
Expand Down
40 changes: 10 additions & 30 deletions src/vf_lsoda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,9 @@ void VectorField::PrintLSODA(map<string, string> options)
fout << " dimension rpar_(" << np << ")\n";
fout << " common /" << Name() << "_parameters/ rpar_\n";
}
if (nc > 0) {
F77Declare(fout, conname_list);
}
if (np > 0) {
F77Declare(fout, parname_list);
}
if (na > 0) {
F77Declare(fout, exprname_list);
}
F77Declare(fout, conname_list);
F77Declare(fout, parname_list);
F77Declare(fout, exprname_list);
F77Declare(fout, varname_list);
if (HasPi) {
fout << " double precision Pi\n";
Expand Down Expand Up @@ -160,12 +154,8 @@ void VectorField::PrintLSODA(map<string, string> options)
fout << " dimension rpar_(" << np << ")\n";
fout << " common /" << Name() << "_parameters/ rpar_\n";
}
if (nc > 0) {
F77Declare(fout, conname_list);
}
if (np > 0) {
F77Declare(fout, parname_list);
}
F77Declare(fout, conname_list);
F77Declare(fout, parname_list);
F77Declare(fout, varname_list);
if (HasPi) {
fout << " double precision Pi\n";
Expand Down Expand Up @@ -238,15 +228,9 @@ void VectorField::PrintLSODA(map<string, string> options)
fout << " dimension rpar_(" << np << ")\n";
fout << " common /" << Name() << "_parameters/ rpar_\n";
}
if (nc > 0) {
F77Declare(fout, conname_list);
}
if (np > 0) {
F77Declare(fout, parname_list);
}
if (na > 0) {
F77Declare(fout, exprname_list);
}
F77Declare(fout, conname_list);
F77Declare(fout, parname_list);
F77Declare(fout, exprname_list);
F77Declare(fout, varname_list);
fout << endl;
if (HasPi) {
Expand Down Expand Up @@ -336,12 +320,8 @@ void VectorField::PrintLSODA(map<string, string> options)
}
fout << " integer neq_, i_, j_, nsteps_\n";
fout << " integer itol_, iopt_, itask_, istate_, jt_, lrw_, liw_\n";
if (nc > 0) {
F77Declare(fout, conname_list);
}
if (np > 0) {
F77Declare(fout, parname_list);
}
F77Declare(fout, conname_list);
F77Declare(fout, parname_list);
F77Declare(fout, varname_list);
if (HasPi) {
fout << " double precision Pi\n";
Expand Down
28 changes: 7 additions & 21 deletions src/vf_radau5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,9 @@ void VectorField::PrintRadau5(map<string, string> options)
fout << " integer n_, ipar_\n";
fout << " double precision t_, y_, f_, rpar_\n";
fout << " dimension y_(" << nv << "), f_(" << nv << "), rpar_(" << np << ")\n";
if (nc > 0) {
F77Declare(fout, conname_list);
}
if (np > 0) {
F77Declare(fout, parname_list);
}
if (na > 0) {
F77Declare(fout, exprname_list);
}
F77Declare(fout, conname_list);
F77Declare(fout, parname_list);
F77Declare(fout, exprname_list);
F77Declare(fout, varname_list);
fout << endl;
if (nc > 0) {
Expand Down Expand Up @@ -131,12 +125,8 @@ void VectorField::PrintRadau5(map<string, string> options)
fout << " integer n_, ldfy_, ipar_\n";
fout << " double precision t_, y_, dfy_, rpar_\n";
fout << " dimension y_(" << nv << "), dfy_(ldfy_," << nv << "), rpar_(" << np << ")\n";
if (nc > 0) {
F77Declare(fout, conname_list);
}
if (np > 0) {
F77Declare(fout, parname_list);
}
F77Declare(fout, conname_list);
F77Declare(fout, parname_list);
F77Declare(fout, varname_list);
fout << endl;
if (nc > 0) {
Expand Down Expand Up @@ -216,12 +206,8 @@ void VectorField::PrintRadau5(map<string, string> options)
fout << " integer i_\n";
fout << " double precision t_, tstop_\n";
fout << " double precision atol_, rtol_, h_\n";
if (nc > 0) {
F77Declare(fout, conname_list);
}
if (np > 0) {
F77Declare(fout,parname_list);
}
F77Declare(fout, conname_list);
F77Declare(fout,parname_list);
F77Declare(fout,varname_list);
if (HasPi) {
fout << " double precision Pi\n";
Expand Down

0 comments on commit 418eb6a

Please sign in to comment.