OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
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 - 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 #include "fluidmodel.h"
36 #include "element.h"
37 #include "dof.h"
39 #include "dofmanager.h"
40 
41 namespace oofem
42 {
43 int
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
Class and object Domain.
Definition: domain.h:115
Base class for dof managers.
Definition: dofmanager.h:113
std::vector< std::unique_ptr< DofManager > > & giveDofManagers()
Definition: domain.h:400
int & at(int i)
Coefficient access function.
Definition: intarray.h:103
std::vector< std::unique_ptr< GeneralBoundaryCondition > > & giveBcs()
Definition: domain.h:322
IntArray domainPrescribedNeqs
Number of prescribed equations per domain.
Definition: engngm.h:217
DofIDItem
Type representing particular dof type.
Definition: dofiditem.h:86
virtual int forceEquationNumbering()
Forces equation renumbering on all domains associated to engng model.
Definition: fluidmodel.h:52
IntArray domainNeqs
Number of equations per domain.
Definition: engngm.h:215
std::vector< std::unique_ptr< Element > > & giveElements()
Definition: domain.h:279
virtual TimeStep * giveCurrentStep(bool force=false)
Returns current time step.
Definition: engngm.h:683
the oofem namespace is to define a context or scope in which all oofem names are defined.
Domain * giveDomain(int n)
Service for accessing particular problem domain.
Definition: engngm.C:1720
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