I am using the "mdump" and "mrdump" to extract the internal matrices during the simulation process.
I have made some changes to "cktload.c" (ngspice/src/spicelib/analysis/cktload.c). By un-commenting line 169 and adding the equivalent for RHS:
SMPprintRHS(ckt->CKTmatrix , NULL, ckt->CKTrhs, ckt->CKTirhs);
Now, when doing an OP analysis on a circuit, the output gives "Matrix before factorization" in the beginning of each iteration plus some extra information such as largest element, density, etc.
When using MDUMP I could simply save the output matrix to a file by putting filename after mdump command. Now, how can I save the matrix output for each iteration which can be seen on console into a file?
M. R. Darabad
ngspice input.file > output.file
I do not know how to use "ngspice input.file > output.file". Can you please explain it in more details?
Use ngspice in LINUX
or compile ngspice as a console application under MS Windoes and run it in the MS windoes console.
Then you might use output redirection, which places everything senn on the console into a file (your request).
Start ngspice interactively:
Start ngspice with standard output into file (errors still on console)
ngspice myinput.cir > output.out
Start ngspice with all outputs into file
ngspice myinput.cir > output.out 2>&1
Many thanks for the explanation. I tried it and it worked.
Is there any way to have the output date stored in a file and also displayed on the console at the same time?
Under Windows in MSYS console (not standard Windows console!) or under LINUX:
ngspice myinput.cir 2>&1| tee output.out
Perfect . . .