OOFEM 3.0
Loading...
Searching...
No Matches
dofmanager.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 dofmanager_h
36#define dofmanager_h
37
38#include <cstdio>
39#include <map>
40
41#include "femcmpnn.h"
42#include "intarray.h"
43#include "floatarray.h"
44#include "valuemodetype.h"
45#include "doftype.h"
46#include "dofiditem.h"
47#include "contextioresulttype.h"
48#include "unknowntype.h"
49#include "chartype.h"
50#include "paramkey.h"
51
52namespace oofem {
53class DataStream;
54class Dof;
55class Domain;
57class FloatMatrix;
58class PrimaryField;
60class Load;
61class TimeStep;
62class FloatArray;
63class IntArray;
64
80
100{
101protected:
104
106 std::vector< Dof * > dofArray;
122
124
130
134 std :: map< int, int > dofTypemap;
136 std :: map< int, int > dofMastermap;
138 std :: map< int, int > dofBCmap;
140 std :: map< int, int > dofICmap;
141
142 // List of BCs (to enable writing to DynamicInputRecord)
144
145public:
158
159
160public:
161 std::vector< Dof* > :: iterator begin() { return dofArray.begin(); }
162 std::vector< Dof* > :: iterator end() { return dofArray.end(); }
163 std::vector< Dof* > :: const_iterator begin() const { return dofArray.begin(); }
164 std::vector< Dof* > :: const_iterator end() const { return dofArray.end(); }
165
171 DofManager(int n, Domain * aDomain);
173 virtual ~DofManager();
174
177
183 Dof *giveDofWithID(int dofID) const;
185 int giveNumberOfDofs() const;
186
188 void askNewEquationNumbers(TimeStep *tStep);
195 int giveNumberOfPrimaryMasterDofs(const IntArray &dofIDArray) const;
207 void giveLocationArray(const IntArray &dofIDArry, IntArray &locationArray,
208 const UnknownNumberingScheme &s) const;
217 void giveMasterDofIDArray(const IntArray &dofIDArry, IntArray &masterDofIDs) const;
225 void giveCompleteLocationArray(IntArray &locationArray, const UnknownNumberingScheme &s) const;
231 void giveCompleteMasterDofIDArray(IntArray &dofIDArray) const;
238 std :: vector< Dof* > :: const_iterator findDofWithDofId(DofIDItem dofID) const;
253 void giveUnknownVector(FloatArray &answer, const IntArray &dofMask, ValueModeType mode, TimeStep *tStep, bool padding = false);
269 void giveUnknownVector(FloatArray &answer, const IntArray &dofMask,
270 PrimaryField &field, ValueModeType mode, TimeStep *tStep, bool padding = false);
277 void giveCompleteUnknownVector(FloatArray &answer, ValueModeType mode, TimeStep *tStep);
287 void giveUnknownVectorOfType(FloatArray &answer, UnknownType ut, ValueModeType mode, TimeStep *tStep);
306 virtual void givePrescribedUnknownVector(FloatArray &answer, const IntArray &dofMask,
307 ValueModeType mode, TimeStep *tStep);
309
319
333 bool computeM2GTransformation(FloatMatrix &answer, const IntArray &dofIDArry);
341 virtual bool computeL2GTransformation(FloatMatrix &answer, const IntArray &dofIDArry);
349 virtual bool computeM2LTransformation(FloatMatrix &answer, const IntArray &dofIDArry);
354 virtual bool requiresTransformation();
356
359
367 virtual void computeLoadVector(FloatArray &answer, Load *load, CharType type, TimeStep *tStep, ValueModeType mode);
372 IntArray *giveLoadArray();
377 void setLoadArray(IntArray &load);
379
382
383 double giveCoordinate(int i) const {
384 if ( i > this->coordinates.giveSize() ) {
385 return 0.;
386 }
387 return this->coordinates.at(i);
388 }
389
390 const FloatArray &giveCoordinates() const { return this->coordinates; }
392
394 void setCoordinates(const FloatArray &coords) {
395 this->coordinates = coords;
396 }
397
400
404 const IntArray *giveForcedDofIDs() { return &dofidmask; }
409 std :: map< int, int > *giveDofTypeMap() { return &dofTypemap; }
415 std :: map< int, int > *giveMasterMap() { return (dofMastermap.empty()?NULL: &dofMastermap);}
421 std :: map< int, int > *giveBcMap() { return (dofBCmap.empty()? NULL:&dofBCmap); }
427 std :: map< int, int > *giveIcMap() { return (dofICmap.empty()? NULL: &dofICmap); }
429
430 void printOutputAt(FILE *file, TimeStep *tStep) override;
435 virtual void updateYourself(TimeStep *tStep);
436
437 // Miscellaneous
439 bool isBoundary() { return isBoundaryFlag; }
444 void setBoundaryFlag(bool isBoundary) { this->isBoundaryFlag = isBoundary; }
446 virtual bool hasAnySlaveDofs();
454 virtual bool giveMasterDofMans(IntArray &masters);
455
456 void initializeFrom(InputRecord &ir) override { initializeFrom(ir, 1); };
457 void initializeFrom(InputRecord &ir, int priority) override;
458 void initializeFinish() override;
459 void postInitialize() override;
460
461 void giveInputRecord(DynamicInputRecord &input) override;
462
463 void printYourself() override;
464 void saveContext(DataStream &stream, ContextMode mode) override;
465 void restoreContext(DataStream &stream, ContextMode mode) override;
466
468 virtual bool isDofTypeCompatible(dofType type) const { return false; }
469
477 void updateLocalNumbering(EntityRenumberingFunctor &f) override;
478
481
485 void setNumberOfDofs(int _ndofs);
487
494 void appendDof(Dof *dof);
495
500 void removeDof(DofIDItem id);
501
508 bool hasDofID(DofIDItem id) const;
509
510#ifdef __OOFEG
511 virtual void drawYourself(oofegGraphicContext &gc, TimeStep *tStep) { }
512#endif
513
515 int giveGlobalNumber() const { return globalNumber; }
516 int giveLabel() const { return globalNumber; }
521 void setGlobalNumber(int newNumber) { globalNumber = newNumber; }
522
533 const IntArray *givePartitionList() { return & partitions; }
535 void setPartitionList(const IntArray *_p) { partitions = * _p; }
537 void removePartitionFromList(int _part) {
538 int _pos = partitions.findFirstIndexOf(_part);
539 if ( _pos ) {
540 partitions.erase(_pos);
541 }
542 }
543
544 void mergePartitionList(IntArray &_p);
548 int givePartitionsConnectivitySize();
550 bool isLocal();
555
556 const char *giveClassName() const override {return "DofManager";}
558 const char *giveInputRecordName() const override {return "dofmanager";}
559};
560} // end namespace oofem
561#endif // dofmanager_h
IntArray dofidmask
List of additional dof ids to include.
Definition dofmanager.h:132
static ParamKey IPK_DofManager_remoteflag
Definition dofmanager.h:156
static ParamKey IPK_DofManager_dofidmask
Definition dofmanager.h:146
static ParamKey IPK_DofManager_mastermask
Definition dofmanager.h:150
static ParamKey IPK_DofManager_nullflag
Definition dofmanager.h:157
void setPartitionList(const IntArray *_p)
Definition dofmanager.h:535
void setCoordinates(const FloatArray &coords)
Set coordinates.
Definition dofmanager.h:394
std ::map< int, int > * giveBcMap()
Definition dofmanager.h:421
int giveGlobalNumber() const
Definition dofmanager.h:515
void setBoundaryFlag(bool isBoundary)
Definition dofmanager.h:444
dofManagerParallelMode parallel_mode
Definition dofmanager.h:123
void removePartitionFromList(int _part)
Removes given partition from receiver list.
Definition dofmanager.h:537
bool hasSlaveDofs
Flag indicating whether receiver has slave DOFs.
Definition dofmanager.h:115
const char * giveInputRecordName() const override
Definition dofmanager.h:558
int giveLabel() const
Definition dofmanager.h:516
const char * giveClassName() const override
Definition dofmanager.h:556
bool isShared()
Returns true if receiver is shared.
Definition dofmanager.h:552
bool isNull()
Returns true if receiver is shared.
Definition dofmanager.h:554
IntArray loadArray
List of applied loads.
Definition dofmanager.h:108
static ParamKey IPK_DofManager_boundaryflag
Definition dofmanager.h:152
std::vector< Dof * >::const_iterator end() const
Definition dofmanager.h:164
std ::map< int, int > dofICmap
Map from DofIDItem to ic (to be removed).
Definition dofmanager.h:140
const IntArray * giveForcedDofIDs()
Definition dofmanager.h:404
double giveCoordinate(int i) const
Definition dofmanager.h:383
static ParamKey IPK_DofManager_doftypemask
Definition dofmanager.h:151
std::vector< Dof * >::const_iterator begin() const
Definition dofmanager.h:163
static ParamKey IPK_DofManager_globnum
Definition dofmanager.h:153
std ::map< int, int > dofMastermap
Map from DofIDItem to master node.
Definition dofmanager.h:136
static ParamKey IPK_DofManager_load
Definition dofmanager.h:147
std ::map< int, int > * giveIcMap()
Definition dofmanager.h:427
std ::map< int, int > dofTypemap
Map from DofIDItem to dofType.
Definition dofmanager.h:134
static ParamKey IPK_DofManager_partitions
Definition dofmanager.h:154
const FloatArray & giveCoordinates() const
Definition dofmanager.h:390
virtual bool isDofTypeCompatible(dofType type) const
Returns true if dof of given type is allowed to be associated to receiver.
Definition dofmanager.h:468
std::vector< Dof * > dofArray
Array of DOFs.
Definition dofmanager.h:106
virtual void drawYourself(oofegGraphicContext &gc, TimeStep *tStep)
Definition dofmanager.h:511
std ::map< int, int > dofBCmap
Map from DofIDItem to bc (to be removed).
Definition dofmanager.h:138
std::vector< Dof * >::iterator begin()
Definition dofmanager.h:161
std::vector< Dof * >::iterator end()
Definition dofmanager.h:162
std ::map< int, int > * giveMasterMap()
Definition dofmanager.h:415
IntArray partitions
Definition dofmanager.h:129
void initializeFrom(InputRecord &ir) override
Definition dofmanager.h:456
DofManager(int n, Domain *aDomain)
Definition dofmanager.C:71
const IntArray * givePartitionList()
Definition dofmanager.h:533
std ::map< int, int > * giveDofTypeMap()
Definition dofmanager.h:409
void setGlobalNumber(int newNumber)
Definition dofmanager.h:521
static ParamKey IPK_DofManager_ic
Definition dofmanager.h:149
dofManagerParallelMode giveParallelMode() const
Definition dofmanager.h:526
static ParamKey IPK_DofManager_bc
Definition dofmanager.h:148
void setParallelMode(dofManagerParallelMode _mode)
Definition dofmanager.h:528
FloatArray coordinates
Array storing nodal coordinates.
Definition dofmanager.h:103
static ParamKey IPK_DofManager_sharedflag
Definition dofmanager.h:155
FEMComponent(int n, Domain *d)
Definition femcmpnn.h:88
double & at(Index i)
Definition floatarray.h:202
Index giveSize() const
Returns the size of receiver.
Definition floatarray.h:261
long ContextMode
Definition contextmode.h:43
dofManagerParallelMode
In parallel mode, this type indicates the mode of DofManager.
Definition dofmanager.h:66
@ DofManager_local
Definition dofmanager.h:67
@ DofManager_shared
Definition dofmanager.h:68
@ DofManager_null
Definition dofmanager.h:74
@ DofManager_remote
Definition dofmanager.h:71
dofType
Dof Type, determines the type of DOF created.
Definition doftype.h:48
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
#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