1 | /****************************************************************************** |
---|
2 | |
---|
3 | KPP - The Kinetic PreProcessor |
---|
4 | Builds simulation code for chemical kinetic systems |
---|
5 | |
---|
6 | Copyright (C) 1995-1996 Valeriu Damian and Adrian Sandu |
---|
7 | Copyright (C) 1997-2005 Adrian Sandu |
---|
8 | |
---|
9 | KPP is free software; you can redistribute it and/or modify it under the |
---|
10 | terms of the GNU General Public License as published by the Free Software |
---|
11 | Foundation (http://www.gnu.org/copyleft/gpl.html); either version 2 of the |
---|
12 | License, or (at your option) any later version. |
---|
13 | |
---|
14 | KPP is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
15 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
---|
16 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
---|
17 | details. |
---|
18 | |
---|
19 | You should have received a copy of the GNU General Public License along |
---|
20 | with this program; if not, consult http://www.gnu.org/copyleft/gpl.html or |
---|
21 | write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
22 | Boston, MA 02111-1307, USA. |
---|
23 | |
---|
24 | Adrian Sandu |
---|
25 | Computer Science Department |
---|
26 | Virginia Polytechnic Institute and State University |
---|
27 | Blacksburg, VA 24060 |
---|
28 | E-mail: sandu@cs.vt.edu |
---|
29 | |
---|
30 | ******************************************************************************/ |
---|
31 | |
---|
32 | |
---|
33 | #include "gdata.h" |
---|
34 | #include "scan.h" |
---|
35 | |
---|
36 | void WriteAtoms() |
---|
37 | { |
---|
38 | int i; |
---|
39 | |
---|
40 | printf("\nATM -----------------------------------------------" ); |
---|
41 | |
---|
42 | for( i = 0; i < SpeciesNr; i++ ) { |
---|
43 | switch( AtomTable[i].check ) { |
---|
44 | case NO_CHECK: |
---|
45 | printf( "\n(%3d) %6s, NO -- ------ ", i, AtomTable[i].name ); |
---|
46 | break; |
---|
47 | case DO_CHECK: |
---|
48 | printf( "\n(%3d) %6s, -- DO ------", i, AtomTable[i].name ); |
---|
49 | break; |
---|
50 | case CANCEL_CHECK: |
---|
51 | printf( "\n(%3d) %6s, -- -- CANCEL", i, AtomTable[i].name ); |
---|
52 | break; |
---|
53 | default: |
---|
54 | printf( "\n(%3d) %6s, -- -- ------ UNKNOWN [%d]", i, |
---|
55 | AtomTable[i].name, AtomTable[i].check ); |
---|
56 | break; |
---|
57 | } |
---|
58 | } |
---|
59 | } |
---|
60 | |
---|
61 | void WriteSpecies() |
---|
62 | { |
---|
63 | int i; |
---|
64 | int j; |
---|
65 | char *type; |
---|
66 | char *lookat; |
---|
67 | |
---|
68 | printf("\nSPC -----------------------------------------------" ); |
---|
69 | |
---|
70 | for( i = 0; i < SpeciesNr; i++ ) { |
---|
71 | |
---|
72 | switch( SpeciesTable[i].type ) { |
---|
73 | case VAR_SPC: type = "V - -"; break; |
---|
74 | case RAD_SPC: type = "- R -"; break; |
---|
75 | case FIX_SPC: type = "- - F"; break; |
---|
76 | default: type = "? ? ?"; break; |
---|
77 | } |
---|
78 | |
---|
79 | switch( SpeciesTable[i].lookat ) { |
---|
80 | case 0: lookat = "----"; break; |
---|
81 | case 1: lookat = "LOOK"; break; |
---|
82 | default: lookat = "????"; break; |
---|
83 | } |
---|
84 | |
---|
85 | printf( "\n(%3d) %-10s, type %s,%s {", |
---|
86 | i, SpeciesTable[i].name, type, lookat ); |
---|
87 | for( j = 0; j < SpeciesTable[i].nratoms; j++ ) |
---|
88 | printf( " %d%s", SpeciesTable[i].atoms[j].nr, |
---|
89 | AtomTable[ SpeciesTable[i].atoms[j].code ].name ); |
---|
90 | printf("}"); |
---|
91 | } |
---|
92 | } |
---|
93 | |
---|
94 | void WriteMatrices() |
---|
95 | { |
---|
96 | int i, j; |
---|
97 | |
---|
98 | printf("\nMAT ------------------ cc -------------------------" ); |
---|
99 | for( i = 0; i < SpcNr; i++ ) { |
---|
100 | printf("\n %-6s (%d)[%d] ", SpeciesTable[ Code[i] ].name, |
---|
101 | SpeciesTable[ Code[i] ].type, Code[i] ); |
---|
102 | for( j = 0; j < EqnNr; j++ ) { |
---|
103 | printf( "%5.1f ", Stoich_Left[i][j] ); |
---|
104 | } |
---|
105 | } |
---|
106 | |
---|
107 | printf("\nMAT ------------------ cd -------------------------" ); |
---|
108 | for( i = 0; i < SpcNr; i++ ) { |
---|
109 | printf("\n %-6s (%d)[%d] ", SpeciesTable[ Code[i] ].name, |
---|
110 | SpeciesTable[ Code[i] ].type, Code[i] ); |
---|
111 | for( j = 0; j < EqnNr; j++ ) { |
---|
112 | printf( "%5.1f ", Stoich_Right[i][j] ); |
---|
113 | } |
---|
114 | } |
---|
115 | |
---|
116 | printf("\nMAT ------------------ cf -------------------------" ); |
---|
117 | for( i = 0; i < SpcNr; i++ ) { |
---|
118 | printf("\n %-6s (%d)[%d] <r%d> ", SpeciesTable[ Code[i] ].name, |
---|
119 | SpeciesTable[ Code[i] ].type, Code[i], Reactive[i] ); |
---|
120 | for( j = 0; j < EqnNr; j++ ) { |
---|
121 | printf( "%5.1f ", Stoich[i][j] ); |
---|
122 | } |
---|
123 | } |
---|
124 | } |
---|
125 | |
---|
126 | void WriteOptions() |
---|
127 | { |
---|
128 | printf("\n### Options -------------------------------------------\n"); |
---|
129 | if( useAggregate ) printf("FUNCTION - AGGREGATE\n"); |
---|
130 | else printf("FUNCTION - SPLIT\n"); |
---|
131 | switch ( useJacobian ) { |
---|
132 | case JAC_OFF: printf("JACOBIAN - OFF\n"); break; |
---|
133 | case JAC_FULL: printf("JACOBIAN - FULL\n"); break; |
---|
134 | case JAC_LU_ROW: printf("JACOBIAN - SPARSE W/ ACCOUNT FOR LU DECOMPOSITION FILL-IN\n"); break; |
---|
135 | case JAC_ROW: printf("JACOBIAN - SPARSE\n"); break; |
---|
136 | } |
---|
137 | if( useDouble ) printf("DOUBLE - ON\n"); |
---|
138 | else printf("DOUBLE - OFF\n"); |
---|
139 | if( useReorder ) printf("REORDER - ON\n"); |
---|
140 | else printf("REORDER - OFF\n"); |
---|
141 | if( useMex ) printf("MEX - ON\n"); |
---|
142 | else printf("MEX - OFF\n"); |
---|
143 | if( useDummyindex) printf("DUMMYINDEX - ON\n"); |
---|
144 | else printf("DUMMYINDEX - OFF\n"); |
---|
145 | if( useEqntags) printf("EQNTAGS - ON\n"); |
---|
146 | else printf("EQNTAGS - OFF\n"); |
---|
147 | } |
---|
148 | |
---|