OOFEM 3.0
Loading...
Searching...
No Matches
fluidmodel.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 "fluidmodel.h"
36#include "element.h"
37#include "dof.h"
39#include "dofmanager.h"
40
41namespace oofem
42{
43int
44FluidModel :: forceEquationNumbering(int id)
45{
46 // Necessary to number DOFs in special order to guarantee that Skyline matrix factorization to work.
47 Domain *domain = this->giveDomain(id);
48 TimeStep *currStep = this->giveCurrentStep();
49
50 this->domainNeqs.at(id) = 0;
51 this->domainPrescribedNeqs.at(id) = 0;
52
53 // First velocity.
54 for ( auto &dman : domain->giveDofManagers() ) {
55 for ( Dof *dof: *dman ) {
56 DofIDItem type = dof->giveDofID();
57 if ( type == V_u || type == V_v || type == V_w ) {
58 dof->askNewEquationNumber(currStep);
59 }
60 }
61 }
62
63 for ( auto &elem : domain->giveElements() ) {
64 int innodes = elem->giveNumberOfInternalDofManagers();
65 for ( int k = 1; k <= innodes; k++ ) {
66 DofManager *dman = elem->giveInternalDofManager(k);
67 for ( Dof *dof: *dman ) {
68 DofIDItem type = dof->giveDofID();
69 if ( type == V_u || type == V_v || type == V_w ) {
70 dof->askNewEquationNumber(currStep);
71 }
72 }
73 }
74 }
75
76 for ( auto &bc : domain->giveBcs() ) {
77 int innodes = bc->giveNumberOfInternalDofManagers();
78 for ( int k = 1; k <= innodes; k++ ) {
79 DofManager *dman = bc->giveInternalDofManager(k);
80 for ( Dof *dof: *dman ) {
81 DofIDItem type = dof->giveDofID();
82 if ( type == V_u || type == V_v || type == V_w ) {
83 dof->askNewEquationNumber(currStep);
84 }
85 }
86 }
87 }
88
89 // Then the rest
90 for ( auto &dman : domain->giveDofManagers() ) {
91 for ( Dof *dof: *dman ) {
92 DofIDItem type = dof->giveDofID();
93 if ( !( type == V_u || type == V_v || type == V_w ) ) {
94 dof->askNewEquationNumber(currStep);
95 }
96 }
97 }
98
99 for ( auto &elem : domain->giveElements() ) {
100 int innodes = elem->giveNumberOfInternalDofManagers();
101 for ( int k = 1; k <= innodes; k++ ) {
102 DofManager *dman = elem->giveInternalDofManager(k);
103 for ( Dof *dof: *dman ) {
104 DofIDItem type = dof->giveDofID();
105 if ( !( type == V_u || type == V_v || type == V_w ) ) {
106 dof->askNewEquationNumber(currStep);
107 }
108 }
109 }
110 }
111
112 for ( auto &bc : domain->giveBcs() ) {
113 int innodes = bc->giveNumberOfInternalDofManagers();
114 for ( int k = 1; k <= innodes; k++ ) {
115 DofManager *dman = bc->giveInternalDofManager(k);
116 for ( Dof *dof: *dman ) {
117 DofIDItem type = dof->giveDofID();
118 if ( !( type == V_u || type == V_v || type == V_w ) ) {
119 dof->askNewEquationNumber(currStep);
120 }
121 }
122 }
123 }
124
125 return domainNeqs.at(id);
126}
127} // end namespace oofem
std ::vector< std ::unique_ptr< DofManager > > & giveDofManagers()
Definition domain.h:427
std ::vector< std ::unique_ptr< GeneralBoundaryCondition > > & giveBcs()
Definition domain.h:349
std ::vector< std ::unique_ptr< Element > > & giveElements()
Definition domain.h:294
virtual TimeStep * giveCurrentStep(bool force=false)
Definition engngm.h:717
Domain * giveDomain(int n)
Definition engngm.C:1936
IntArray domainPrescribedNeqs
Number of prescribed equations per domain.
Definition engngm.h:227
IntArray domainNeqs
Number of equations per domain.
Definition engngm.h:225

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