OOFEM 3.0
Loading...
Searching...
No Matches
dynamicinputrecord.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 dynamicinputrecord_h
36#define dynamicinputrecord_h
37
38#include "inputrecord.h"
39
40#include <map>
41#include <set>
42
43namespace oofem {
44class FEMComponent;
46
48OOFEM_EXPORT std::unique_ptr<DynamicInputRecord> CreateNodeIR(int i, InputFieldType nodeType, FloatArray coord);
49
51OOFEM_EXPORT std::unique_ptr<DynamicInputRecord> CreateElementIR(int i, InputFieldType elementType, IntArray nodes, int cs = 0);
52
60{
61protected:
62 std :: string recordKeyword;
64
65 std :: set< std :: string >emptyRecord;
66 std :: map< std :: string, int >intRecord;
67 std :: map< std :: string, double >doubleRecord;
68 std :: map< std :: string, bool >boolRecord;
69 std :: map< std :: string, std :: string >stringRecord;
70 std :: map< std :: string, FloatArray >floatArrayRecord;
71 std :: map< std :: string, IntArray >intArrayRecord;
72 std :: map< std :: string, FloatMatrix >matrixRecord;
73 std :: map< std :: string, std :: vector< std :: string > >stringListRecord;
74 std :: map< std :: string, Dictionary >dictionaryRecord;
75 std :: map< std :: string, std :: list< Range > >rangeRecord;
76 std :: map< std :: string, ScalarFunction >scalarFunctionRecord;
77
78public:
80 DynamicInputRecord(std :: string answer = "", int value = 0);
86 virtual ~DynamicInputRecord();
88 DynamicInputRecord &operator = ( const DynamicInputRecord & );
89
90 std::shared_ptr<InputRecord> clone() const override { return std::make_shared<DynamicInputRecord>(*this); }
91 void finish(bool wrn = true) override;
92
93 std :: string giveRecordAsString() const override { return giveRecordInTXTFormat(); }
94 std :: string giveRecordInTXTFormat() const override;
95 std :: string giveLocation() const override;
96
97
98 void giveRecordKeywordField(std :: string &answer, int &value) override;
99 void giveRecordKeywordField(std :: string &answer) override;
100 void giveField(int &answer, InputFieldType id) override;
101 void giveField(double &answer, InputFieldType id) override;
102 void giveField(bool &answer, InputFieldType id) override;
103 void giveField(std :: string &answer, InputFieldType id) override;
104 void giveField(FloatArray &answer, InputFieldType id) override;
105 void giveField(IntArray &answer, InputFieldType id) override;
106 void giveField(FloatMatrix &answer, InputFieldType id) override;
107 void giveField(std :: vector< std :: string > &answer, InputFieldType id) override;
108 void giveField(Dictionary &answer, InputFieldType id) override;
109 void giveField(std :: list< Range > &answer, InputFieldType id) override;
110 void giveField(ScalarFunction &function, InputFieldType id) override;
111
112 int giveGroupCount(InputFieldType id, const std::string& name, bool optional) override;
113 bool hasChild(InputFieldType id, const std::string& name, bool optional) override;
114
115 bool hasField(InputFieldType id) override;
116 void printYourself() override;
117
118 // Setters, unique for the dynamic input record
119 void setRecordKeywordField(std :: string keyword, int number);
120 void setRecordKeywordNumber(int number);
121 void setField(int item, InputFieldType id);
122 void setField(double item, InputFieldType id);
123 void setField(bool item, InputFieldType id);
124 void setField(std :: string item, InputFieldType id);
125 void setField(FloatArray item, InputFieldType id);
126 void setField(IntArray item, InputFieldType id);
127 void setField(FloatMatrix item, InputFieldType id);
128 void setField(std :: vector< std :: string > item, InputFieldType id);
129 void setField(const Dictionary &item, InputFieldType id);
130 void setField(const std :: list< Range > &item, InputFieldType id);
131 void setField(const ScalarFunction &function, InputFieldType id);
133 void setField(InputFieldType id);
135 void unsetField(InputFieldType id);
136};
137} // end namespace oofem
138#endif // dynamicinputrecord_h
std ::map< std ::string, std ::list< Range > > rangeRecord
std ::map< std ::string, std ::string > stringRecord
std ::map< std ::string, FloatArray > floatArrayRecord
std::string giveRecordAsString() const override
Returns string representation of record in OOFEMs text format.
DynamicInputRecord(std ::string answer="", int value=0)
Creates an empty input record.
std::string giveRecordInTXTFormat() const override
std ::map< std ::string, double > doubleRecord
std ::map< std ::string, ScalarFunction > scalarFunctionRecord
std ::set< std ::string > emptyRecord
Fields without values.
std ::map< std ::string, std ::vector< std ::string > > stringListRecord
std ::map< std ::string, bool > boolRecord
std::shared_ptr< InputRecord > clone() const override
std ::map< std ::string, IntArray > intArrayRecord
std ::map< std ::string, FloatMatrix > matrixRecord
std ::map< std ::string, int > intRecord
std ::map< std ::string, Dictionary > dictionaryRecord
std::unique_ptr< DynamicInputRecord > CreateElementIR(int i, InputFieldType elementType, IntArray nodes, int cs)
Helper function for creating elements (with optional cross-section number).
std::unique_ptr< DynamicInputRecord > CreateNodeIR(int i, InputFieldType nodeType, FloatArray coord)
Helper function for creating a dynamic input record for a node.
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