OOFEM 3.0
Loading...
Searching...
No Matches
qtruss1dgraddamage.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 "fei1dquad.h"
38#include "gausspoint.h"
40#include "floatmatrix.h"
41#include "floatarray.h"
42#include "intarray.h"
43#include "crosssection.h"
44#include "classfactory.h"
45
46#ifdef __OOFEG
47 #include "oofeggraphiccontext.h"
48#endif
49
50namespace oofem {
52
53FEI1dLin QTruss1dGradDamage :: interpolation_lin(1);
54
55QTruss1dGradDamage :: QTruss1dGradDamage(int n, Domain *aDomain) : QTruss1d(n, aDomain), GradientDamageElement()
56 // Constructor.
57{
58 nPrimNodes = 3;
59 nPrimVars = 1;
60 nSecNodes = 2;
61 nSecVars = 1;
65}
66
67
68void
69QTruss1dGradDamage :: giveDofManDofIDMask(int inode, IntArray &answer) const
70{
71 if ( inode < 3 ) {
72 answer = {D_u, G_0};
73 } else {
74 answer = {D_u};
75 }
76}
77
78
79 void
80QTruss1dGradDamage :: giveDofManDofIDMask_u(IntArray &answer) const
81{
82 answer = {D_u};
83}
84
85
86void
87QTruss1dGradDamage :: giveDofManDofIDMask_d(IntArray &answer) const
88{
89 /*
90 if ( inode <= 3 ) {
91 answer = {G_0};
92 } else {
93 answer = {};
94 }
95 */
96}
97
98
99
100
101void
102QTruss1dGradDamage :: initializeFrom(InputRecord &ir, int priority)
103{
104 StructuralElement :: initializeFrom(ir, priority);
105}
106
107
108void
109QTruss1dGradDamage :: computeGaussPoints()
110{
111 integrationRulesArray.resize( 1 );
112 integrationRulesArray [ 0 ].reset( new GaussIntegrationRule(1, this, 1, 1) );
113 this->giveCrossSection()->setupIntegrationPoints(* integrationRulesArray [ 0 ], numberOfGaussPoints, this);
114}
115
116
117void
118QTruss1dGradDamage :: computeStiffnessMatrix(FloatMatrix &answer, MatResponseMode rMode, TimeStep *tStep)
119{
120 GradientDamageElement :: computeStiffnessMatrix(answer, rMode, tStep);
121}
122
123
124void
125QTruss1dGradDamage :: giveInternalForcesVector(FloatArray &answer, TimeStep *tStep, int useUpdatedGpRecord)
126{
127 GradientDamageElement :: giveInternalForcesVector(answer, tStep, useUpdatedGpRecord);
128}
129
130
131void
132QTruss1dGradDamage :: computeNdMatrixAt(GaussPoint *gp, FloatArray &answer)
133{
134 this->interpolation_lin.evalN( answer, gp->giveNaturalCoordinates(), FEIElementGeometryWrapper(this) );
135}
136
137
138void
139QTruss1dGradDamage :: computeBdMatrixAt(GaussPoint *gp, FloatMatrix &answer)
140{
141 FloatMatrix dnx;
142 this->interpolation_lin.evaldNdx( dnx, gp->giveNaturalCoordinates(), FEIElementGeometryWrapper(this) );
143 answer.beTranspositionOf(dnx);
144}
145
146void QTruss1dGradDamage :: computeField(ValueModeType mode, TimeStep* tStep, const FloatArray& lcoords, FloatArray& answer)
147{
149 this->interpolation_lin.evalN( n, lcoords, FEIElementGeometryWrapper(this) );
150 this->computeVectorOf({D_u}, mode, tStep, unknown);
151 answer.at(1) = n.dotProduct(unknown);
152
153 this->interpolation.evalN( n, lcoords, FEIElementGeometryWrapper(this) );
154 this->computeVectorOf({G_0}, mode, tStep, unknown);
155 answer.at(2) = n.dotProduct(unknown);
156}
157
158}
#define REGISTER_Element(class)
void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer)
Definition element.C:103
std::vector< std ::unique_ptr< IntegrationRule > > integrationRulesArray
Definition element.h:157
int numberOfGaussPoints
Definition element.h:175
CrossSection * giveCrossSection()
Definition element.C:534
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
QTruss1d(int n, Domain *d)
Definition qtruss1d.C:56
static FEI1dQuad interpolation
Definition qtruss1d.h:52
@ 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