OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
bctracker.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 "domain.h"
36 #include "intarray.h"
37 #include "element.h"
38 #include "set.h"
39 #include "load.h"
40 #include "bodyload.h"
41 #include "boundaryload.h"
42 #include "nodalload.h"
43 #include "activebc.h"
44 #include "timestep.h"
45 
46 namespace oofem {
47 
49  this->domain = d;
50 }
51 
52 
53 void
55  this->elemList.clear();
56  this->elemList.resize(domain->giveNumberOfElements());
57 
59  for ( int ibc = 1; ibc <= nbc; ++ibc ) {
62  Load *load;
63 
64  if ( ( abc = dynamic_cast< ActiveBoundaryCondition * >(bc) ) ) {
65  continue;
66  } else if ( bc->giveSetNumber() && ( load = dynamic_cast< Load * >(bc) )) {
67  BodyLoad *bodyLoad;
68  BoundaryLoad *bLoad;
69  Set *set = domain->giveSet( bc->giveSetNumber() );
70 
71  if ( ( bodyLoad = dynamic_cast< BodyLoad * >(bc) ) ) { // Body load:
72  const IntArray &elements = set->giveElementList();
73  for ( int ielem = 1; ielem <= elements.giveSize(); ++ielem ) {
74  Entry entry (ibc, 0);
75  this->elemList[elements.at(ielem)-1].push_back(entry);
76  }
77  } else if ( ( bLoad = dynamic_cast< BoundaryLoad * >(bc) ) ) { // Boundary load:
78  const IntArray &boundaries = set->giveBoundaryList();
79  for ( int ibnd = 1; ibnd <= boundaries.giveSize() / 2; ++ibnd ) {
80  int eid = boundaries.at(ibnd * 2 - 1) ;
81  int bid = boundaries.at(ibnd * 2);
82  Entry entry (ibc, bid);
83  this->elemList[eid-1].push_back(entry);
84  }
85 
87  const IntArray &edgeBoundaries = set->giveEdgeList();
88  for ( int ibnd = 1; ibnd <= edgeBoundaries.giveSize() / 2; ++ibnd ) {
89  int eid = edgeBoundaries.at(ibnd * 2 - 1) ;
90  int bid = edgeBoundaries.at(ibnd * 2);
91  Entry entry(ibc, bid);
92  this->elemList[eid-1].push_back(entry);
93  }
94  }
95  }
96  }// end loop over BCs
97 }
98 
101  if (this->elemList.empty()) {
102  this->initialize();
103  }
104  return this->elemList.at(elem-1);
105 }
106 
107 } // end namespace oofem
Class and object Domain.
Definition: domain.h:115
int giveNumberOfBoundaryConditions() const
Returns number of boundary conditions in domain.
Definition: domain.h:440
Class implementing element body load, acting over whole element volume (e.g., the dead weight)...
Definition: bodyload.h:49
void initialize()
Definition: bctracker.C:54
Helper class storing a sigle record for component (element, node, etc)
Definition: bctracker.h:56
int giveNumberOfElements() const
Returns number of elements in domain.
Definition: domain.h:434
Class implementing an array of integers.
Definition: intarray.h:61
int & at(int i)
Coefficient access function.
Definition: intarray.h:103
const entryListType & getElementRecords(int elem)
Definition: bctracker.C:100
std::vector< entryListType > elemList
list keeping element entries
Definition: bctracker.h:68
GeneralBoundaryCondition * giveBc(int n)
Service for accessing particular domain bc.
Definition: domain.C:243
int giveSetNumber()
Gives the set number which boundary condition is applied to.
Abstract base class representing a boundary load (force, momentum, ...) that acts directly on a bound...
Definition: boundaryload.h:110
Set of elements, boundaries, edges and/or nodes.
Definition: set.h:66
Set * giveSet(int n)
Service for accessing particular domain set.
Definition: domain.C:363
Abstract base class for all active boundary conditions.
Definition: activebc.h:63
Abstract base class for all boundary conditions of problem.
std::list< Entry > entryListType
Definition: bctracker.h:64
BCTracker(Domain *d)
Definition: bctracker.C:48
Load is base abstract class for all loads.
Definition: load.h:61
Domain * domain
Domain link.
Definition: bctracker.h:70
int giveSize() const
Definition: intarray.h:203
the oofem namespace is to define a context or scope in which all oofem names are defined.

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