OOFEM 3.0
Loading...
Searching...
No Matches
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 - 2025 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 "datareader.h"
40#include "tokenizer.h"
41
42#include <string>
43#include <vector>
44
45namespace oofem {
46
47class DataReader;
53{
54protected:
61 std :: vector< bool >readFlag;
62
64 std :: string record;
67public:
71 OOFEMTXTInputRecord(int linenumber, std :: string source);
75 OOFEMTXTInputRecord &operator = ( const OOFEMTXTInputRecord & );
76
77 std::shared_ptr<InputRecord> clone() const override { return std::make_shared<OOFEMTXTInputRecord>(*this); }
78
79public:
81 void setRecordString(std :: string newStr);
83 std :: string giveRecordAsString() const override { return this->record; }
84 std :: string giveRecordInTXTFormat() const override { return this->record; }
85 std :: string giveLocation() const override;
86
87 void finish(bool wrn = true) override;
88
89public:
90 void giveRecordKeywordField(std :: string &answer, int &value) override;
91 void giveRecordKeywordField(std :: string &answer) override;
92 void giveField(int &answer, InputFieldType id) override;
93 void giveField(double &answer, InputFieldType id) override;
94 void giveField(bool &answer, InputFieldType id) override;
95 void giveField(std :: string &answer, InputFieldType id) override;
96 void giveField(FloatArray &answer, InputFieldType id) override;
97 void giveField(IntArray &answer, InputFieldType id) override;
98 void giveField(FloatMatrix &answer, InputFieldType id) override;
99 void giveField(std :: vector< std :: string > &answer, InputFieldType id) override;
100 void giveField(Dictionary &answer, InputFieldType id) override;
101 void giveField(std :: list< Range > &answer, InputFieldType id) override;
102 void giveField(ScalarFunction &answer, InputFieldType id) override;
103
104 int giveGroupCount(InputFieldType id, const std::string& name, bool optional) override;
105 bool hasChild(InputFieldType id, const std::string& name, bool optional) override;
106
107 bool hasField(InputFieldType id) override;
108 void printYourself() override;
109
110 void setLineNumber(int num) { this->lineNumber = num; }
111 int giveLineNumber() const { return lineNumber; }
113
114protected:
115 int giveKeywordIndx(const char *kwd);
116 const char *scanInteger(const char *source, int &value);
117 const char *scanDouble(const char *source, double &value);
118 void setReadFlag(int itok) { readFlag [ itok - 1 ] = true; }
119
128 int readRange(const char **helpSource, int &li, int &hi);
138 int readMatrix(const char *helpSource, int r, int c, FloatMatrix &ans);
139private:
140 #ifdef _USE_TRACE_FIELDS
141 void traceField(InputFieldType id, const char* type) override;
142 #endif
143};
144} // end namespace oofem
145#endif // oofemtxtinputrecord_h
InputRecordType
Determines the type of input record.
Definition datareader.h:64
OOFEMTXTInputRecord()
Constructor. Creates an empty input record.
std::string giveRecordInTXTFormat() const override
std ::vector< bool > readFlag
std::string giveRecordAsString() const override
Returns record string.
DataReader::InputRecordType inputRecordType
std::shared_ptr< InputRecord > clone() const override
void setInputRecordType(DataReader::InputRecordType irt)
std::string record
Record representation.
const char * InputFieldType
Identifier of fields in input records.
Definition inputrecord.h:59
#define OOFEM_EXPORT
Definition oofemcfg.h:7

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