OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
unknownnumberingscheme.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 unknownnumberingscheme_h
36 #define unknownnumberingscheme_h
37 
38 #include "dof.h"
39 #include "intarray.h"
40 
41 namespace oofem {
47 class OOFEM_EXPORT UnknownNumberingScheme
48 {
49 public:
52 
56  virtual void init() { }
62  virtual bool isDefault() const { return false; }
67  virtual int giveDofEquationNumber(Dof *dof) const = 0;
68 
72  virtual int giveRequiredNumberOfDomainEquation() const { return 0; }
73 };
74 
81 {
82 public:
84 
85  virtual bool isDefault() const { return true; }
86  virtual int giveDofEquationNumber(Dof *dof) const {
87  return dof->__giveEquationNumber();
88  }
89 };
90 
98 {
99 public:
101 
102  virtual int giveDofEquationNumber(Dof *dof) const {
103  return dof->__givePrescribedEquationNumber();
104  }
105 };
106 
107 
113 {
114 protected:
117 
118 public:
119  DofIDEquationNumbering(bool prescribed, IntArray dofids) :
120  UnknownNumberingScheme(), dofids(std :: move(dofids)), prescribed(prescribed) { }
121 
122  virtual bool isDefault() const { return !prescribed; }
123  virtual int giveDofEquationNumber(Dof *dof) const {
124  DofIDItem id = dof->giveDofID();
125  if ( dofids.contains(id) ) {
126  return prescribed ? dof->__givePrescribedEquationNumber() : dof->__giveEquationNumber();
127  }
128 
129  return 0;
130  }
131 };
132 } // end namespace oofem
133 #endif // unknownnumberingscheme_h
bool contains(int value) const
Definition: intarray.h:283
The representation of EngngModel default unknown numbering.
Specialized numbering scheme for assembling only specified DofIDs.
virtual int giveDofEquationNumber(Dof *dof) const
Returns the equation number for corresponding DOF.
virtual int giveDofEquationNumber(Dof *dof) const
Returns the equation number for corresponding DOF.
virtual int __giveEquationNumber() const =0
Returns equation number of receiver, usually assigned by emodel.
Class implementing an array of integers.
Definition: intarray.h:61
virtual int __givePrescribedEquationNumber()=0
Returns prescribed equation number of receiver.
virtual bool isDefault() const
Returns true, if receiver is the default engngModel equation numbering scheme; This is useful for som...
DofIDItem
Type representing particular dof type.
Definition: dofiditem.h:86
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 void init()
Initializes the receiver, if necessary.
virtual bool isDefault() const
Returns true, if receiver is the default engngModel equation numbering scheme; This is useful for som...
virtual int giveRequiredNumberOfDomainEquation() const
Returns required number of domain equation.
The representation of EngngModel default prescribed unknown numbering.
virtual int giveDofEquationNumber(Dof *dof) const
Returns the equation number for corresponding DOF.
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
virtual bool isDefault() const
Returns true, if receiver is the default engngModel equation numbering scheme; This is useful for som...
DofIDEquationNumbering(bool prescribed, IntArray dofids)

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:32 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011