OOFEM
3.0
Loading...
Searching...
No Matches
src
sm
prescribedgradientmultiple.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 "
prescribedgradientmultiple.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
#ifdef _OPENMP
55
#include <omp.h>
56
#endif
57
58
namespace
oofem
{
59
REGISTER_BoundaryCondition
(
PrescribedGradientMultiple
);
60
61
PrescribedGradientMultiple :: PrescribedGradientMultiple(
int
n,
Domain
*d) :
62
ActiveBoundaryCondition
(n, d),
63
PrescribedGradientHomogenization
()
64
{
65
}
66
67
PrescribedGradientMultiple :: ~PrescribedGradientMultiple()
68
{
69
}
70
71
72
void
PrescribedGradientMultiple :: initializeFrom(
InputRecord
&ir)
73
{
74
ActiveBoundaryCondition :: initializeFrom(ir);
75
PrescribedGradientHomogenization :: initializeFrom(ir);
76
IR_GIVE_FIELD
(ir,
bcs
,
_IFT_PrescribedGradientMultiple_BCs
);
77
}
78
79
80
void
PrescribedGradientMultiple :: giveInputRecord(
DynamicInputRecord
&input)
81
{
82
ActiveBoundaryCondition :: giveInputRecord(input);
83
PrescribedGradientHomogenization :: giveInputRecord(input);
84
input.
setField
(this->
bcs
,
_IFT_PrescribedGradientMultiple_BCs
);
85
}
86
87
88
void
PrescribedGradientMultiple :: setPrescribedGradient(
const
FloatMatrix
&t )
89
{
90
this->
mGradient
= t;
91
for
(
int
i : this->
bcs
) {
92
auto
bc =
dynamic_cast<
PrescribedGradientHomogenization
*
>
(this->
giveDomain
()->giveBc(i));
93
bc->setPrescribedGradient(t);
94
}
95
}
96
97
98
void
PrescribedGradientMultiple :: setPrescribedGradientVoigt(
const
FloatArray
&t )
99
{
100
PrescribedGradientHomogenization :: setPrescribedGradientVoigt(t);
101
for
(
int
i : this->
bcs
) {
102
auto
bc =
dynamic_cast<
PrescribedGradientHomogenization
*
>
(this->
giveDomain
()->giveBc(i));
103
bc->setPrescribedGradientVoigt(t);
104
}
105
}
106
107
108
void
PrescribedGradientMultiple::setCenterCoordinate
(
FloatArray
&x )
109
{
110
this->
mCenterCoord
= x;
111
for
(
int
i : this->
bcs
) {
112
auto
bc =
dynamic_cast<
PrescribedGradientHomogenization
*
>
(this->
giveDomain
()->
giveBc
(i));
113
bc->setCenterCoordinate(x);
114
}
115
}
116
117
118
DofManager
*
PrescribedGradientMultiple::giveInternalDofManager
(
int
i )
119
{
120
for
(
int
j: this->
bcs
) {
121
auto
bc =
dynamic_cast<
ActiveBoundaryCondition
*
>
(this->
giveDomain
()->
giveBc
(j));
122
if
( bc !=
nullptr
) {
123
return
bc->giveInternalDofManager(i);
124
}
125
}
126
return
nullptr
;
127
}
128
129
130
void
PrescribedGradientMultiple :: scale(
double
s)
131
{
132
this->
mGradient
.times(s);
133
}
134
135
136
void
PrescribedGradientMultiple :: computeField(
FloatArray
&sigma,
TimeStep
*tStep)
137
{
138
FloatArray
tmp;
139
sigma.
clear
();
140
for
(
int
i : this->
bcs
) {
141
auto
bc =
dynamic_cast<
PrescribedGradientHomogenization
*
>
(this->
giveDomain
()->giveBc(i));
142
bc->computeField(tmp, tStep);
143
sigma.
add
(tmp);
144
}
145
}
146
147
148
void
PrescribedGradientMultiple :: computeTangent(
FloatMatrix
&tangent,
TimeStep
*tStep)
149
{
150
OOFEM_ERROR
(
"Not implemented"
)
151
}
152
153
}
/* 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::InputRecord
Definition
inputrecord.h:98
oofem::PrescribedGradientHomogenization::mGradient
FloatMatrix mGradient
Prescribed gradient .
Definition
prescribedgradienthomogenization.h:66
oofem::PrescribedGradientHomogenization::mCenterCoord
FloatArray mCenterCoord
Center coordinate .
Definition
prescribedgradienthomogenization.h:69
oofem::PrescribedGradientHomogenization::PrescribedGradientHomogenization
PrescribedGradientHomogenization()
Definition
prescribedgradienthomogenization.h:74
oofem::PrescribedGradientMultiple
Definition
prescribedgradientmultiple.h:56
oofem::PrescribedGradientMultiple::giveInternalDofManager
DofManager * giveInternalDofManager(int i) override
Gives an internal dof manager from receiver.
Definition
prescribedgradientmultiple.C:118
oofem::PrescribedGradientMultiple::bcs
IntArray bcs
Definition
prescribedgradientmultiple.h:79
oofem::PrescribedGradientMultiple::setCenterCoordinate
void setCenterCoordinate(FloatArray &x) override
Definition
prescribedgradientmultiple.C:108
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
prescribedgradientmultiple.h
_IFT_PrescribedGradientMultiple_BCs
#define _IFT_PrescribedGradientMultiple_BCs
Definition
prescribedgradientmultiple.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