OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
oofem::OOFEMTXTDataReader Class Reference

Class representing the implementation of plain text date reader. More...

#include <oofemtxtdatareader.h>

+ Inheritance diagram for oofem::OOFEMTXTDataReader:
+ Collaboration diagram for oofem::OOFEMTXTDataReader:

Public Member Functions

 OOFEMTXTDataReader (std::string inputfilename)
 Constructor. More...
 
 OOFEMTXTDataReader (const OOFEMTXTDataReader &x)
 
virtual ~OOFEMTXTDataReader ()
 
virtual InputRecordgiveInputRecord (InputRecordType, int recordId)
 Returns input record corresponding to given InputRecordType value and its record_id. More...
 
virtual bool peakNext (const std::string &keyword)
 Peak in advance into the record list. More...
 
virtual void finish ()
 Allows to detach all data connections. More...
 
virtual std::string giveReferenceName () const
 Gives the reference file name (e.g. file name) More...
 
- Public Member Functions inherited from oofem::DataReader
 DataReader ()
 
virtual ~DataReader ()
 
std::string giveOutputFileName ()
 Gives the output file name. More...
 
std::string giveDescription ()
 Gives the problem description. More...
 
void report_error (const char *_class, const char *proc, const char *kwd, IRResultType result, const char *file, int line)
 Prints the error message. More...
 

Protected Member Functions

bool giveLineFromInput (std::ifstream &stream, int &lineNum, std::string &line)
 Reads one line from inputStream Parts within quotations have case preserved. More...
 
bool giveRawLineFromInput (std::ifstream &stream, int &lineNum, std::string &line)
 Reads one line from stream. More...
 

Protected Attributes

std::string dataSourceName
 
std::list< OOFEMTXTInputRecordrecordList
 
std::list< OOFEMTXTInputRecord >::iterator it
 Keeps track of the current position in the list. More...
 
- Protected Attributes inherited from oofem::DataReader
std::string outputFileName
 Output file name (first line in OOFEM input files). More...
 
std::string description
 Description line (second line in OOFEM input files). More...
 

Additional Inherited Members

- Public Types inherited from oofem::DataReader
enum  InputRecordType {
  IR_domainRec, IR_outManRec, IR_domainCompRec, IR_geometryRec,
  IR_gbpmRec, IR_emodelRec, IR_mstepRec, IR_expModuleRec,
  IR_dofmanRec, IR_elemRec, IR_crosssectRec, IR_matRec,
  IR_nlocBarRec, IR_bcRec, IR_icRec, IR_funcRec,
  IR_setRec, IR_xfemManRec, IR_enrichFuncRec, IR_geoRec,
  IR_enrichItemRec, IR_enrichFrontRec, IR_propagationLawRec, IR_crackNucleationRec,
  IR_fracManRec, IR_failCritRec, IR_contactManRec, IR_contactDefRec
}
 Determines the type of input record. More...
 

Detailed Description

Class representing the implementation of plain text date reader.

It reads a sequence of input records from data file and creates the corresponding input records. There is no check for record type requested, it is assumed that records are written in correct order, which determined by the coded sequence of component initialization and described in input manual.

Definition at line 52 of file oofemtxtdatareader.h.

Constructor & Destructor Documentation

oofem::OOFEMTXTDataReader::OOFEMTXTDataReader ( std::string  inputfilename)

Constructor.

Todo:
This could be parallelized, but I'm not sure it is worth it (might make debugging faulty input files harder for users as well)

Definition at line 41 of file oofemtxtdatareader.C.

References dataSourceName, oofem::DataReader::description, giveLineFromInput(), giveRawLineFromInput(), it, OOFEM_ERROR, OOFEM_LOG_INFO, oofem::DataReader::outputFileName, and recordList.

oofem::OOFEMTXTDataReader::OOFEMTXTDataReader ( const OOFEMTXTDataReader x)

Definition at line 91 of file oofemtxtdatareader.C.

oofem::OOFEMTXTDataReader::~OOFEMTXTDataReader ( )
virtual

Definition at line 93 of file oofemtxtdatareader.C.

Member Function Documentation

void oofem::OOFEMTXTDataReader::finish ( )
virtual

Allows to detach all data connections.

Implements oofem::DataReader.

Definition at line 115 of file oofemtxtdatareader.C.

References it, OOFEM_WARNING, and recordList.

InputRecord * oofem::OOFEMTXTDataReader::giveInputRecord ( InputRecordType  irType,
int  recordId 
)
virtual

Returns input record corresponding to given InputRecordType value and its record_id.

The returned InputRecord reference is valid only until the next call.

Parameters
irTypeDetermines type of record to be returned.
recordIdDetermines the record number corresponding to component number.

Implements oofem::DataReader.

Definition at line 98 of file oofemtxtdatareader.C.

References it, OOFEM_ERROR, and recordList.

bool oofem::OOFEMTXTDataReader::giveLineFromInput ( std::ifstream &  stream,
int &  lineNum,
std::string &  line 
)
protected

Reads one line from inputStream Parts within quotations have case preserved.

Definition at line 125 of file oofemtxtdatareader.C.

References giveRawLineFromInput().

Referenced by OOFEMTXTDataReader().

bool oofem::OOFEMTXTDataReader::giveRawLineFromInput ( std::ifstream &  stream,
int &  lineNum,
std::string &  line 
)
protected

Reads one line from stream.

Definition at line 147 of file oofemtxtdatareader.C.

Referenced by giveLineFromInput(), and OOFEMTXTDataReader().

virtual std :: string oofem::OOFEMTXTDataReader::giveReferenceName ( ) const
inlinevirtual

Gives the reference file name (e.g. file name)

Implements oofem::DataReader.

Definition at line 70 of file oofemtxtdatareader.h.

bool oofem::OOFEMTXTDataReader::peakNext ( const std::string &  keyword)
virtual

Peak in advance into the record list.

Returns
True if next keyword is a set.

Reimplemented from oofem::DataReader.

Definition at line 107 of file oofemtxtdatareader.C.

References it.

Member Data Documentation

std :: string oofem::OOFEMTXTDataReader::dataSourceName
protected

Definition at line 55 of file oofemtxtdatareader.h.

Referenced by OOFEMTXTDataReader().

std :: list< OOFEMTXTInputRecord >:: iterator oofem::OOFEMTXTDataReader::it
protected

Keeps track of the current position in the list.

Definition at line 59 of file oofemtxtdatareader.h.

Referenced by finish(), giveInputRecord(), OOFEMTXTDataReader(), and peakNext().

std :: list< OOFEMTXTInputRecord > oofem::OOFEMTXTDataReader::recordList
protected

Definition at line 56 of file oofemtxtdatareader.h.

Referenced by finish(), giveInputRecord(), and OOFEMTXTDataReader().


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

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:39 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011