OOFEM
2.4
OOFEM.org - Object Oriented Finite Element Solver
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
cdefnode2node.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 "
Contact/cdefnode2node.h
"
36
#include "
Contact/celnode2node.h
"
37
#include "
domain.h
"
38
#include "
classfactory.h
"
39
40
namespace
oofem
{
41
REGISTER_ContactDefinition
(
ContactDefinitionNode2Node
)
42
REGISTER_ContactDefinition
(
ContactDefinitionNode2NodeL
)
43
44
45
ContactDefinitionNode2Node
::
ContactDefinitionNode2Node
(
ContactManager
*cMan) :
ContactDefinition
(cMan){}
46
47
48
IRResultType
49
ContactDefinitionNode2Node :: initializeFrom
(
InputRecord
*ir)
50
{
51
52
IRResultType
result;
// Required by IR_GIVE_FIELD macro
53
54
IntArray
masterNodes;
55
IntArray
slaveNodes;
56
IR_GIVE_FIELD
(ir, masterNodes,
_IFT_ContactDefinitionNode2Node_MasterNodes
);
57
IR_GIVE_FIELD
(ir, slaveNodes,
_IFT_ContactDefinitionNode2Node_SlaveNodes
);
58
//this->epsN = 1.0e6;
59
//IR_GIVE_OPTIONAL_FIELD(ir, this->epsN, _IFT_ContactDefinitionNode2Node_PenaltyN);
60
61
Domain
*domain = this->
giveContactManager
()->
giveDomain
();
62
for
(
int
i = 1; i<= masterNodes.
giveSize
(); i++ ) {
63
ContactElement
*master =
new
Node2NodeContact
( domain->
giveDofManager
(masterNodes.
at
(i)),
64
domain->
giveDofManager
(slaveNodes.
at
(i)));
65
66
this->
addContactElement
(master);
67
}
68
69
return
IRRT_OK
;
70
}
71
72
73
74
75
// Same version but with Lagrange multipliers
76
ContactDefinitionNode2NodeL :: ContactDefinitionNode2NodeL
(
ContactManager
*
cMan
) :
ContactDefinitionNode2Node
(cMan)
77
{
78
this->
setNumberOfConstraintEqToAdd
(1);
79
}
80
81
82
IRResultType
83
ContactDefinitionNode2NodeL :: initializeFrom
(
InputRecord
*ir)
84
{
85
IRResultType
result;
// Required by IR_GIVE_FIELD macro
86
87
IntArray
masterNodes;
88
IntArray
slaveNodes;
89
IR_GIVE_FIELD
(ir, masterNodes,
_IFT_ContactDefinitionNode2Node_MasterNodes
);
90
IR_GIVE_FIELD
(ir, slaveNodes,
_IFT_ContactDefinitionNode2Node_SlaveNodes
);
91
92
Domain
*domain = this->
giveContactManager
()->
giveDomain
();
93
for
(
int
i = 1; i<= masterNodes.
giveSize
(); i++ ) {
94
ContactElement
*master =
new
Node2NodeContactL
( domain->
giveDofManager
(masterNodes.
at
(i)),
95
domain->
giveDofManager
(slaveNodes.
at
(i)) );
96
97
this->
addContactElement
(master);
98
}
99
100
101
102
return
IRRT_OK
;
103
}
104
105
106
107
108
109
}
oofem::ContactDefinition::giveContactManager
ContactManager * giveContactManager()
Definition:
contactdefinition.h:90
oofem::Domain
Class and object Domain.
Definition:
domain.h:115
oofem::ContactDefinitionNode2NodeL
This class manages a none to node contact definition with enforcement using Lagrange multipliers...
Definition:
cdefnode2node.h:95
oofem::ContactDefinitionNode2Node::initializeFrom
virtual IRResultType initializeFrom(InputRecord *ir)
Definition:
cdefnode2node.C:49
oofem::ContactDefinition::addContactElement
void addContactElement(ContactElement *cEl)
Definition:
contactdefinition.h:101
oofem::IntArray
Class implementing an array of integers.
Definition:
intarray.h:61
oofem::IntArray::at
int & at(int i)
Coefficient access function.
Definition:
intarray.h:103
_IFT_ContactDefinitionNode2Node_SlaveNodes
#define _IFT_ContactDefinitionNode2Node_SlaveNodes
Definition:
cdefnode2node.h:45
oofem::ContactDefinition::cMan
ContactManager * cMan
Definition:
contactdefinition.h:67
oofem::ContactDefinitionNode2NodeL::initializeFrom
virtual IRResultType initializeFrom(InputRecord *ir)
Definition:
cdefnode2node.C:83
oofem::REGISTER_ContactDefinition
REGISTER_ContactDefinition(ContactDefinition)
Definition:
contactdefinition.C:46
_IFT_ContactDefinitionNode2Node_MasterNodes
#define _IFT_ContactDefinitionNode2Node_MasterNodes
Definition:
cdefnode2node.h:44
classfactory.h
oofem::IRRT_OK
Definition:
irresulttype.h:47
oofem::ContactManager
This class manages all the contacts in a domain.
Definition:
contactmanager.h:65
oofem::Node2NodeContactL
Definition:
celnode2node.h:98
oofem::IRResultType
IRResultType
Type defining the return values of InputRecord reading operations.
Definition:
irresulttype.h:47
oofem::ContactManager::giveDomain
Domain * giveDomain()
Definition:
contactmanager.h:91
oofem::InputRecord
Class representing the general Input Record.
Definition:
inputrecord.h:101
oofem::Node2NodeContact
Definition:
celnode2node.h:59
domain.h
oofem::ContactDefinition
This class manages a particular contact definition.
Definition:
contactdefinition.h:64
celnode2node.h
oofem::ContactDefinitionNode2Node
This class manages a particular contact definition.
Definition:
cdefnode2node.h:66
oofem::IntArray::giveSize
int giveSize() const
Definition:
intarray.h:203
oofem
the oofem namespace is to define a context or scope in which all oofem names are defined.
IR_GIVE_FIELD
#define IR_GIVE_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition:
inputrecord.h:69
oofem::Domain::giveDofManager
DofManager * giveDofManager(int n)
Service for accessing particular domain dof manager.
Definition:
domain.C:314
oofem::ContactElement
Definition:
contactelement.h:75
oofem::ContactDefinition::setNumberOfConstraintEqToAdd
virtual void setNumberOfConstraintEqToAdd(const int number)
Definition:
contactdefinition.h:92
oofem::ContactDefinitionNode2NodeL::ContactDefinitionNode2NodeL
ContactDefinitionNode2NodeL(ContactManager *cMan)
Constructor.
Definition:
cdefnode2node.C:76
cdefnode2node.h
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