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

#include <dynamicdatareader.h>

Inheritance diagram for oofem::DynamicDataReader:
Collaboration diagram for oofem::DynamicDataReader:

Public Member Functions

 DynamicDataReader (std ::string name)
 Constructor.
virtual ~DynamicDataReader ()
 DynamicDataReader (const DynamicDataReader &src)=delete
DynamicDataReaderoperator= (const DynamicDataReader &src)=delete
void insertInputRecord (InputRecordType type, std::unique_ptr< InputRecord > record)
void setOutputFileName (const std ::string &outputFileName)
void setDescription (const std ::string &description)
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).
void writeToFile (const char *fileName)
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 Attributes

std::string name
std::vector< std::unique_ptr< InputRecord > >::iterator it
 Keeps track of the current position in the list.
std ::vector< std ::unique_ptr< InputRecord > > recordList
 All record types will be appended to this list, no split in terms of InputRecordType is implemented yet.
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 a dynamic data reader for in-code use. Despite its name, it can also write OOFEM text-input files.

See also
DynamicInputRecord It is the intended complement for in-code generation of FE-problem intialization.
Author
Mikael Öhman
Todo
InputRecordType is ignored. It shouldn't be too difficult to respect it, but it's not necessary.

Definition at line 53 of file dynamicdatareader.h.

Constructor & Destructor Documentation

◆ DynamicDataReader() [1/2]

oofem::DynamicDataReader::DynamicDataReader ( std ::string name)

Constructor.

Definition at line 43 of file dynamicdatareader.C.

References oofem::DataReader::DataReader(), it, name, and recordList.

Referenced by DynamicDataReader(), and operator=().

◆ ~DynamicDataReader()

oofem::DynamicDataReader::~DynamicDataReader ( )
virtual

Definition at line 48 of file dynamicdatareader.C.

◆ DynamicDataReader() [2/2]

oofem::DynamicDataReader::DynamicDataReader ( const DynamicDataReader & src)
delete

References DynamicDataReader().

Member Function Documentation

◆ finish()

void oofem::DynamicDataReader::finish ( )
overridevirtual

Allows to detach all data connections.

Implements oofem::DataReader.

Definition at line 84 of file dynamicdatareader.C.

References recordList.

◆ giveInputRecord()

InputRecord & oofem::DynamicDataReader::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 61 of file dynamicdatareader.C.

References it, and recordList.

Referenced by oofem::StructuralFE2MaterialStatus::copyStateVariables(), and oofem::XfemStructureManager::splitCracks().

◆ giveReferenceName()

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

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

Implements oofem::DataReader.

Definition at line 90 of file dynamicdatareader.h.

References name.

◆ insertInputRecord()

void oofem::DynamicDataReader::insertInputRecord ( InputRecordType type,
std::unique_ptr< InputRecord > record )

Main purpose of this class it the possibility to add new input records in code. The input records can be any implementation, but the intended use would be together with the DynamicInputRecord class.

Parameters
typeCurrently ignored, but left here for consistency with giveInputRecord
recordNew record to be added at the end. New input records have to be added in the same order as the text input files do it.

Definition at line 53 of file dynamicdatareader.C.

References it, and recordList.

Referenced by oofem::Delamination::appendInputRecords(), oofem::GeometryBasedEI::appendInputRecords(), oofem::NCPrincipalStrain::appendInputRecords(), oofem::NCPrincipalStress::appendInputRecords(), oofem::NucleationCriterion::appendInputRecords(), and operator=().

◆ operator=()

DynamicDataReader & oofem::DynamicDataReader::operator= ( const DynamicDataReader & src)
delete

◆ peekNext()

bool oofem::DynamicDataReader::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 74 of file dynamicdatareader.C.

References it.

◆ setDescription()

void oofem::DynamicDataReader::setDescription ( const std ::string & description)
inline

Sets the description line. Used for writing input files.

Definition at line 85 of file dynamicdatareader.h.

References oofem::DataReader::description.

◆ setOutputFileName()

void oofem::DynamicDataReader::setOutputFileName ( const std ::string & outputFileName)
inline

Sets the output file name. Used for writing input files.

Definition at line 81 of file dynamicdatareader.h.

References oofem::DataReader::outputFileName.

◆ writeToFile()

void oofem::DynamicDataReader::writeToFile ( const char * fileName)

Writes all input records to file.

Parameters
fileNameName of file to dump data to.

Definition at line 90 of file dynamicdatareader.C.

References oofem::DataReader::description, oofem::DataReader::outputFileName, and recordList.

Member Data Documentation

◆ it

std::vector<std::unique_ptr<InputRecord>>::iterator oofem::DynamicDataReader::it
protected

Keeps track of the current position in the list.

Definition at line 58 of file dynamicdatareader.h.

Referenced by DynamicDataReader(), giveInputRecord(), insertInputRecord(), and peekNext().

◆ name

std::string oofem::DynamicDataReader::name
protected

Definition at line 56 of file dynamicdatareader.h.

Referenced by DynamicDataReader(), and giveReferenceName().

◆ recordList

std :: vector< std :: unique_ptr< InputRecord > > oofem::DynamicDataReader::recordList
protected

All record types will be appended to this list, no split in terms of InputRecordType is implemented yet.

Definition at line 60 of file dynamicdatareader.h.

Referenced by DynamicDataReader(), finish(), giveInputRecord(), insertInputRecord(), and writeToFile().


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