STORMM Source Documentation
Loading...
Searching...
No Matches
stormm::testing::FilesControls Class Reference

Distill the results of file identification, producing clean lists of free topologies, free coordinate files, and linked topology / coordinate systems. Record output and trajectory files, if available. More...

#include <nml_files.h>

Public Member Functions

int getStructureCount () const
 Get the structure count, based on the number of free coordinate files as well as the number of systems, with frame counts and replicas therein. If one of the systems does not have the requisite number of frames, this is an error and may be trapped. The structure count reported here is therefore a maximum that can be expected.
 
int getFreeTopologyCount () const
 Get the free topology count.
 
int getFreeCoordinatesCount () const
 Get the free coordinate file count.
 
int getSystemDefinitionCount () const
 Get the number of system specifications made with the -sys keyword.
 
bool readAllFreeFrames () const
 Get the indicator of whether to read all free coordinate files' frames.
 
CoordinateFileKind getOutputCoordinateFormat () const
 Get the coordinate (trajectory) file output format.
 
CoordinateFileKind getCheckpointFormat () const
 Get the coordinate (checkpoint) file output format.
 
TrajectoryFusion getFileFusionProtocol () const
 Get the preferences for fusing output coordinate files.
 
MoleculeSystem getSystem (int index) const
 Get a molecule system from this object's array.
 
std::string getReportFile () const
 Get the name of the report file (equivalent to mdout in sander or pmemd)
 
std::string getInputTranscriptFile () const
 Get the name of the input transcript file (there is no sander or pmemd equivalent other than the verbose reproduction of the input settings at the beginning of mdout)
 
std::string getTrajectoryFileName () const
 Get the base name of trajectory files to write.
 
std::string getCheckpointFileName () const
 Get the base name of (coordinate) checkpoint files to write.
 
std::string getWarningFileName () const
 Get the name of the file containing warnings printed by the program.
 
ModificationPolicy getSdfModificationPolicy () const
 Get the policy on modifying .sdf file outputs to conform to the Biovia standard.
 
ExceptionResponse getSdfNotifications () const
 Get an indication of whether to alert the user when correcting minor mistakes in .sdf files.
 
const NamelistEmulatorgetTranscript () const
 Get the original namelist emulator object as a transcript of the user input.
 
void setAllFreeFrameReading (const bool active)
 Set whether to read all frames from each free trajectory (true), or just the first (false).
 
void addFreeTopologyName (const std::string &file_name)
 Add a free topology to the list, after checking for its prior existence in the list.
 
void addFreeCoordinateName (const std::string &file_name)
 Add a free coordinate file to the list, after checking for its prior existence.
 
void addSystem (const MoleculeSystem &new_mol)
 Add a system to the list.
 
void removeSystem (int index, int stretch=1)
 Remove entries from the systems array.
 
void setReportFileName (const std::string &file_name)
 Set the report file name.
 
void setInputTranscriptFileName (const std::string &file_name)
 Set the input transcript file name.
 
void setGeneralTrajectoryFileName (const std::string &proto_name)
 Set the general (fallback) coordinate output file name.
 
void setGeneralCheckpointFileName (const std::string &proto_name)
 Set the general (fallback) checkpoint file name.
 
void setWarningFileName (const std::string &file_name)
 Set the warning file name.
 
void setSdfModficiationPolicy (ModificationPolicy policy_in)
 Set the .sdf output file modification policy.
 
void setSdfNotifications (ExceptionResponse policy_in)
 Set whether to emit notifications about .sdf output file modifications.
 
 FilesControls (ExceptionResponse policy_in=ExceptionResponse::DIE, WrapTextSearch wrap=WrapTextSearch::NO)
 The constructor can prepare an object with default settings or read the corresponding namelist to accept user input.
 
 FilesControls (const TextFile &tf, int *start_line, bool *found_nml=nullptr, ExceptionResponse policy_in=ExceptionResponse::DIE, WrapTextSearch wrap=WrapTextSearch::NO, const std::vector< std::string > &alternatives={}, const std::vector< std::string > &sys_requirements={"-pe", "-ce"})
 
 FilesControls (const FilesControls &original)=default
 As with other control objects, copy and move constructors, plus copy and move assignment operators, can all take their default forms.
 
 FilesControls (FilesControls &&original)=default
 
