OOFEM 3.0
Loading...
Searching...
No Matches
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
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"
46#include "timestep.h"
47#include "function.h"
48#include "sparselinsystemnm.h"
50#include "engngm.h"
51#include "mathfem.h"
52#include "dynamicinputrecord.h"
53
54#ifdef _OPENMP
55#include <omp.h>
56#endif
57
58namespace oofem {
60
61PrescribedGradientMultiple :: PrescribedGradientMultiple(int n, Domain *d) :
64{
65}
66
67PrescribedGradientMultiple :: ~PrescribedGradientMultiple()
68{
69}
70
71
72void PrescribedGradientMultiple :: initializeFrom(InputRecord &ir)
73{
74 ActiveBoundaryCondition :: initializeFrom(ir);
75 PrescribedGradientHomogenization :: initializeFrom(ir);
77}
78
79
80void PrescribedGradientMultiple :: giveInputRecord(DynamicInputRecord &input)
81{
82 ActiveBoundaryCondition :: giveInputRecord(input);
83 PrescribedGradientHomogenization :: giveInputRecord(input);
85}
86
87
88void 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
98void 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
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
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
130void PrescribedGradientMultiple :: scale(double s)
131{
132 this->mGradient.times(s);
133}
134
135
136void 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
148void PrescribedGradientMultiple :: computeTangent(FloatMatrix &tangent, TimeStep *tStep)
149{
150 OOFEM_ERROR("Not implemented")
151}
152
153} /* namespace oofem */
#define REGISTER_BoundaryCondition(class)
ActiveBoundaryCondition(int n, Domain *d)
Definition activebc.h:71
GeneralBoundaryCondition * giveBc(int n)
Definition domain.C:246
void setField(int item, InputFieldType id)
Domain * giveDomain() const
Definition femcmpnn.h:97
void add(const FloatArray &src)
Definition floatarray.C:218
DofManager * giveInternalDofManager(int i) override
Gives an internal dof manager from receiver.
void setCenterCoordinate(FloatArray &x) override
#define OOFEM_ERROR(...)
Definition error.h:79
#define IR_GIVE_FIELD(__ir, __value, __id)
Definition inputrecord.h:67
#define _IFT_PrescribedGradientMultiple_BCs

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