Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

Output Class Reference

#include <Output.h>

List of all members.

Public Member Functions

 Output ()
 ~Output ()
void energy (int, BigReal *)
void coordinate (int, int, Vector *, FloatVector *, Lattice &)
void velocity (int, int, Vector *)

Static Public Member Functions

int coordinateNeeded (int)
int velocityNeeded (int)


Constructor & Destructor Documentation

Output::Output  ) 
 

Definition at line 47 of file Output.C.

00047 { }

Output::~Output  ) 
 

Definition at line 57 of file Output.C.

00057 { }


Member Function Documentation

void Output::coordinate int  ,
int  ,
Vector ,
FloatVector ,
Lattice
 

Definition at line 218 of file Output.C.

References SimParameters::dcdFrequency, SimParameters::dcdUnitCell, END_OF_RUN, FILE_OUTPUT, SimParameters::firstTimestep, IMDOutput::gather_coordinates(), Node::getScript(), Node::imd, SimParameters::IMDfreq, SimParameters::IMDon, iout, ScriptTcl::measure(), SimParameters::N, Node::Object(), SimParameters::restartFrequency, Node::simParameters, simParams, and wrap_coor().

Referenced by CollectionMaster::disposePositions().

00220 {
00221   SimParameters *simParams = Node::Object()->simParameters;
00222   double coor_wrapped = 0;
00223   float fcoor_wrapped = 0;
00224 
00225   if ( timestep >= 0 ) {
00226 
00227     //  Output a DCD trajectory 
00228     if ( simParams->dcdFrequency &&
00229        ((timestep % simParams->dcdFrequency) == 0) )
00230     {
00231       wrap_coor(fcoor,lattice,&fcoor_wrapped);
00232       output_dcdfile(timestep, n, fcoor, 
00233           simParams->dcdUnitCell ? &lattice : NULL);
00234     }
00235 
00236     //  Output a restart file
00237     if ( simParams->restartFrequency &&
00238        ((timestep % simParams->restartFrequency) == 0) )
00239     {
00240       iout << "WRITING COORDINATES TO RESTART FILE AT STEP "
00241                                 << timestep << "\n" << endi;
00242       wrap_coor(coor,lattice,&coor_wrapped);
00243       output_restart_coordinates(coor, n, timestep);
00244       iout << "FINISHED WRITING RESTART COORDINATES\n" <<endi;
00245       fflush(stdout);
00246     }
00247 
00248     //  Interactive MD
00249     if ( simParams->IMDon &&
00250        ( ((timestep % simParams->IMDfreq) == 0) ||
00251          (timestep == simParams->firstTimestep) ) )
00252     {
00253       IMDOutput *imd = Node::Object()->imd;
00254       wrap_coor(fcoor,lattice,&fcoor_wrapped);
00255       if (imd != NULL) imd->gather_coordinates(timestep, n, fcoor);
00256     }
00257 
00258   }
00259 
00260   if (timestep == EVAL_MEASURE)
00261   {
00262 #ifdef NAMD_TCL
00263     wrap_coor(coor,lattice,&coor_wrapped);
00264     Node::Object()->getScript()->measure(coor);
00265 #endif
00266   }
00267 
00268   //  Output final coordinates
00269   if (timestep == FILE_OUTPUT || timestep == END_OF_RUN)
00270   {
00271     iout << "WRITING COORDINATES TO OUTPUT FILE AT STEP "
00272                                 << simParams->N << "\n" << endi;
00273     fflush(stdout);
00274     wrap_coor(coor,lattice,&coor_wrapped);
00275     output_final_coordinates(coor, n, simParams->N);
00276   }
00277 
00278   //  Close trajectory files
00279   if (timestep == END_OF_RUN)
00280   {
00281     if (simParams->dcdFrequency) output_dcdfile(END_OF_RUN,0,0, 
00282         simParams->dcdUnitCell ? &lattice : NULL);
00283   }
00284 
00285 }

int Output::coordinateNeeded int   )  [static]
 

Definition at line 77 of file Output.C.

References SimParameters::dcdFrequency, END_OF_RUN, FILE_OUTPUT, SimParameters::firstTimestep, SimParameters::IMDfreq, SimParameters::IMDon, Node::Object(), SimParameters::restartFrequency, Node::simParameters, and simParams.

Referenced by Controller::enqueueCollections(), and Sequencer::submitCollections().

