/[ascend]/trunk/tcltk/generic/interface/Integrators.c
ViewVC logotype

Diff of /trunk/tcltk/generic/interface/Integrators.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 730 by johnpye, Thu Jun 22 00:48:31 2006 UTC revision 731 by johnpye, Tue Jul 4 07:42:06 2006 UTC
# Line 20  Line 20 
20      @file      @file
21      Tcl/Tk interface functions for the Integration feature      Tcl/Tk interface functions for the Integration feature
22  *//*  *//*
23      by Kirk Abbott and Ben Allan      by Kirk Abbott, Ben Allan, John Pye
24      Created: 1/94      Created: 1/94
25      Version: $Revision: 1.32 $      Last in CVS: $Revision: 1.32 $ $Date: 2003/08/23 18:43:06 $ $Author: ballan $
     Version control file: $RCSfile: Integrators.c,v $  
     Date last modified: $Date: 2003/08/23 18:43:06 $  
     Last modified by: $Author: ballan $  
26  */  */
27    
28  #include <tcl.h>  #include <tcl.h>
29    #include <time.h>
30    
31  #include <utilities/ascConfig.h>  #include <utilities/ascConfig.h>
32  #include <solver/integrator.h>  #include <solver/integrator.h>
# Line 44  Line 42 
42  #include "HelpProc.h"  #include "HelpProc.h"
43  #include "SolverGlobals.h"  #include "SolverGlobals.h"
44    
 #ifndef lint  
 static CONST char IntegratorsID[] = "$Id: Integrators.c,v 1.32 2003/08/23 18:43:06 ballan Exp $";  
 #endif  
   
45  #define SNULL (char *)NULL  #define SNULL (char *)NULL
46    
47  static SampleList l_samplelist;  static SampleList l_samplelist;
# Line 233  void Asc_IntegPrintObsHeader(FILE *fp, I Line 227  void Asc_IntegPrintObsHeader(FILE *fp, I
227  }  }
228    
229  /********************************************************************/  /********************************************************************/
230  void Asc_IntegPrintYLine(FILE *fp, IntegratorSystem *blsys)  
231    /**
232        @return 1 on success
233    */
234    int Asc_IntegPrintYLine(FILE *fp, IntegratorSystem *blsys)
235  {  {
236    long i,len;    long i,len;
237    struct var_variable **vp;    struct var_variable **vp;
238    int si;    int si;
239    if (fp==NULL) {    if (fp==NULL) {
240      return;      return 0;
241    }    }
242    if (blsys==NULL) {    if (blsys==NULL) {
243      FPRINTF(ASCERR,"WARNING: (Asc_IntegPrintYLine: called w/o data\n");      FPRINTF(ASCERR,"WARNING: (Asc_IntegPrintYLine: called w/o data\n");
244      return;      return 0;
245    }    }
246    if (blsys->n_y == 0) {    if (blsys->n_y == 0) {
247      return;      return 0;
248    }    }
249    if (blsys->y == NULL) {    if (blsys->y == NULL) {
250      FPRINTF(ASCERR,"ERROR: (Asc_IntegPrintYHeader: called w/NULL data\n");      FPRINTF(ASCERR,"ERROR: (Asc_IntegPrintYHeader: called w/NULL data\n");
251      return;      return 0;
252    }    }
253    vp = blsys->y;    vp = blsys->y;
254    len = blsys->n_y;    len = blsys->n_y;
# Line 260  void Asc_IntegPrintYLine(FILE *fp, Integ Line 258  void Asc_IntegPrintYLine(FILE *fp, Integ
258      FPRINTF(fp,BCOLNFMT, Asc_UnitlessValue(var_instance(vp[i]),si));      FPRINTF(fp,BCOLNFMT, Asc_UnitlessValue(var_instance(vp[i]),si));
259    }    }
260    FPRINTF(fp,"\n");    FPRINTF(fp,"\n");
261      return 1;
262  }  }
263    
264  void Asc_IntegPrintObsLine(FILE *fp, IntegratorSystem *blsys)  /**
265  {      @return 1 on success
266    */
267    int Asc_IntegPrintObsLine(FILE *fp, IntegratorSystem *blsys){
268    long i,len;    long i,len;
269    struct var_variable **vp;    struct var_variable **vp;
270    int si;    int si;
271    if (fp==NULL) {    if (fp==NULL) {
272      return;      return 0;
273    }    }
274    if (blsys==NULL) {    if (blsys==NULL) {
275      FPRINTF(ASCERR,"WARNING: (Asc_IntegPrintObsLine: called w/o data\n");      FPRINTF(ASCERR,"WARNING: (Asc_IntegPrintObsLine: called w/o data\n");
276      return;      return 0;
277    }    }
278    if (blsys->n_obs == 0) {    if (blsys->n_obs == 0) {
279      return;      return 0;
280    }    }
281    if (blsys->obs == NULL) {    if (blsys->obs == NULL) {
282      FPRINTF(ASCERR,"ERROR: (Asc_IntegPrintObsHeader: called w/NULL data\n");      FPRINTF(ASCERR,"ERROR: (Asc_IntegPrintObsHeader: called w/NULL data\n");
283      return;      return 0;
284    }    }
285    vp = blsys->obs;    vp = blsys->obs;
286    len = blsys->n_obs;    len = blsys->n_obs;
# Line 289  void Asc_IntegPrintObsLine(FILE *fp, Int Line 290  void Asc_IntegPrintObsLine(FILE *fp, Int
290      FPRINTF(fp,BCOLNFMT, Asc_UnitlessValue(var_instance(vp[i]),si));      FPRINTF(fp,BCOLNFMT, Asc_UnitlessValue(var_instance(vp[i]),si));
291    }    }
292    FPRINTF(fp,"\n");    FPRINTF(fp,"\n");
293      return 1;
294  }  }
295    
296    
# Line 421  int Asc_IntegGetXSamplesCmd(ClientData c Line 423  int Asc_IntegGetXSamplesCmd(ClientData c
423    char *ustring;    char *ustring;
424    double *uv;    double *uv;
425    int trydu=0, prec, stat=0;    int trydu=0, prec, stat=0;
   SampleList *samples;  