FilesControlsoperator= (const FilesControls &original)=default
 
FilesControlsoperator= (FilesControls &&original)=default
 
std::string getFreeTopologyName (int index) const
 Get one or more free topology names.
 
std::vector< std::string > getFreeTopologyNames () const
 
std::string getFreeCoordinateName (int index) const
 Get one or more free coordinate file names.
 
std::vector< std::string > getFreeCoordinateNames () const
 
void setOutputCoordinateFormat (const std::string &traj_kind)
 Set the coordinate (trajectory) file output format.
 
void setOutputCoordinateFormat (CoordinateFileKind traj_kind)
 
void setCheckpointFormat (const std::string &chk_kind)
 Set the checkpoint (coordinate) file output format.
 
void setCheckpointFormat (CoordinateFileKind chk_kind)
 
void removeFreeTopologyName (int index, int stretch=1)
 Remove entries from the free topologies array.
 
void removeFreeTopologyName (const std::string &fname)
 
void removeFreeCoordinateName (int index, int stretch=1)
 Remove entries from the free coordinates array.
 
void removeFreeCoordinateName (const std::string &fname)
 

Detailed Description

Distill the results of file identification, producing clean lists of free topologies, free coordinate files, and linked topology / coordinate systems. Record output and trajectory files, if available.

Constructor & Destructor Documentation

◆ FilesControls()

stormm::namelist::FilesControls::FilesControls ( ExceptionResponse policy_in = ExceptionResponse::DIE,
WrapTextSearch wrap = WrapTextSearch::NO )

The constructor can prepare an object with default settings or read the corresponding namelist to accept user input.

Parameters
policy_inRequested error handling behavior
tfInput file translated into RAM
start_lineLine of the input file to begin searching for the &solvent namelist
found_nmlIndication that the namelist was found
report_name_inNew default name of the report file (for application-specific naming conventions)
coord_base_inNew default base name of trajectory or other coordinate files (for application-specific naming conventions)
coord_ext_inNew default extension of trajectory or other coordinate files (for application-specific naming conventions)
sys_requirementsSystem requirements specifications. The -sys keyword will be critical under different circumstances and has no defaults. Some situations may not require the user to specify all four of the files associated with the -sys keyword, and some situations will require that certain files exist in addition to merely being specified. This array can hold four critical specifiers, -p, -c, -x, and -r, for "topology", "input coordinates", "trajectory", and "restart / checkpoint" files, respectively, and each can accept the extension "e" to indicate that the file must exist. Conversely, a "g" extension indicates that, in that particular context, the file subkey is bogus and should trigger an exception consistent with the stated policy (policy_in). Default requirements are a topology and input coordinates, both of which must exist.
wrapIndicate that the search for a &files namelist should carry on from the beginning of an input file if no such namelist is found starting from the original starting point

Member Function Documentation

◆ addFreeCoordinateName()

void stormm::namelist::FilesControls::addFreeCoordinateName ( const std::string & file_name)

Add a free coordinate file to the list, after checking for its prior existence.

Parameters
file_nameName of the coordinate file to add

◆ addFreeTopologyName()

void stormm::namelist::FilesControls::addFreeTopologyName ( const std::string & file_name)

Add a free topology to the list, after checking for its prior existence in the list.

Parameters
file_nameName of the topology file to add

◆ addSystem()

void stormm::namelist::FilesControls::addSystem ( const MoleculeSystem & new_mol)

Add a system to the list.

Parameters
new_molThe new molecule system to push to the back of the list

◆ getFreeCoordinateName()

std::string stormm::namelist::FilesControls::getFreeCoordinateName ( int index) const

Get one or more free coordinate file names.

Overloaded:

  • Get the free coordinate file named at one index of the array
  • Get all free coordinate file names in the array
Parameters
indexThe index to query

