OOFEM 3.0
Loading...
Searching...
No Matches
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 - 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 field_h
36#define field_h
37
38#include "domain.h"
39#include "oofemenv.h"
40#include "valuemodetype.h"
41#include "contextioresulttype.h"
42#include "contextmode.h"
43#include "enumitem.h"
44#include "intarray.h"
45#include <string>
46#include <memory>
47
48namespace oofem {
50#define FieldType_DEF \
51 ENUM_ITEM_WITH_VALUE(FT_Unknown, 0) \
52 ENUM_ITEM_WITH_VALUE(FT_Velocity, 1) \
53 ENUM_ITEM_WITH_VALUE(FT_Displacements, 2) \
54 ENUM_ITEM_WITH_VALUE(FT_VelocityPressure, 3) \
55 ENUM_ITEM_WITH_VALUE(FT_Pressure, 4) \
56 ENUM_ITEM_WITH_VALUE(FT_Temperature, 5) \
57 ENUM_ITEM_WITH_VALUE(FT_HumidityConcentration, 6) \
58 ENUM_ITEM_WITH_VALUE(FT_TransportProblemUnknowns, 7) \
59 ENUM_ITEM_WITH_VALUE(FT_TemperatureAmbient, 8) \
60 ENUM_ITEM_WITH_VALUE(FT_EigenStrain, 9) \
61 ENUM_ITEM_WITH_VALUE(FT_VOF, 10)
62
67#undef ENUM_ITEM
68#undef ENUM_ITEM_WITH_VALUE
69#undef enumitem_h
70
71class TimeStep;
72class FloatArray;
73class DofManager;
74class DataStream;
75class InputRecord;
76
77class Field;
78typedef std::shared_ptr<Field> FieldPtr;
79
86{
87protected:
90
91public:
95 Field(FieldType b = FieldType::FT_Unknown) : type(b) { regionSets.resize(0); }
96 virtual ~Field() { }
105 virtual int evaluateAt(FloatArray &answer, const FloatArray &coords,
106 ValueModeType mode, TimeStep *tStep) = 0;
107
122 virtual int evaluateAt(FloatArray &answer, DofManager *dman,
123 ValueModeType mode, TimeStep *tStep) = 0;
124 virtual int evaluateAt(FloatArray &answer, Element *elem,
125 ValueModeType mode, TimeStep *tStep) { return 1; }
126
128 FieldType giveType() { return type; }
129
131 void setType(FieldType b) { type=b; }
132
134 void setSetsNumbers (const IntArray sets);
135
137 virtual bool hasElementInSets(int nElem, Domain *d);
143 virtual void saveContext(DataStream &stream) = 0;
149 virtual void restoreContext(DataStream &stream) = 0;
150
151
153 std :: string errorInfo(const char *func) const;
154
156 virtual const char *giveClassName() const = 0;
157
158 // for Field classes supporting instantiation from input record
159 virtual void initializeFrom(InputRecord &ir) { };
160};
161} // end namespace oofem
162#endif // field_h
Field(FieldType b=FieldType::FT_Unknown)
Definition field.h:95
virtual void initializeFrom(InputRecord &ir)
Definition field.h:159
virtual void saveContext(DataStream &stream)=0
FieldType giveType()
Returns the type of receiver.
Definition field.h:128
FieldType type
Definition field.h:88
virtual int evaluateAt(FloatArray &answer, Element *elem, ValueModeType mode, TimeStep *tStep)
Definition field.h:124
virtual const char * giveClassName() const =0
IntArray regionSets
Definition field.h:89
std::string errorInfo(const char *func) const
Returns string for prepending output (used by error reporting macros).
Definition field.C:66
virtual int evaluateAt(FloatArray &answer, DofManager *dman, ValueModeType mode, TimeStep *tStep)=0
void setType(FieldType b)
Sets the type of receiver.
Definition field.h:131
virtual void restoreContext(DataStream &stream)=0
virtual ~Field()
Definition field.h:96
virtual int evaluateAt(FloatArray &answer, const FloatArray &coords, ValueModeType mode, TimeStep *tStep)=0
FieldType
Physical type of field.
Definition field.h:64
@ FieldType_DEF
Definition field.h:65
std::shared_ptr< Field > FieldPtr
Definition field.h:78
#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