OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
field.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 field_h
36 #define field_h
37 
38 #include "oofemcfg.h"
39 #include "valuemodetype.h"
40 #include "contextioresulttype.h"
41 #include "contextmode.h"
42 #include "enumitem.h"
43 #include <string>
44 #include <memory>
45 
46 namespace oofem {
48 #define FieldType_DEF \
49  ENUM_ITEM_WITH_VALUE(FT_Unknown, 0) \
50  ENUM_ITEM_WITH_VALUE(FT_Velocity, 1) \
51  ENUM_ITEM_WITH_VALUE(FT_Displacements, 2) \
52  ENUM_ITEM_WITH_VALUE(FT_VelocityPressure, 3) \
53  ENUM_ITEM_WITH_VALUE(FT_Pressure, 4) \
54  ENUM_ITEM_WITH_VALUE(FT_Temperature, 5) \
55  ENUM_ITEM_WITH_VALUE(FT_HumidityConcentration, 6) \
56  ENUM_ITEM_WITH_VALUE(FT_TransportProblemUnknowns, 7) \
57  ENUM_ITEM_WITH_VALUE(FT_TemperatureAmbient, 8)
58 
60 enum FieldType {
62 };
63 #undef ENUM_ITEM
64 #undef ENUM_ITEM_WITH_VALUE
65 #undef enumitem_h
66 
67 class TimeStep;
68 class FloatArray;
69 class DofManager;
70 class DataStream;
71 
72 class Field;
73 typedef std::shared_ptr<Field> FieldPtr;
74 
80 class OOFEM_EXPORT Field
81 {
82 protected:
84 
85 public:
89  Field(FieldType b) : type(b) { }
90  virtual ~Field() { }
99  virtual int evaluateAt(FloatArray &answer, const FloatArray &coords,
100  ValueModeType mode, TimeStep *tStep) = 0;
101 
116  virtual int evaluateAt(FloatArray &answer, DofManager *dman,
117  ValueModeType mode, TimeStep *tStep) = 0;
118 
120  FieldType giveType() { return type; }
121 
130  virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode) = 0;
139  virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode) = 0;
140 
141 
143  std :: string errorInfo(const char *func) const;
144 
146  virtual const char *giveClassName() const = 0;
147 };
148 } // end namespace oofem
149 #endif // field_h
std::shared_ptr< Field > FieldPtr
Definition: field.h:72
FieldType
Physical type of field.
Definition: field.h:60
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
Definition: datastream.h:54
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
Definition: valuemodetype.h:78
Base class for dof managers.
Definition: dofmanager.h:113
virtual ~Field()
Definition: field.h:90
Abstract class representing field.
Definition: field.h:80
Field(FieldType b)
Constructor.
Definition: field.h:89
Class representing vector of real numbers.
Definition: floatarray.h:82
FieldType type
Definition: field.h:83
FieldType giveType()
Returns the type of receiver.
Definition: field.h:120
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Definition: contextmode.h:43
std::string errorInfo(const char *func)
Definition: error.C:41
the oofem namespace is to define a context or scope in which all oofem names are defined.
Class representing solution step.
Definition: timestep.h:80

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