OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
slavenode.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 "slavenode.h"
36 #include "slavedof.h"
37 #include "floatarray.h"
38 #include "intarray.h"
40 #include "classfactory.h"
41 
42 namespace oofem {
43 REGISTER_DofManager(SlaveNode);
44 
46 {
47  IRResultType result; // Required by IR_GIVE_FIELD macro
48 
51 
52  if ( masterWeights.giveSize() == 0 ) {
54  masterWeights.add( 1 / ( double ) masterDofManagers.giveSize() );
55  } else if ( masterDofManagers.giveSize() != masterWeights.giveSize() ) {
56  OOFEM_WARNING("master dof managers and weights size mismatch.");
57  return IRRT_BAD_FORMAT;
58  }
59  return Node :: initializeFrom(ir);
60 }
61 
62 
64 {
66 
67  // initialize slave dofs (inside check of consistency of receiver and master dof)
68  for ( Dof *dof: *this ) {
69  SlaveDof *sdof = dynamic_cast< SlaveDof * >(dof);
70  if ( sdof ) {
72  }
73  }
74  // clean up
75  this->masterWeights.clear();
76 }
77 
78 
80 {
81  for ( int i = 1; i <= masterDofManagers.giveSize(); ++i ) {
83  }
84 
86 }
87 } // end namespace oofem
IntArray masterDofManagers
Master nodes for all dofs.
Definition: slavenode.h:61
#define _IFT_SlaveNode_weights
Definition: slavenode.h:44
virtual void postInitialize()
Performs post-initialization such like checking if there are any slave dofs etc.
Definition: dofmanager.C:862
void clear()
Clears receiver (zero size).
Definition: floatarray.h:206
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: node.C:93
Class implementing an array of integers.
Definition: intarray.h:61
int & at(int i)
Coefficient access function.
Definition: intarray.h:103
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: slavenode.C:45
#define _IFT_SlaveNode_masterDofManagers
Definition: slavenode.h:43
REGISTER_DofManager(ElementSide)
void initialize(const IntArray &masterNodes, const IntArray &mstrDofID, const FloatArray &mstrContribution)
Definition: slavedof.C:52
virtual void postInitialize()
Performs post-initialization such like checking if there are any slave dofs etc.
Definition: slavenode.C:63
FloatArray masterWeights
Common dof weights for each master node.
Definition: slavenode.h:63
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
Class representing the general Input Record.
Definition: inputrecord.h:101
virtual void updateLocalNumbering(EntityRenumberingFunctor &f)
Local renumbering support.
Definition: slavenode.C:79
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:78
int giveSize() const
Definition: intarray.h:203
int giveSize() const
Returns the size of receiver.
Definition: floatarray.h:218
the oofem namespace is to define a context or scope in which all oofem names are defined.
#define IR_GIVE_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:69
Abstract class Dof represents Degree Of Freedom in finite element mesh.
Definition: dof.h:93
#define OOFEM_WARNING(...)
Definition: error.h:62
Class representing "slave" degree of freedom.
Definition: slavedof.h:47
virtual void updateLocalNumbering(EntityRenumberingFunctor &f)
Local renumbering support.
Definition: dofmanager.C:950
void add(const FloatArray &src)
Adds array src to receiver.
Definition: floatarray.C:156
void resize(int s)
Resizes receiver towards requested size.
Definition: floatarray.C:631

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