faunus
Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
Faunus::StructureFileReader Class Referenceabstract

Base class to load simple structure files such as XYZ, AAM, PQR etc. More...

#include <io.h>

Inheritance diagram for Faunus::StructureFileReader:
Inheritance graph
[legend]

Public Member Functions

ParticleVectorload (std::istream &stream)
 Load entire stream and populate data.
 
ParticleVectorload (std::string_view filename)
 

Public Attributes

ParticleVector particles
 
Point box_length = Point::Zero()
 
std::vector< std::string > comments
 
bool prefer_charges_from_file
 If applicable, prefer charges from AAM file over AtomData More...
 
bool box_dimension_support = false
 
bool particle_charge_support = false
 
bool particle_radius_support = false
 

Protected Member Functions

void getNextLine (std::istream &stream, std::string &destination, const std::string &comment_identifiers)
 Helper function to forward stream. More...
 
void handleChargeMismatch (Particle &particle, int atom_index) const
 Policy if charge mismatch.
 

Static Protected Member Functions

static size_t getNumberOfAtoms (const std::string &line)
 Helper function to extract N.
 
static void handleRadiusMismatch (const Particle &particle, double radius, int atom_index)
 Policy if radius mismatch.
 

Protected Attributes

size_t expected_number_of_particles = 0
 

Detailed Description

Base class to load simple structure files such as XYZ, AAM, PQR etc.

Member Function Documentation

◆ getNextLine()

void Faunus::StructureFileReader::getNextLine ( std::istream &  stream,
std::string &  destination,
const std::string &  comment_identifiers 
)
protected

Helper function to forward stream.

Parameters
streamStream to operate on
destinationDestination string for loaded line
comment_identifiersArray of characters used to identify comment lines, e.g. "#", ";" etc.
Exceptions
Ifline cannot be loaded

If the first character in the loaded line matches any character in comment_identifiers, the line will be ignored and the next will be loaded.

Member Data Documentation

◆ prefer_charges_from_file

bool Faunus::StructureFileReader::prefer_charges_from_file
Initial value:
=
true

If applicable, prefer charges from AAM file over AtomData


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