00078 {
00079   SimParameters *simParams = Node::Object()->simParameters;
00080 
00081   int positionsNeeded = 0;
00082 
00083   if ( timestep >= 0 ) {
00084 
00085     //  Output a DCD trajectory 
00086     if ( simParams->dcdFrequency &&
00087        ((timestep % simParams->dcdFrequency) == 0) )
00088     { positionsNeeded |= 1; }
00089 
00090     //  Output a restart file
00091     if ( simParams->restartFrequency &&
00092        ((timestep % simParams->restartFrequency) == 0) )
00093     { positionsNeeded |= 2; }
00094 
00095     //  Iteractive MD
00096     if ( simParams->IMDon &&
00097        ( ((timestep % simParams->IMDfreq) == 0) ||
00098          (timestep == simParams->firstTimestep) ) )
00099       { positionsNeeded |= 1; }
00100 
00101   }
00102 
00103   //  Output final coordinates
00104   if (timestep == FILE_OUTPUT || timestep == END_OF_RUN ||
00105                                         timestep == EVAL_MEASURE)
00106   {
00107     positionsNeeded |= 2;
00108   }
00109 
00110   return positionsNeeded;
00111 }

void Output::energy int  ,
BigReal
 

void Output::velocity int  ,
int  ,
Vector
 

Definition at line 333 of file Output.C.

References END_OF_RUN, FILE_OUTPUT, iout, SimParameters::N, Node::Object(), SimParameters::restartFrequency, Node::simParameters, simParams, and SimParameters::velDcdFrequency.

Referenced by CollectionMaster::disposeVelocities().

00334 {
00335   SimParameters *simParams = Node::Object()->simParameters;
00336 
00337   if ( timestep >= 0 ) {
00338 
00339     //  Output velocity DCD trajectory
00340     if ( simParams->velDcdFrequency &&
00341        ((timestep % simParams->velDcdFrequency) == 0) )
00342     {
00343       output_veldcdfile(timestep, n, vel);
00344     }
00345 
00346   //  Output restart file
00347     if ( simParams->restartFrequency &&
00348        ((timestep % simParams->restartFrequency) == 0) )
00349     {
00350       iout << "WRITING VELOCITIES TO RESTART FILE AT STEP "
00351                                 << timestep << "\n" << endi;
00352       output_restart_velocities(timestep, n, vel);
00353       iout << "FINISHED WRITING RESTART VELOCITIES\n" <<endi;
00354       fflush(stdout);
00355     }
00356 
00357   }
00358 
00359   //  Output final velocities
00360   if (timestep == FILE_OUTPUT || timestep == END_OF_RUN)
00361   {
00362     iout << "WRITING VELOCITIES TO OUTPUT FILE AT STEP "
00363                                 << simParams->N << "\n" << endi;
00364     fflush(stdout);
00365     output_final_velocities(simParams->N, n, vel);
00366   }
00367 
00368   //  Close trajectory files
00369   if (timestep == END_OF_RUN)
00370   {
00371     if (simParams->velDcdFrequency) output_veldcdfile(END_OF_RUN,0,0);
00372   }
00373 
00374 }

int Output::velocityNeeded int   )  [static]
 

Definition at line 304 of file Output.C.

References FILE_OUTPUT, Node::Object(), SimParameters::restartFrequency, Node::simParameters, simParams, and SimParameters::velDcdFrequency.

Referenced by Controller::enqueueCollections(), and Sequencer::submitCollections().

00305 {
00306   SimParameters *simParams = Node::Object()->simParameters;
00307 
00308   int velocitiesNeeded = 0;
00309 
00310   if ( timestep >= 0 ) {
00311 
00312     //  Output a velocity DCD trajectory
00313     if ( simParams->velDcdFrequency &&
00314        ((timestep % simParams->velDcdFrequency) == 0) )
00315       { velocitiesNeeded |= 1; }
00316 
00317     //  Output a restart file
00318     if ( simParams->restartFrequency &&
00319        ((timestep % simParams->restartFrequency) == 0) )
00320       { velocitiesNeeded |= 2; }
00321 
00322   }
00323 
00324   //  Output final velocities
00325   if (timestep == FILE_OUTPUT || timestep == END_OF_RUN)
00326   {
00327     velocitiesNeeded |= 2;
00328   }
00329 
00330   return velocitiesNeeded;
00331 }


The documentation for this class was generated from the following files:
Generated on Mon Nov 23 05:00:03 2009 for NAMD by  doxygen 1.3.9.1