OOFEM
3.0
Loading...
Searching...
No Matches
src
fm
pfem
pfemnumberingschemes.C
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
#include "
pfemnumberingschemes.h
"
36
37
namespace
oofem
{
38
PressureNumberingScheme :: PressureNumberingScheme() :
39
UnknownNumberingScheme
()
40
,
neq
(0)
41
,
pres_neq
(0)
42
,
isInitialized
(false)
43
{ }
44
45
PressureNumberingScheme :: ~PressureNumberingScheme()
46
{ }
47
48
void
49
PressureNumberingScheme :: init(
Domain
*
domain
,
TimeStep
*tStep)
50
{
51
isInitialized
=
true
;
52
int
inode;
53
int
nnode =
domain
->giveNumberOfDofManagers();
54
DofManager
*idofman;
55
56
this->
nodalPressureEquationNumbers
.resize(nnode);
57
for
( inode = 1; inode <= nnode; inode++ ) {
58
idofman =
domain
->giveDofManager(inode);
59
for
(
Dof
*jDof: *idofman ) {
60
if
( jDof->giveDofID() == P_f ) {
61
if
( jDof->hasBc(tStep) ) {
62
this->
nodalPressureEquationNumbers
.at(inode) = --
pres_neq
;
63
}
else
{
64
this->
nodalPressureEquationNumbers
.at(inode) = ++
neq
;
65
}
66
}
67
}
68
}
69
}
70
71
void
72
PressureNumberingScheme :: reset()
73
{
74
neq
= 0;
75
pres_neq
= 0;
76
}
77
78
int
79
PressureNumberingScheme :: giveDofEquationNumber(
Dof
*dof)
const
80
{
81
int
dofEqNum = 0;
82
DofIDItem
id
= dof->
giveDofID
();
83
if
(
id
== P_f ) {
84
dofEqNum = this->
nodalPressureEquationNumbers
.at( dof->
giveDofManNumber
() );
85
if
( dofEqNum < 0 )
86
dofEqNum = 0;
87
}
88
return
dofEqNum;
89
}
90
91
92
int
93
PressureNumberingScheme :: giveTotalNumberOfEquations()
const
94
{
95
return
neq
;
96
}
97
98
99
int
100
PressureNumberingScheme :: giveRequiredNumberOfDomainEquation()
const
101
{
102
return
neq
;
103
}
104
105
int
106
PressureNumberingScheme :: giveTotalNumberOfPrescribedEquations()
const
107
{
108
return
-1 *
pres_neq
;
109
}
110
111
112
VelocityNumberingScheme :: VelocityNumberingScheme(
bool
prescribed
) :
113
UnknownNumberingScheme
()
114
,
numEqs
(0)
115
,
prescribed
(
prescribed
)
116
{ }
117
118
VelocityNumberingScheme :: ~VelocityNumberingScheme()
119
{ }
120
121
int
122
VelocityNumberingScheme :: giveDofEquationNumber(
Dof
*dof)
const
123
{
124
DofIDItem
id
= dof->
giveDofID
();
125
if
(
id
== V_u ||
id
== V_v ||
id
== V_w ) {
126
return
prescribed
? dof->
__givePrescribedEquationNumber
() : dof->
__giveEquationNumber
();
127
}
128
129
return
0;
130
}
131
132
Dof
*
133
VelocityNumberingScheme :: giveDofToEquationNumber(
Domain
*d,
int
equationNumber)
134
{
135
bool
found =
false
;
136
Dof
*foundDof = NULL;
137
for
(
int
i = 1; i <= d->
giveNumberOfDofManagers
(); i++ ) {
138
DofManager
*dman = d->
giveDofManager
(i);
139
for
(
Dof
*dof : *dman ) {
//= d->giveDofManager(i)->giveDof(j);
140
DofIDItem
id
= dof->giveDofID();
141
if
(
id
== V_u ||
id
== V_v ||
id
== V_w ) {
142
if
( dof->__giveEquationNumber() == equationNumber ) {
143
foundDof = dof;
144
found =
true
;
145
break
;
146
}
147
}
148
}
149
150
if
( found ) {
151
break
;
152
}
153
}
154
155
return
foundDof;
156
}
157
158
AuxVelocityNumberingScheme :: AuxVelocityNumberingScheme() :
159
UnknownNumberingScheme
()
160
,
neq
(0)
161
{ }
162
163
AuxVelocityNumberingScheme :: ~AuxVelocityNumberingScheme()
164
{ }
165
166
void
167
AuxVelocityNumberingScheme :: init(
Domain
*
domain
)
168
{
169
neq
=
domain
->giveNumberOfSpatialDimensions() *
domain
->giveNumberOfDofManagers();
170
}
171
172
int
173
AuxVelocityNumberingScheme :: giveDofEquationNumber(
Dof
*dof)
const
174
{
175
DofIDItem
type = dof->
giveDofID
();
176
int
c;
177
int
n = dof->
giveDofManager
()->
giveGlobalNumber
();
178
179
if
( type == V_u ) {
180
c = 1;
181
}
else
if
( type == V_v ) {
182
c = 2;
183
}
else
if
( type == V_w ) {
184
c = 3;
185
}
else
{
186
return
0;
187
}
188
189
return
dof->
giveDofManager
()->
giveDomain
()->
giveNumberOfSpatialDimensions
() * ( n - 1 ) + c;
190
}
191
192
int
193
AuxVelocityNumberingScheme :: giveRequiredNumberOfDomainEquation()
const
194
{
195
return
neq
;
196
}
197
}
// end namespace oofem
oofem::AuxVelocityNumberingScheme::neq
int neq
Number of equations.
Definition
pfemnumberingschemes.h:132
oofem::AuxVelocityNumberingScheme::domain
Domain * domain
Definition
pfemnumberingschemes.h:128
oofem::DofManager
Definition
dofmanager.h:100
oofem::DofManager::giveGlobalNumber
int giveGlobalNumber() const
Definition
dofmanager.h:515
oofem::Dof
Definition
dof.h:94
oofem::Dof::giveDofID
DofIDItem giveDofID() const
Definition
dof.h:276
oofem::Dof::__giveEquationNumber
virtual int __giveEquationNumber() const =0
oofem::Dof::giveDofManager
DofManager * giveDofManager() const
Definition
dof.h:123
oofem::Dof::__givePrescribedEquationNumber
virtual int __givePrescribedEquationNumber()=0
oofem::Dof::giveDofManNumber
int giveDofManNumber() const
Definition
dof.C:72
oofem::Domain
Definition
domain.h:121
oofem::Domain::giveNumberOfDofManagers
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
Definition
domain.h:461
oofem::Domain::giveDofManager
DofManager * giveDofManager(int n)
Definition
domain.C:317
oofem::Domain::giveNumberOfSpatialDimensions
int giveNumberOfSpatialDimensions()
Returns number of spatial dimensions.
Definition
domain.C:1137
oofem::FEMComponent::giveDomain
Domain * giveDomain() const
Definition
femcmpnn.h:97
oofem::PressureNumberingScheme::domain
Domain * domain
Definition
pfemnumberingschemes.h:53
oofem::PressureNumberingScheme::isInitialized
bool isInitialized
Flag controlling wether the numbering has been initialized or not.
Definition
pfemnumberingschemes.h:61
oofem::PressureNumberingScheme::pres_neq
int pres_neq
Last given number of prescribed equation.
Definition
pfemnumberingschemes.h:59
oofem::PressureNumberingScheme::nodalPressureEquationNumbers
IntArray nodalPressureEquationNumbers
Container storing particular equation numbers for each node.
Definition
pfemnumberingschemes.h:55
oofem::PressureNumberingScheme::neq
int neq
Last given number of equation.
Definition
pfemnumberingschemes.h:57
oofem::TimeStep
Definition
timestep.h:82
oofem::UnknownNumberingScheme::UnknownNumberingScheme
UnknownNumberingScheme(void)
Definition
unknownnumberingscheme.h:50
oofem::VelocityNumberingScheme::prescribed
bool prescribed
prescribed equations or not
Definition
pfemnumberingschemes.h:98
oofem::VelocityNumberingScheme::numEqs
int numEqs
Last given equation number.
Definition
pfemnumberingschemes.h:96
oofem
Definition
additivemanufacturingproblem.C:83
oofem::DofIDItem
DofIDItem
Definition
dofiditem.h:115
pfemnumberingschemes.h
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