OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
primaryfield.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 primaryfield_h
36 #define primaryfield_h
37 
38 #include "field.h"
39 #include "interface.h"
40 #include "floatarray.h"
41 #include "valuemodetype.h"
42 #include "contextioresulttype.h"
43 #include "contextmode.h"
44 #include "timestep.h"
45 
46 #include <vector>
47 
48 namespace oofem {
49 class PrimaryField;
50 class Dof;
51 class BoundaryCondition;
52 class InitialCondition;
53 class UnknownNumberingScheme;
54 
58 class OOFEM_EXPORT EIPrimaryFieldInterface : public Interface
59 {
60 public:
61 
81  virtual int EIPrimaryFieldI_evaluateFieldVectorAt(FloatArray &answer, PrimaryField &pf,
82  const FloatArray &coords, IntArray &dofId, ValueModeType mode, TimeStep *tStep) = 0;
84 };
85 
86 
104 class OOFEM_EXPORT PrimaryField : public Field
105 {
106 protected:
110  std :: vector< FloatArray >solutionVectors;
111  std :: vector< FloatArray >prescribedVectors;
112  std :: vector< TimeStep >solStepList;
115 
116 public:
127  PrimaryField(EngngModel * a, int idomain, FieldType ft, int nHist);
128  virtual ~PrimaryField();
129 
136  virtual void initialize(ValueModeType mode, TimeStep *tStep, FloatArray &answer, const UnknownNumberingScheme &s);
137 
138  // These functions are hardcoded to assume the default numbering scheme (as is the rest of primaryfield)
139  void storeDofManager(TimeStep *tStep, DofManager &dman);
140  void storeInDofDictionaries(TimeStep *tStep);
141  void readDofManager(TimeStep *tStep, DofManager &dman);
142  void readFromDofDictionaries(TimeStep *tStep);
143 
148  virtual void applyDefaultInitialCondition();
153  void applyInitialCondition(InitialCondition &ic);
158  virtual void applyBoundaryCondition(TimeStep *tStep);
164  void applyBoundaryCondition(BoundaryCondition &bc, TimeStep *tStep);
165 
172  virtual double giveUnknownValue(Dof *dof, ValueModeType mode, TimeStep *tStep);
181  virtual int evaluateAt(FloatArray &answer, const FloatArray &coords,
182  ValueModeType mode, TimeStep *tStep);
191  virtual int evaluateAt(FloatArray &answer, DofManager *dman,
192  ValueModeType mode, TimeStep *tStep);
203  virtual int __evaluateAt(FloatArray &answer, DofManager *dman,
204  ValueModeType mode, TimeStep *tStep, IntArray *dofId);
215  virtual int __evaluateAt(FloatArray &answer, const FloatArray &coords,
216  ValueModeType mode, TimeStep *tStep, IntArray *dofId);
221  virtual FloatArray *giveSolutionVector(TimeStep *tStep);
222 
229  virtual void update(ValueModeType mode, TimeStep *tStep, const FloatArray &vectorToStore, const UnknownNumberingScheme &s);
230 
235  virtual void advanceSolution(TimeStep *tStep);
236 
237  virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode);
238  virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode);
239 
240  virtual const char *giveClassName() const { return "PrimaryField"; }
241 
242 
243  int giveActualStepNumber() { return actualStepNumber; }
244 protected:
245  int resolveIndx(TimeStep *tStep, int shift);
246  FloatArray *giveSolutionVector(int);
247  FloatArray *givePrescribedVector(int);
248 };
249 } // end namespace oofem
250 #endif // primaryfield_h
FieldType
Physical type of field.
Definition: field.h:60
Class implementing general initial condition.
Abstract class representing field of primary variables (those, which are unknown and are typically as...
Definition: primaryfield.h:104
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 const char * giveClassName() const
Definition: primaryfield.h:240
Class implementing an array of integers.
Definition: intarray.h:61
std::vector< TimeStep > solStepList
Definition: primaryfield.h:112
Abstract class representing field.
Definition: field.h:80
Element interface class.
Definition: primaryfield.h:58
Class implementing Dirichlet boundary condition on DOF (primary boundary condition).
Abstract base class allowing to control the way, how equations are assigned to individual DOFs...
EngngModel * emodel
Definition: primaryfield.h:113
Class representing vector of real numbers.
Definition: floatarray.h:82
std::vector< FloatArray > prescribedVectors
Definition: primaryfield.h:111
Class Interface.
Definition: interface.h:82
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Definition: contextmode.h:43
Abstract base class representing the "problem" under consideration.
Definition: engngm.h:181
the oofem namespace is to define a context or scope in which all oofem names are defined.
Abstract class Dof represents Degree Of Freedom in finite element mesh.
Definition: dof.h:93
std::vector< FloatArray > solutionVectors
Definition: primaryfield.h:110
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:30 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011