426    
427    UNUSED_PARAMETER(cdata);    UNUSED_PARAMETER(cdata);
428    
# Line 883  IntegratorReporter *Asc_GetIntegReporter Line 884  IntegratorReporter *Asc_GetIntegReporter
884  }  }
885    
886  int Asc_IntegReporterInit(IntegratorSystem *blsys){  int Asc_IntegReporterInit(IntegratorSystem *blsys){
887        int status = 1;
888    
889      CONSOLE_DEBUG("INITIALISING REPORTER");      CONSOLE_DEBUG("INITIALISING REPORTER");
890    
891      /* set up output files */      /* set up output files */
# Line 897  int Asc_IntegReporterInit(IntegratorSyst Line 900  int Asc_IntegReporterInit(IntegratorSyst
900      CONSOLE_DEBUG("WRITING HEADERS");      CONSOLE_DEBUG("WRITING HEADERS");
901    
902      /* write headers to yout, obsout and initial points */      /* write headers to yout, obsout and initial points */
903        
904      Asc_IntegPrintYHeader(integ_y_out,blsys);      Asc_IntegPrintYHeader(integ_y_out,blsys);
905      Asc_IntegPrintYLine(integ_y_out,blsys);      status &= Asc_IntegPrintYLine(integ_y_out,blsys);
906      Asc_IntegPrintObsHeader(integ_obs_out,blsys);      Asc_IntegPrintObsHeader(integ_obs_out,blsys);
907      Asc_IntegPrintObsLine(integ_obs_out,blsys);      status &= Asc_IntegPrintObsLine(integ_obs_out,blsys);
908    
909        return status;
910  }  }
911    
912  int Asc_IntegReporterWrite(IntegratorSystem *blsys){  int Asc_IntegReporterWrite(IntegratorSystem *blsys){
913      /* write out a line of stuff */      /* write out a line of stuff */
914      Asc_IntegPrintYLine(integ_y_out,blsys);      return Asc_IntegPrintYLine(integ_y_out,blsys);
915  }  }
916    
917  int Asc_IntegReporterWriteObs(IntegratorSystem *blsys){  int Asc_IntegReporterWriteObs(IntegratorSystem *blsys){
918      Asc_IntegPrintObsLine(integ_obs_out,blsys);      return Asc_IntegPrintObsLine(integ_obs_out,blsys);
919  }  }
920    
921  int Asc_IntegReporterClose(IntegratorSystem *blsys){  int Asc_IntegReporterClose(IntegratorSystem *blsys){
# Line 921  int Asc_IntegReporterClose(IntegratorSys Line 927  int Asc_IntegReporterClose(IntegratorSys
927      if (integ_obs_out!=NULL) {      if (integ_obs_out!=NULL) {
928          fclose(integ_obs_out);          fclose(integ_obs_out);
929      }      }
930        return 1;
931  }  }
932    

Legend:
Removed from v.730  
changed lines
  Added in v.731

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22