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 2290 of file orsa_file.cc.

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


Member Function Documentation

void Read (  )  [virtual]

Implements ReadFile.

Definition at line 2294 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.

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

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 Sat May 10 00:04:07 2008 for liborsa by  doxygen 1.5.5