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

Class representing the implementation of a dynamic data reader for in-code use. More...

#include <dynamicdatareader.h>

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

Public Member Functions

 DynamicDataReader (std::string name)
 Constructor. More...
 
virtual ~DynamicDataReader ()
 
 DynamicDataReader (const DynamicDataReader &src)=delete
 
DynamicDataReaderoperator= (const DynamicDataReader &src)=delete
 
void insertInputRecord (InputRecordType type, InputRecord *record)
 Main purpose of this class it the possibility to add new input records in code. More...
 
void setOutputFileName (const std::string &outputFileName)
 Sets the output file name. More...
 
void setDescription (const std::string &description)
 Sets the description line. More...
 
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...
 
void writeToFile (const char *fileName)
 Writes all input records to file. 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 Attributes

std::string name
 
std::vector< std::unique_ptr< InputRecord > >::iterator it
 Keeps track of the current position in the list. More...
 
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. 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 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

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

Constructor.

Definition at line 43 of file dynamicdatareader.C.

References it, and recordList.

oofem::DynamicDataReader::~DynamicDataReader ( )
virtual

Definition at line 48 of file dynamicdatareader.C.

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

Member Function Documentation

void oofem::DynamicDataReader::finish ( )
virtual

Allows to detach all data connections.

Implements oofem::DataReader.

Definition at line 84 of file dynamicdatareader.C.

References recordList.

Referenced by oofem::HuertaErrorEstimator::solveRefinedElementProblem(), and oofem::HuertaErrorEstimator::solveRefinedPatchProblem().

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

References it, and recordList.

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

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

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

Implements oofem::DataReader.

Definition at line 90 of file dynamicdatareader.h.

void oofem::DynamicDataReader::insertInputRecord ( InputRecordType  type,
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::NCPrincipalStrain::appendInputRecords(), oofem::NCPrincipalStress::appendInputRecords(), oofem::NucleationCriterion::appendInputRecords(), oofem::GeometryBasedEI::appendInputRecords(), oofem::Delamination::appendInputRecords(), oofem::HuertaErrorEstimatorInterface::setupRefinedElementProblem1D(), oofem::HuertaErrorEstimatorInterface::setupRefinedElementProblem2D(), oofem::HuertaErrorEstimatorInterface::setupRefinedElementProblem3D(), oofem::HuertaErrorEstimator::setupRefinedProblemEpilog1(), oofem::HuertaErrorEstimator::setupRefinedProblemEpilog2(), and oofem::HuertaErrorEstimator::setupRefinedProblemProlog().

DynamicDataReader& oofem::DynamicDataReader::operator= ( const DynamicDataReader src)
delete
bool oofem::DynamicDataReader::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 74 of file dynamicdatareader.C.

References it.

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.

Referenced by oofem::HuertaErrorEstimator::setupRefinedProblemProlog().

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.

Referenced by oofem::HuertaErrorEstimator::setupRefinedProblemProlog().

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

Member Data Documentation

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

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

Definition at line 56 of file dynamicdatareader.h.

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 documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:35 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011