RadauModIntegrationFile Class Reference

Modified Radau input files. More...

#include <orsa_file.h>

Inheritance diagram for RadauModIntegrationFile:

Inheritance graph
[legend]
Collaboration diagram for RadauModIntegrationFile:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 RadauModIntegrationFile (OrbitStream &)
 Modified Radau input files.
void Read ()
void Open ()
void Close ()
virtual std::string GetFileName () const
virtual void SetFileName (std::string name_in)
virtual void SetFileName (char *name_in)

Protected Attributes

std::string filename
FILE_TYPE file
FILE_STATUS status


Detailed Description

Modified Radau input files.

Definition at line 168 of file orsa_file.h.


Constructor & Destructor Documentation

Modified Radau input files.

Definition at line 2289 of file orsa_file.cc.

02289                                                                     : ReadFile() {
02290     os = &osin;
02291   }


Member Function Documentation

void Read (  )  [virtual]

Implements ReadFile.

Definition at line 2293 of file orsa_file.cc.

References Orbit::a, orsa::AU, Orbit::e, OrbitWithEpoch::epoch, orsa::FromUnits(), GETS_FILE, Orbit::i, Orbit::M, orsa::M, Orbit::omega_node, Orbit::omega_pericenter, ReadFile::Open(), orsa::OPEN_R, ORSA_ERROR, orsa::pi, REWIND_FILE, File::status, OrbitStream::timestep, and orsa::YEAR.

02293                                      {
02294     
02295     // if (status == CLOSE) Open();
02296     
02297     Open();
02298     
02299     if (status != OPEN_R){ 
02300       ORSA_ERROR("problems encountered when opening file.");
02301       return;
02302     }
02303     
02304     os->clear();
02305     os->timestep = 0.0;
02306     OrbitWithEpoch fo;
02307     REWIND_FILE(file); 
02308     
02309     double a,e,i,omega_per,omega_nod,M;
02310     double time,time_old=0,timestep;
02311     
02312     char line[1024];
02313     
02314     /* while ( (fscanf(file,"%lf %lf %lf %lf %lf %lf %lf",
02315        &time,&a,&e,&i,&M,&omega_per,&omega_nod)) != EOF ) {
02316     */
02317     
02318     while (GETS_FILE(line,1024,file) != 0) {
02319       
02320       sscanf(line,"%lf %lf %lf %lf %lf %lf %lf",
02321              &time,&a,&e,&i,&M,&omega_per,&omega_nod);
02322       
02323       timestep  = time - time_old;
02324       time_old  = time;
02325       if (os->size() == 2) { 
02326         os->timestep = FromUnits(timestep,YEAR); // read in days, save in the current time units
02327         // cerr << "timestep set to: " << os->timestep << endl;
02328       }
02329       
02330       fo.epoch = FromUnits(time,YEAR); // read in days, save in the current time units
02331       
02332       fo.a                = FromUnits(a,AU);
02333       fo.e                = e;
02334       fo.i                = (pi/180.0)*i;
02335       fo.omega_node       = (pi/180.0)*omega_nod;
02336       fo.omega_pericenter = (pi/180.0)*omega_per;
02337       fo.M                = (pi/180.0)*M;
02338       
02339       os->push_back(fo);  
02340       
02341       // QUICK AND DIRTY!
02342       if (fo.e >= 1.0) {
02343         ORSA_ERROR("reading eccentricity > 1.0, returning.");
02344         return;
02345       }
02346       
02347     }
02348     
02349   }

Here is the call graph for this function:

void Open (  )  [inherited]

void Close (  )  [inherited]

virtual std::string GetFileName (  )  const [inline, virtual, inherited]

Definition at line 99 of file orsa_file.h.

References File::filename.

Referenced by OrsaFile::Read().

00099 { return filename; }

virtual void SetFileName ( std::string  name_in  )  [inline, virtual, inherited]

Definition at line 101 of file orsa_file.h.

References File::Close(), orsa::CLOSE, File::filename, and File::status.

Referenced by OrsaConfigFile::OrsaConfigFile(), and File::SetFileName().

00101                                                         {
00102       if (status != CLOSE) Close();
00103       filename = name_in;
00104     }

Here is the call graph for this function:

virtual void SetFileName ( char *  name_in  )  [inline, virtual, inherited]

Definition at line 106 of file orsa_file.h.

References File::SetFileName().

00106                                                      {
00107       std::string n = name_in;
00108       SetFileName (n);
00109     }

Here is the call graph for this function:


Member Data Documentation

std::string filename [protected, inherited]

FILE_TYPE file [protected, inherited]

FILE_STATUS status [protected, inherited]


The documentation for this class was generated from the following files:

Generated on Thu Feb 14 21:41:44 2008 for liborsa by  doxygen 1.5.5