◆ getFreeTopologyName()

std::string stormm::namelist::FilesControls::getFreeTopologyName ( int index) const

Get one or more free topology names.

Overloaded:

  • Get the free topology named at one index of the array
  • Get all free topology names in the array
Parameters
indexThe index to query

◆ getSystem()

MoleculeSystem stormm::namelist::FilesControls::getSystem ( int index) const

Get a molecule system from this object's array.

Parameters
indexThe index to query

◆ removeFreeCoordinateName()

void stormm::namelist::FilesControls::removeFreeCoordinateName ( int index,
int stretch = 1 )

Remove entries from the free coordinates array.

Overloaded:

  • Remove coordinate files in a numbered range
  • Remove a coordinate file by name
Parameters
indexStarting index for system removal, or the one system to remove
stretchNumber of systems, including the starting index, to remove from the list

◆ removeFreeTopologyName()

void stormm::namelist::FilesControls::removeFreeTopologyName ( int index,
int stretch = 1 )

Remove entries from the free topologies array.

Overloaded:

  • Remove topologies in a numbered range
  • Remove a topology by name
Parameters
indexStarting index for system removal, or the one system to remove
stretchNumber of systems, including the starting index, to remove from the list

◆ removeSystem()

void stormm::namelist::FilesControls::removeSystem ( int index,
int stretch = 1 )

Remove entries from the systems array.

Parameters
indexStarting index for system removal, or the one system to remove
stretchNumber of systems, including the starting index, to remove from the list

◆ setAllFreeFrameReading()

void stormm::namelist::FilesControls::setAllFreeFrameReading ( const bool active)

Set whether to read all frames from each free trajectory (true), or just the first (false).

Parameters
activeIndicator of whether to have all free frames read (true), or not (false)

◆ setCheckpointFormat()

void stormm::namelist::FilesControls::setCheckpointFormat ( const std::string & chk_kind)

Set the checkpoint (coordinate) file output format.

Overloaded:

  • Take a string value specifying the coordinate file kind
  • Take the literal, enumerated type
Parameters
chk_kindThe selected checkpoint format

◆ setGeneralCheckpointFileName()

void stormm::namelist::FilesControls::setGeneralCheckpointFileName ( const std::string & proto_name)

Set the general (fallback) checkpoint file name.

Parameters
proto_nameNew generic name for unspecified checkpoint files

◆ setGeneralTrajectoryFileName()

void stormm::namelist::FilesControls::setGeneralTrajectoryFileName ( const std::string & proto_name)

Set the general (fallback) coordinate output file name.

Parameters
proto_nameNew generic name for unspecified trajectory files

◆ setInputTranscriptFileName()

void stormm::namelist::FilesControls::setInputTranscriptFileName ( const std::string & file_name)

Set the input transcript file name.

Parameters
file_nameNew name for the input transcript file

◆ setOutputCoordinateFormat()

void stormm::namelist::FilesControls::setOutputCoordinateFormat ( const std::string & traj_kind)

Set the coordinate (trajectory) file output format.

Overloaded:

  • Take a string value specifying the coordinate file kind
  • Take the literal, enumerated type
Parameters
traj_kindThe selected trajectory format

◆ setReportFileName()

void stormm::namelist::FilesControls::setReportFileName ( const std::string & file_name)

Set the report file name.

Parameters
file_nameNew name for the calculation report file

◆ setSdfModficiationPolicy()

void stormm::namelist::FilesControls::setSdfModficiationPolicy ( ModificationPolicy policy_in)

Set the .sdf output file modification policy.

Parameters
policy_inThe new policy to follow when encountering minor issues in .sdf file data

◆ setSdfNotifications()

void stormm::namelist::FilesControls::setSdfNotifications ( ExceptionResponse policy_in)

Set whether to emit notifications about .sdf output file modifications.

Parameters
policy_inThe policy to follow on making alerts

◆ setWarningFileName()

void stormm::namelist::FilesControls::setWarningFileName ( const std::string & file_name)

Set the warning file name.

Parameters
file_nameNew name for the warnings file

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