OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
oofemtxtinputrecord.h
Go to the documentation of this file.
1 /*
2  *
3  * ##### ##### ###### ###### ### ###
4  * ## ## ## ## ## ## ## ### ##
5  * ## ## ## ## #### #### ## # ##
6  * ## ## ## ## ## ## ## ##
7  * ## ## ## ## ## ## ## ##
8  * ##### ##### ## ###### ## ##
9  *
10  *
11  * OOFEM : Object Oriented Finite Element Code
12  *
13  * Copyright (C) 1993 - 2013 Borek Patzak
14  *
15  *
16  *
17  * Czech Technical University, Faculty of Civil Engineering,
18  * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19  *
20  * This library is free software; you can redistribute it and/or
21  * modify it under the terms of the GNU Lesser General Public
22  * License as published by the Free Software Foundation; either
23  * version 2.1 of the License, or (at your option) any later version.
24  *
25  * This program is distributed in the hope that it will be useful,
26  * but WITHOUT ANY WARRANTY; without even the implied warranty of
27  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28  * Lesser General Public License for more details.
29  *
30  * You should have received a copy of the GNU Lesser General Public
31  * License along with this library; if not, write to the Free Software
32  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33  */
34 
35 #ifndef oofemtxtinputrecord_h
36 #define oofemtxtinputrecord_h
37 
38 #include "inputrecord.h"
39 #include "tokenizer.h"
40 
41 #include <string>
42 #include <vector>
43 
44 namespace oofem {
49 class OOFEM_EXPORT OOFEMTXTInputRecord : public InputRecord
50 {
51 protected:
58  std :: vector< bool >readFlag;
59 
61  std :: string record;
62 
64 
65 public:
69  OOFEMTXTInputRecord(int linenumber, std :: string source);
73  virtual ~OOFEMTXTInputRecord() { }
75  OOFEMTXTInputRecord &operator = ( const OOFEMTXTInputRecord & );
76 
77  virtual InputRecord *GiveCopy() { return new OOFEMTXTInputRecord(*this); }
78 
79 public:
81  void setRecordString(std :: string newStr);
83  virtual std :: string giveRecordAsString() const { return this->record; }
84 
85  void finish(bool wrn = true);
86 
87 public:
88  virtual IRResultType giveRecordKeywordField(std :: string &answer, int &value);
89  virtual IRResultType giveRecordKeywordField(std :: string &answer);
90  virtual IRResultType giveField(int &answer, InputFieldType id);
91  virtual IRResultType giveField(double &answer, InputFieldType id);
92  virtual IRResultType giveField(bool &answer, InputFieldType id);
93  virtual IRResultType giveField(std :: string &answer, InputFieldType id);
94  virtual IRResultType giveField(FloatArray &answer, InputFieldType id);
95  virtual IRResultType giveField(IntArray &answer, InputFieldType id);
96  virtual IRResultType giveField(FloatMatrix &answer, InputFieldType id);
97  virtual IRResultType giveField(std :: vector< std :: string > &answer, InputFieldType id);
98  virtual IRResultType giveField(Dictionary &answer, InputFieldType id);
99  virtual IRResultType giveField(std :: list< Range > &answer, InputFieldType id);
100  virtual IRResultType giveField(ScalarFunction &answer, InputFieldType id);
101 
102  virtual bool hasField(InputFieldType id);
103  virtual void printYourself();
104 
105  virtual void report_error(const char *_class, const char *proc, InputFieldType id,
106  IRResultType result, const char *file, int line);
107  void setLineNumber(int lineNumber) { this->lineNumber = lineNumber; }
108 
109 protected:
110  int giveKeywordIndx(const char *kwd);
111  const char *scanInteger(const char *source, int &value);
112  const char *scanDouble(const char *source, double &value);
113  void setReadFlag(int itok) { readFlag [ itok - 1 ] = true; }
114 
123  int readRange(const char **helpSource, int &li, int &hi);
133  int readMatrix(const char *helpSource, int r, int c, FloatMatrix &ans);
134 };
135 } // end namespace oofem
136 #endif // oofemtxtinputrecord_h
virtual ~OOFEMTXTInputRecord()
Destructor.
String bracket- and quotation-aware string tokenizer.
Definition: tokenizer.h:50
virtual std::string giveRecordAsString() const
Returns record string.
const char * InputFieldType
Identifier of fields in input records.
Definition: inputrecord.h:52
void setLineNumber(int lineNumber)
Class implementing an array of integers.
Definition: intarray.h:61
std::vector< bool > readFlag
Tokenizer tokenizer
Tokenizer is used to parse records.
std::string record
Record representation.
virtual InputRecord * GiveCopy()
Creates a newly allocated copy of the receiver.
This class implements a linked list whose entries are Pairs (see below).
Definition: dictionary.h:58
Class representing vector of real numbers.
Definition: floatarray.h:82
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
Class representing the Input Record for OOFEM txt input file format.
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
Implementation of Scalar function.
Class representing the general Input Record.
Definition: inputrecord.h:101
the oofem namespace is to define a context or scope in which all oofem names are defined.

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:30 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011