OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
dof.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 dof_h
36 #define dof_h
37 
38 #include <cstdio>
39 
40 #include "oofemcfg.h"
41 #include "floatarray.h"
42 #include "intarray.h"
43 #include "unknowntype.h"
44 #include "valuemodetype.h"
45 #include "dofiditem.h"
46 #include "doftype.h"
47 #include "contextioresulttype.h"
48 
49 namespace oofem {
50 class DataStream;
51 class Dictionary;
52 class PrimaryField;
53 class Domain;
54 class DofManager;
55 class TimeStep;
56 class BoundaryCondition;
57 class InitialCondition;
58 class UnknownNumberingScheme;
59 class EntityRenumberingFunctor;
60 
93 class OOFEM_EXPORT Dof
94 {
95 protected:
100 
101 public:
102 
110  Dof(DofManager * aNode, DofIDItem id = Undef);
112  virtual ~Dof() { }
113 
115  virtual dofType giveDofType() = 0;
117  virtual const char *giveClassName() const { return "Dof"; }
118 
120  int giveDofManNumber() const;
121 
123  DofManager *giveDofManager() const { return dofManager; }
124 
125  int giveDofManGlobalNumber() const;
126 
135  virtual double giveBcValue(ValueModeType mode, TimeStep *tStep);
141  int giveEquationNumber(const UnknownNumberingScheme &s);
153  virtual int __giveEquationNumber() const = 0;
167  virtual void giveEquationNumbers(IntArray &masterEqNumbers, const UnknownNumberingScheme &s);
172  virtual void giveDofIDs(IntArray &masterDofIDs);
173 
186  virtual int __givePrescribedEquationNumber() = 0;
187 
196  virtual int askNewEquationNumber(TimeStep *tStep) = 0;
209  virtual double giveUnknown(ValueModeType mode, TimeStep *tStep) = 0;
221  virtual double giveUnknown(PrimaryField &field, ValueModeType mode, TimeStep *tStep) = 0;
230  virtual void giveUnknowns(FloatArray &masterUnknowns, ValueModeType mode, TimeStep *tStep);
240  virtual void giveUnknowns(FloatArray &masterUnknowns, PrimaryField &field, ValueModeType mode, TimeStep *tStep);
241 
248  virtual void computeDofTransformation(FloatArray &masterContribs);
252  virtual int giveNumberOfPrimaryMasterDofs() { return 1; }
253 
259  virtual bool hasBc(TimeStep *tStep) = 0;
264  virtual bool hasIc() = 0;
271  virtual bool hasIcOn(ValueModeType u) = 0;
276  DofIDItem giveDofID() const { return dofID; }
280  void setDofID(DofIDItem id) { this->dofID = id; }
287  virtual bool isPrimaryDof() { return false; }
294  virtual int giveBcId() = 0;
301  virtual int giveIcId() = 0;
302 
306  virtual void giveMasterDofManArray(IntArray &answer);
316 
322  virtual void printSingleOutputAt(FILE *file, TimeStep *tStep, char ch, ValueModeType mode, double scale = 1.0);
328  virtual void printMultipleOutputAt(FILE *File, TimeStep *tStep, char *ch, ValueModeType *mode, int nite);
329  void printSingleOutputWithAdditionAt(FILE *File, TimeStep *tStep, char ch, ValueModeType mode, double addend);
331  virtual void printYourself();
336  virtual void updateYourself(TimeStep *tStep) { }
366  virtual void updateUnknownsDictionary(TimeStep *tStep, ValueModeType mode, double dofValue) { }
373  virtual double giveUnknownsDictionaryValue(TimeStep *tStep, ValueModeType mode) { return 0; }
374 
376  std :: string errorInfo(const char *func) const;
378  virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj = NULL);
380  virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj = NULL);
382  virtual void setBcId(int bcId) { }
384  virtual void setIcId(int icId) { }
385 
390  virtual void setEquationNumber(int equationNumber) { }
391 
396  virtual void setUnknowns(Dictionary *unknowns) { }
401  virtual Dictionary *giveUnknowns() { return NULL; }
402 
407  virtual int giveEqn() { return 0; }
408 
421  virtual int packUnknowns(DataStream &buff, ValueModeType mode, TimeStep *tStep)
422  { return 1; }
441  ValueModeType mode, TimeStep *tStep) { return 1; }
442 
443 protected:
448  virtual BoundaryCondition *giveBc() { return NULL; }
453  virtual InitialCondition *giveIc() { return NULL; }
454 
455  friend class SimpleSlaveDof;
456 };
457 } // end namespace oofem
458 #endif // dof_h
void setDofID(DofIDItem id)
Sets the ID of receiver.
Definition: dof.h:280
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
virtual int giveEqn()
Gives number for equation, negative for prescribed equations.
Definition: dof.h:407
virtual Dictionary * giveUnknowns()
Receives the dictionary of unknowns in receiver.
Definition: dof.h:401
dofType
Dof Type, determines the type of DOF created.
Definition: doftype.h:48
Base class for dof managers.
Definition: dofmanager.h:113
virtual InitialCondition * giveIc()
Returns initial condition of dof if it is prescribed.
Definition: dof.h:453
Class implementing an array of integers.
Definition: intarray.h:61
virtual BoundaryCondition * giveBc()
Returns boundary condition of dof if it is prescribed.
Definition: dof.h:448
virtual void setBcId(int bcId)
Overwrites the boundary condition id (0-inactive BC), intended for specific purposes such as coupling...
Definition: dof.h:382
virtual void updateLocalNumbering(EntityRenumberingFunctor &f)
Local renumbering support.
Definition: dof.h:315
virtual void setEquationNumber(int equationNumber)
Sets a specific equation number to receiver.
Definition: dof.h:390
Class implementing Dirichlet boundary condition on DOF (primary boundary condition).
DofIDItem
Type representing particular dof type.
Definition: dofiditem.h:86
virtual void updateUnknownsDictionary(TimeStep *tStep, ValueModeType mode, double dofValue)
Abstract function, allowing Dof to store its unknowns in its own private dictionary.
Definition: dof.h:366
DofManager * dofManager
Link to related DofManager.
Definition: dof.h:97
Abstract base class allowing to control the way, how equations are assigned to individual DOFs...
DofIDItem giveDofID() const
Returns DofID value of receiver, which determines type of of unknown connected to receiver (e...
Definition: dof.h:276
virtual bool isPrimaryDof()
Tests if receiver is primary DOF.
Definition: dof.h:287
virtual int packUnknowns(DataStream &buff, ValueModeType mode, TimeStep *tStep)
Packs specific DOF Manager&#39;s dofs unknowns into communication buffer.
Definition: dof.h:421
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
virtual int unpackAndUpdateUnknown(DataStream &buff, ValueModeType mode, TimeStep *tStep)
Unpacks DOF unknown from communication buffer and updates unknown if necessary.
Definition: dof.h:440
virtual double giveUnknownsDictionaryValue(TimeStep *tStep, ValueModeType mode)
Access dictionary value, if not present zero is returned.
Definition: dof.h:373
Class representing "slave" degree of freedom.
virtual void setIcId(int icId)
Overwrites the initial condition id (0-inactive IC)
Definition: dof.h:384
DofIDItem dofID
Physical meaning of DOF.
Definition: dof.h:99
virtual void setUnknowns(Dictionary *unknowns)
Sets the dictionary of unknowns for receiver.
Definition: dof.h:396
virtual ~Dof()
Destructor.
Definition: dof.h:112
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
virtual int giveNumberOfPrimaryMasterDofs()
Definition: dof.h:252
DofManager * giveDofManager() const
Definition: dof.h:123
virtual void updateYourself(TimeStep *tStep)
Updates receiver after finishing time step.
Definition: dof.h:336
virtual const char * giveClassName() const
Returns class name of the receiver.
Definition: dof.h:117
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
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