OOFEM 3.0
Loading...
Searching...
No Matches
oofem::OOFEMTXTDataReader Class Reference

#include <oofemtxtdatareader.h>

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

Public Member Functions

 OOFEMTXTDataReader (std ::string inputfilename)
 Constructor.
 OOFEMTXTDataReader (const OOFEMTXTDataReader &x)
virtual ~OOFEMTXTDataReader ()
InputRecordgiveInputRecord (InputRecordType, int recordId) override
bool peekNext (const std ::string &keyword) override
void finish () override
std::string giveReferenceName () const override
 Gives the reference file name (e.g. file name).
Public Member Functions inherited from oofem::DataReader
 DataReader ()
virtual ~DataReader ()
virtual InputRecordgiveTopInputRecord ()
std::string giveOutputFileName ()
 Gives the output file name.
std::string giveDescription ()
 Gives the problem description.
virtual bool hasFlattenedStructure ()
virtual void enterGroup (const std::string &name)
virtual void leaveGroup (const std::string &name)
virtual void enterRecord (InputRecord *rec)
virtual void leaveRecord (InputRecord *rec)
virtual int giveGroupCount (const std::string &name)
bool hasGroup (const std::string &name)
 Predicate whether a named group exists (it can still be empty).
GroupRecords giveGroupRecords (const std::shared_ptr< InputRecord > &ir, InputFieldType ift, const std::string &name, InputRecordType irType, bool optional)
GroupRecords giveGroupRecords (const std::string &name, InputRecordType irType, int numRequired=-1)
InputRecordgiveChildRecord (const std::shared_ptr< InputRecord > &ir, InputFieldType ift, const std::string &name, InputRecordType irType, bool optional)
 Return pointer to subrecord of given type (must be exactly one); if not present, returns nullptr.

Protected Member Functions

bool giveLineFromInput (std ::ifstream &stream, int &lineNum, std ::string &line)
bool giveRawLineFromInput (std ::ifstream &stream, int &lineNum, std ::string &line)
 Reads one line from stream.

Protected Attributes

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

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_contactSurfaceRec , IR_fieldRec ,
  IR_mpmVarRec , IR_mpmTermRec , IR_mpmIntegralRec , IR_unspecified
}
 Determines the type of input record. More...
Static Public Attributes inherited from oofem::DataReader
static constexpr const char * InputRecordTags []
static const int NoSuchGroup =-1

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

◆ OOFEMTXTDataReader() [1/2]

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 42 of file oofemtxtdatareader.C.

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

Referenced by OOFEMTXTDataReader().

◆ OOFEMTXTDataReader() [2/2]

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

Definition at line 92 of file oofemtxtdatareader.C.

References dataSourceName, and OOFEMTXTDataReader().

◆ ~OOFEMTXTDataReader()

oofem::OOFEMTXTDataReader::~OOFEMTXTDataReader ( )
virtual

Definition at line 94 of file oofemtxtdatareader.C.

Member Function Documentation

◆ finish()

◆ giveInputRecord()

InputRecord & oofem::OOFEMTXTDataReader::giveInputRecord ( InputRecordType irType,
int recordId )
overridevirtual

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 99 of file oofemtxtdatareader.C.

References it, OOFEM_ERROR, and recordList.

◆ giveLineFromInput()

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 132 of file oofemtxtdatareader.C.

References giveRawLineFromInput().

Referenced by OOFEMTXTDataReader().

◆ giveRawLineFromInput()

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

Reads one line from stream.

Definition at line 154 of file oofemtxtdatareader.C.

Referenced by giveLineFromInput(), and OOFEMTXTDataReader().

◆ giveReferenceName()

std::string oofem::OOFEMTXTDataReader::giveReferenceName ( ) const
inlineoverridevirtual

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

Implements oofem::DataReader.

Definition at line 70 of file oofemtxtdatareader.h.

References dataSourceName.

◆ peekNext()

bool oofem::OOFEMTXTDataReader::peekNext ( const std ::string & keyword)
overridevirtual

Peak in advance into the record list.

Returns
True if next keyword is a set.

Reimplemented from oofem::DataReader.

Definition at line 109 of file oofemtxtdatareader.C.

References it.

Member Data Documentation

◆ dataSourceName

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

Definition at line 55 of file oofemtxtdatareader.h.

Referenced by giveReferenceName(), OOFEMTXTDataReader(), and OOFEMTXTDataReader().

◆ it

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 peekNext().

◆ recordList

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-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011