OOFEM
3.0
Loading...
Searching...
No Matches
src
sm
prescribeddispslipmultiple.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 "
prescribeddispslipmultiple.h
"
36
#include "
classfactory.h
"
37
#include "
node.h
"
38
#include "
masterdof.h
"
39
#include "
element.h
"
40
#include "
feinterpol.h
"
41
#include "
feinterpol2d.h
"
42
#include "
gausspoint.h
"
43
#include "
sparsemtrx.h
"
44
#include "
xfem/xfemelementinterface.h
"
45
#include "
xfem/integrationrules/discsegintegrationrule.h
"
46
#include "
timestep.h
"
47
#include "
function.h
"
48
#include "
sparselinsystemnm.h
"
49
#include "
unknownnumberingscheme.h
"
50
#include "
engngm.h
"
51
#include "
mathfem.h
"
52
#include "
dynamicinputrecord.h
"
53
54
55
namespace
oofem
{
56
REGISTER_BoundaryCondition
(
PrescribedDispSlipMultiple
);
57
58
PrescribedDispSlipMultiple :: PrescribedDispSlipMultiple(
int
n,
Domain
*d) :
59
ActiveBoundaryCondition
(n, d),
60
PrescribedDispSlipHomogenization
()
61
{
62
}
63
64
PrescribedDispSlipMultiple :: ~PrescribedDispSlipMultiple()
65
{
66
}
67
68
69
void
PrescribedDispSlipMultiple :: initializeFrom(
InputRecord
&ir)
70
{
71
ActiveBoundaryCondition :: initializeFrom(ir);
72
PrescribedDispSlipHomogenization :: initializeFrom(ir);
73
IR_GIVE_FIELD
(ir,
bcs
,
_IFT_PrescribedDispSlipMultiple_BCs
);
74
}
75
76
77
void
PrescribedDispSlipMultiple :: giveInputRecord(
DynamicInputRecord
&input)
78
{
79
ActiveBoundaryCondition :: giveInputRecord(input);
80
PrescribedDispSlipHomogenization :: giveInputRecord(input);
81
input.
setField
(this->
bcs
,
_IFT_PrescribedDispSlipMultiple_BCs
);
82
}
83
84
85
void
PrescribedDispSlipMultiple::setSlipField
(
const
FloatArray
&t )
86
{
87
this->
slipField
= t;
88
for
(
int
i : this->
bcs
) {
89
auto
bc =
dynamic_cast<
PrescribedDispSlipHomogenization
*
>
(this->
giveDomain
()->
giveBc
(i));
90
bc->setSlipField(t);
91
}
92
}
93
94
95
void
PrescribedDispSlipMultiple::setDispGradient
(
const
FloatArray
&t )
96
{
97
this->
slipGradient
=
FloatMatrix::fromArray
(t);
98
for
(
int
i : this->
bcs
) {
99
auto
bc =
dynamic_cast<
PrescribedDispSlipHomogenization
*
>
(this->
giveDomain
()->
giveBc
(i));
100
bc->setDispGradient(t);
101
}
102
}
103
104
105
void
PrescribedDispSlipMultiple::setSlipGradient
(
const
FloatArray
&t )
106
{
107
this->
slipGradient
=
FloatMatrix::fromArray
(t);
108
for
(
int
i : this->
bcs
) {
109
auto
bc =
dynamic_cast<
PrescribedDispSlipHomogenization
*
>
(this->
giveDomain
()->
giveBc
(i));
110
bc->setSlipGradient(t);
111
}
112
}
113
114
115
void
PrescribedDispSlipMultiple::setCenterCoordinate
(
FloatArray
&x )
116
{
117
this->
mCenterCoord
= x;
118
for
(
int
i : this->
bcs
) {
119
auto
bc =
dynamic_cast<
PrescribedDispSlipHomogenization
*
>
(this->
giveDomain
()->
giveBc
(i));
120
bc->setCenterCoordinate(x);
121
}
122
}
123
124
125
DofManager
*
PrescribedDispSlipMultiple::giveInternalDofManager
(
int
i )
126
{
127
for
(
int
j: this->
bcs
) {
128
auto
bc =
dynamic_cast<
ActiveBoundaryCondition
*
>
(this->
giveDomain
()->
giveBc
(j));
129
if
( bc !=
nullptr
) {
130
return
bc->giveInternalDofManager(i);
131
}
132
}
133
return
nullptr
;
134
}
135
136
137
void
PrescribedDispSlipMultiple :: scale(
double
s)
138
{
139
this->
dispField
.times(s);
140
this->
dispGradient
.times(s);
141
this->
slipField
.times(s);
142
this->
slipGradient
.times(s);
143
}
144
145
146
void
PrescribedDispSlipMultiple :: computeStress(
FloatArray
&sigma,
TimeStep
*tStep)
147
{
148
sigma.
clear
();
149
for
(
int
i : this->
bcs
) {
150
FloatArray
tmp;
151
auto
bc =
dynamic_cast<
PrescribedDispSlipHomogenization
*
>
(this->
giveDomain
()->giveBc(i));
152
bc->computeStress(tmp, tStep);
153
sigma.
add
(tmp);
154
}
155
}
156
157
158
void
PrescribedDispSlipMultiple::computeTransferStress
(
FloatArray
&bStress,
TimeStep
*tStep )
159
{
160
bStress.
clear
();
161
for
(
int
i : this->
bcs
) {
162
FloatArray
tmp;
163
auto
bc =
dynamic_cast<
PrescribedDispSlipHomogenization
*
>
(this->
giveDomain
()->
giveBc
(i));
164
bc->computeTransferStress(tmp, tStep);
165
bStress.
add
(tmp);
166
}
167
}
168
169
170
void
PrescribedDispSlipMultiple::computeReinfStress
(
FloatArray
&rStress,
TimeStep
*tStep )
171
{
172
rStress.
clear
();
173
for
(
int
i : this->
bcs
) {
174
FloatArray
tmp;
175
auto
bc =
dynamic_cast<
PrescribedDispSlipHomogenization
*
>
(this->
giveDomain
()->
giveBc
(i));
176
bc->computeReinfStress(tmp, tStep);
177
rStress.
add
(tmp);
178
}
179
}
180
181
182
void
PrescribedDispSlipMultiple :: computeTangent(
FloatMatrix
&tangent,
TimeStep
*tStep)
183
{
184
OOFEM_ERROR
(
"Not implemented"
)
185
}
186
}
/* namespace oofem */
classfactory.h
REGISTER_BoundaryCondition
#define REGISTER_BoundaryCondition(class)
Definition
classfactory.h:133
oofem::ActiveBoundaryCondition::ActiveBoundaryCondition
ActiveBoundaryCondition(int n, Domain *d)
Definition
activebc.h:71
oofem::DofManager
Definition
dofmanager.h:100
oofem::Domain
Definition
domain.h:121
oofem::Domain::giveBc
GeneralBoundaryCondition * giveBc(int n)
Definition
domain.C:246
oofem::DynamicInputRecord
Definition
dynamicinputrecord.h:60
oofem::DynamicInputRecord::setField
void setField(int item, InputFieldType id)
Definition
dynamicinputrecord.C:302
oofem::FEMComponent::giveDomain
Domain * giveDomain() const
Definition
femcmpnn.h:97
oofem::FloatArray
Definition
floatarray.h:92
oofem::FloatArray::clear
void clear()
Definition
floatarray.h:254
oofem::FloatArray::add
void add(const FloatArray &src)
Definition
floatarray.C:218
oofem::FloatMatrix
Definition
floatmatrix.h:87
oofem::FloatMatrix::fromArray
static FloatMatrix fromArray(const FloatArray &vector, bool transpose=false)
Definition
floatmatrix.C:1046
oofem::InputRecord
Definition
inputrecord.h:98
oofem::PrescribedDispSlipHomogenization::slipGradient
FloatMatrix slipGradient
Definition
prescribeddispsliphomogenization.h:72
oofem::PrescribedDispSlipHomogenization::dispField
FloatArray dispField
Prescribed fields.
Definition
prescribeddispsliphomogenization.h:75
oofem::PrescribedDispSlipHomogenization::mCenterCoord
FloatArray mCenterCoord
Center coordinates.
Definition
prescribeddispsliphomogenization.h:79
oofem::PrescribedDispSlipHomogenization::slipField
FloatArray slipField
Definition
prescribeddispsliphomogenization.h:76
oofem::PrescribedDispSlipHomogenization::PrescribedDispSlipHomogenization
PrescribedDispSlipHomogenization()
Definition
prescribeddispsliphomogenization.h:82
oofem::PrescribedDispSlipHomogenization::dispGradient
FloatMatrix dispGradient
Prescribed gradients.
Definition
prescribeddispsliphomogenization.h:71
oofem::PrescribedDispSlipMultiple
Definition
prescribeddispslipmultiple.h:56
oofem::PrescribedDispSlipMultiple::bcs
IntArray bcs
Definition
prescribeddispslipmultiple.h:83
oofem::PrescribedDispSlipMultiple::computeTransferStress
void computeTransferStress(FloatArray &bStress, TimeStep *tStep) override
Definition
prescribeddispslipmultiple.C:158
oofem::PrescribedDispSlipMultiple::setSlipField
void setSlipField(const FloatArray &t) override
Definition
prescribeddispslipmultiple.C:85
oofem::PrescribedDispSlipMultiple::setCenterCoordinate
void setCenterCoordinate(FloatArray &x) override
Definition
prescribeddispslipmultiple.C:115
oofem::PrescribedDispSlipMultiple::setDispGradient
void setDispGradient(const FloatArray &t) override
Definition
prescribeddispslipmultiple.C:95
oofem::PrescribedDispSlipMultiple::setSlipGradient
void setSlipGradient(const FloatArray &t) override
Definition
prescribeddispslipmultiple.C:105
oofem::PrescribedDispSlipMultiple::giveInternalDofManager
DofManager * giveInternalDofManager(int i) override
Gives an internal dof manager from receiver.
Definition
prescribeddispslipmultiple.C:125
oofem::PrescribedDispSlipMultiple::computeReinfStress
void computeReinfStress(FloatArray &rStress, TimeStep *tStep) override
Definition
prescribeddispslipmultiple.C:170
oofem::TimeStep
Definition
timestep.h:82
discsegintegrationrule.h
dynamicinputrecord.h
element.h
engngm.h
OOFEM_ERROR
#define OOFEM_ERROR(...)
Definition
error.h:79
feinterpol2d.h
feinterpol.h
function.h
gausspoint.h
IR_GIVE_FIELD
#define IR_GIVE_FIELD(__ir, __value, __id)
Definition
inputrecord.h:67
masterdof.h
mathfem.h
oofem
Definition
additivemanufacturingproblem.C:83
node.h
prescribeddispslipmultiple.h
_IFT_PrescribedDispSlipMultiple_BCs
#define _IFT_PrescribedDispSlipMultiple_BCs
Definition
prescribeddispslipmultiple.h:44
sparselinsystemnm.h
sparsemtrx.h
timestep.h
unknownnumberingscheme.h
xfemelementinterface.h
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