OOFEM 3.0
Loading...
Searching...
No Matches
truss1dgraddamage.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 "fei1dlin.h"
37#include "gausspoint.h"
39#include "floatmatrix.h"
40#include "floatarray.h"
41#include "intarray.h"
42#include "crosssection.h"
43#include "classfactory.h"
44
45
46namespace oofem {
48IntArray Truss1dGradDamage :: locationArray_u = {1, 3};
49IntArray Truss1dGradDamage :: locationArray_d = {2, 4};
50
51
52Truss1dGradDamage :: Truss1dGradDamage(int n, Domain *aDomain) : Truss1d(n, aDomain), GradientDamageElement()
53 // Constructor.
54{
55 nPrimNodes = 2;
56 nPrimVars = 1;
57 nSecNodes = 2;
58 nSecVars = 1;
62}
63
64
65void
66Truss1dGradDamage :: giveDofManDofIDMask(int inode, IntArray &answer) const
67{
68 answer = {D_u, G_0};
69}
70
71
72void
73Truss1dGradDamage :: giveDofManDofIDMask_u(IntArray &answer) const
74{
75 answer = {D_u};
76}
77
78
79void
80Truss1dGradDamage :: giveDofManDofIDMask_d(IntArray &answer) const
81{
82 answer = {G_0};
83
84}
85
86
87
88
89void
90Truss1dGradDamage :: initializeFrom(InputRecord &ir, int priority)
91{
92 GradientDamageElement :: initializeFrom(ir);
93 StructuralElement :: initializeFrom(ir, priority);
94}
95
96
97
98void
99Truss1dGradDamage :: computeStiffnessMatrix(FloatMatrix &answer, MatResponseMode rMode, TimeStep *tStep)
100{
101 GradientDamageElement :: computeStiffnessMatrix(answer, rMode, tStep);
102}
103
104
105void
106Truss1dGradDamage :: giveInternalForcesVector(FloatArray &answer, TimeStep *tStep, int useUpdatedGpRecord)
107{
108 GradientDamageElement :: giveInternalForcesVector(answer, tStep, useUpdatedGpRecord);
109}
110
111
112void
113Truss1dGradDamage :: computeNdMatrixAt(GaussPoint *gp, FloatArray &answer)
114{
115 this->interp.evalN( answer, gp->giveNaturalCoordinates(), FEIElementGeometryWrapper(this) );
116}
117
118
119void
120Truss1dGradDamage :: computeBdMatrixAt(GaussPoint *gp, FloatMatrix &answer)
121{
122 FloatMatrix dnx;
123 this->interp.evaldNdx( dnx, gp->giveNaturalCoordinates(), FEIElementGeometryWrapper(this) );
124 answer.beTranspositionOf(dnx);
125}
126
127void
128Truss1dGradDamage :: computeField(ValueModeType mode, TimeStep* tStep, const FloatArray& lcoords, FloatArray& answer)
129{
131 this->interp.evalN( n, lcoords, FEIElementGeometryWrapper(this) );
132 this->computeVectorOf({D_u}, mode, tStep, unknown);
133 answer.at(1) = n.dotProduct(unknown);
134
135 this->interp.evalN( n, lcoords, FEIElementGeometryWrapper(this) );
136 this->computeVectorOf({G_0}, mode, tStep, unknown);
137 answer.at(2) = n.dotProduct(unknown);
138}
139
140
141
142
143void
144Truss1dGradDamage :: giveLocationArray_u(IntArray &answer)
145{
146 answer = locationArray_u;
147}
148
149
150void
151Truss1dGradDamage :: giveLocationArray_d(IntArray &answer)
152{
153 answer = locationArray_d;
154}
155
156
157void
158Truss1dGradDamage :: postInitialize()
159{
161 NLStructuralElement :: postInitialize();
162}
163
164
165}
#define REGISTER_Element(class)
void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer)
Definition element.C:103
double & at(Index i)
Definition floatarray.h:202
double dotProduct(const FloatArray &x) const
Definition floatarray.C:524
void beTranspositionOf(const FloatMatrix &src)
const FloatArray & giveNaturalCoordinates() const
Returns coordinate array of receiver.
Definition gausspoint.h:138
static IntArray locationArray_u
static IntArray locationArray_d
Truss1d(int n, Domain *d)
Definition truss1d.C:58
static FEI1dLin interp
Definition truss1d.h:62
@ unknown
Definition drawmode.h:40

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