OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
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 - 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 dynamicinputrecord_h
36 #define dynamicinputrecord_h
37 
38 #include "inputrecord.h"
39 
40 #include <map>
41 #include <set>
42 
43 namespace oofem {
44 class FEMComponent;
45 class DynamicInputRecord;
46 
48 OOFEM_EXPORT DynamicInputRecord *CreateNodeIR(int i, InputFieldType nodeType, FloatArray coord);
49 
51 OOFEM_EXPORT DynamicInputRecord *CreateElementIR(int i, InputFieldType elementType, IntArray nodes, int cs = 0);
52 
59 class OOFEM_EXPORT DynamicInputRecord : public InputRecord
60 {
61 protected:
62  std :: string recordKeyword;
64 
65  // Record representation.
66  std :: set< std :: string >emptyRecord;
67  std :: map< std :: string, int >intRecord;
68  std :: map< std :: string, double >doubleRecord;
69  std :: map< std :: string, bool >boolRecord;
70  std :: map< std :: string, std :: string >stringRecord;
71  std :: map< std :: string, FloatArray >floatArrayRecord;
72  std :: map< std :: string, IntArray >intArrayRecord;
73  std :: map< std :: string, FloatMatrix >matrixRecord;
74  std :: map< std :: string, std :: vector< std :: string > >stringListRecord;
75  std :: map< std :: string, Dictionary >dictionaryRecord;
76  std :: map< std :: string, std :: list< Range > >rangeRecord;
77  std :: map< std :: string, ScalarFunction >scalarFunctionRecord;
78 
79 public:
81  DynamicInputRecord(std :: string answer = "", int value = 0);
87  virtual ~DynamicInputRecord();
89  DynamicInputRecord &operator = ( const DynamicInputRecord & );
90 
91  virtual InputRecord *GiveCopy() { return new DynamicInputRecord(*this); }
92  virtual void finish(bool wrn = true);
93 
94  virtual std :: string giveRecordAsString() const;
95 
96  virtual IRResultType giveRecordKeywordField(std :: string &answer, int &value);
97  virtual IRResultType giveRecordKeywordField(std :: string &answer);
98  virtual IRResultType giveField(int &answer, InputFieldType id);
99  virtual IRResultType giveField(double &answer, InputFieldType id);
100  virtual IRResultType giveField(bool &answer, InputFieldType id);
101  virtual IRResultType giveField(std :: string &answer, InputFieldType id);
102  virtual IRResultType giveField(FloatArray &answer, InputFieldType id);
103  virtual IRResultType giveField(IntArray &answer, InputFieldType id);
104  virtual IRResultType giveField(FloatMatrix &answer, InputFieldType id);
105  virtual IRResultType giveField(std :: vector< std :: string > &answer, InputFieldType id);
106  virtual IRResultType giveField(Dictionary &answer, InputFieldType id);
107  virtual IRResultType giveField(std :: list< Range > &answer, InputFieldType id);
108  virtual IRResultType giveField(ScalarFunction &function, InputFieldType id);
109 
110  virtual bool hasField(InputFieldType id);
111  virtual void printYourself();
112  // Setters, unique for the dynamic input record
113  void setRecordKeywordField(std :: string keyword, int number);
114  void setRecordKeywordNumber(int number);
115  void setField(int item, InputFieldType id);
116  void setField(double item, InputFieldType id);
117  void setField(bool item, InputFieldType id);
118  void setField(std :: string item, InputFieldType id);
119  void setField(FloatArray item, InputFieldType id);
120  void setField(IntArray item, InputFieldType id);
121  void setField(FloatMatrix item, InputFieldType id);
122  void setField(std :: vector< std :: string > item, InputFieldType id);
123  void setField(const Dictionary &item, InputFieldType id);
124  void setField(const std :: list< Range > &item, InputFieldType id);
125  void setField(const ScalarFunction &function, InputFieldType id);
127  void setField(InputFieldType id);
129  void unsetField(InputFieldType id);
130 
131  virtual void report_error(const char *_class, const char *proc, InputFieldType id,
132  IRResultType result, const char *file, int line);
133 };
134 } // end namespace oofem
135 #endif // dynamicinputrecord_h
std::map< std::string, bool > boolRecord
std::map< std::string, FloatMatrix > matrixRecord
DynamicInputRecord * CreateElementIR(int i, InputFieldType elementType, IntArray nodes, int cs)
Helper function for creating elements (with optional cross-section number).
std::set< std::string > emptyRecord
Fields without values.
std::map< std::string, double > doubleRecord
const char * InputFieldType
Identifier of fields in input records.
Definition: inputrecord.h:52
Class implementing an array of integers.
Definition: intarray.h:61
std::map< std::string, FloatArray > floatArrayRecord
std::map< std::string, ScalarFunction > scalarFunctionRecord
std::map< std::string, std::list< Range > > rangeRecord
DynamicInputRecord * CreateNodeIR(int i, InputFieldType nodeType, FloatArray coord)
Helper function for creating a dynamic input record for a node.
std::map< std::string, IntArray > intArrayRecord
std::map< std::string, std::vector< std::string > > stringListRecord
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
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
Implementation of Scalar function.
std::map< std::string, std::string > stringRecord
Class representing the general Input Record.
Definition: inputrecord.h:101
std::map< std::string, Dictionary > dictionaryRecord
Class representing the a dynamic Input Record.
virtual InputRecord * GiveCopy()
Creates a newly allocated copy of the receiver.
the oofem namespace is to define a context or scope in which all oofem names are defined.
std::map< std::string, int > intRecord
The top abstract class of all classes constituting the finite element mesh.
Definition: femcmpnn.h:76

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