save output of "mdump" in ea...

Help
2012-06-27
2013-06-12
  • Mansour. RD.
    Mansour. RD.
    2012-06-27

    Hi,

    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:

    SMPprint(ckt->CKTmatrix, NULL);
    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?

    Cheers,
    M. R. Darabad

     
  • Holger Vogt
    Holger Vogt
    2012-06-29

    What about
    ngspice input.file > output.file
    ?

    Holger

     
  • Mansour. RD.
    Mansour. RD.
    2012-07-05

    Dear Holger,

    I do not know how to use "ngspice input.file > output.file". Can you please explain it in more details?

    Thanks.

     
  • Holger Vogt
    Holger Vogt
    2012-07-05

    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:
    ngspice myinput.cir

    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

    Holger

     
  • Mansour. RD.
    Mansour. RD.
    2012-07-05

    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?

     
  • Holger Vogt
    Holger Vogt
    2012-07-05

    Under Windows in MSYS console (not standard Windows console!) or under LINUX:

    ngspice myinput.cir  2>&1| tee output.out

    Holger

     
  • Mansour. RD.
    Mansour. RD.
    2012-07-05

    Perfect . . .

    Thanks :)