OOFEM 3.0
Loading...
Searching...
No Matches
intelline2intpen.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 "intelline2intpen.h"
36
37#include "dofmanager.h"
38#include "fei2dlinelin.h"
39#include "fei2dlinequad.h"
40#include "gausspoint.h"
42#include "parametermanager.h"
43#include "paramkey.h"
44
45
46namespace oofem {
48
54
55
56void
57IntElLine2IntPen :: initializeFrom(InputRecord &ir, int priority)
58{
59 StructuralInterfaceElement :: initializeFrom(ir, priority);
60 ParameterManager &ppm = giveDomain()->elementPPM;
62}
63
64
66IntElLine2IntPen :: computeCovarBaseVectorAt(IntegrationPoint *ip) const
67{
68 //printf("Entering IntElLine2IntPen :: computeCovarBaseVectorAt\n");
69
70 // Since we are averaging over the whole element, always evaluate the base vectors at xi = 0.
71
72 FloatArray xi_0 = {0.0};
73
75 FloatMatrix dNdxi;
76// interp->evaldNdxi( dNdxi, ip->giveNaturalCoordinates(), FEIElementGeometryWrapper(this) );
77 interp->evaldNdxi( dNdxi, xi_0, FEIElementGeometryWrapper(this) );
78
80 int numNodes = this->giveNumberOfNodes();
81 for ( int i = 1; i <= dNdxi.giveNumberOfRows(); i++ ) {
82 double X1_i = 0.5 * ( this->giveNode(i)->giveCoordinate(1) + this->giveNode(i + numNodes / 2)->giveCoordinate(1) ); // (mean) point on the fictious mid surface
83 double X2_i = 0.5 * ( this->giveNode(i)->giveCoordinate(2) + this->giveNode(i + numNodes / 2)->giveCoordinate(2) );
84 G.at(1) += dNdxi.at(i, 1) * X1_i;
85 G.at(2) += dNdxi.at(i, 1) * X2_i;
86 }
87 return G;
88}
89
90void
91IntElLine2IntPen :: computeStiffnessMatrix(FloatMatrix &answer, MatResponseMode rMode, TimeStep *tStep)
92{
93 // Computes the stiffness matrix of the receiver K_cohesive = int_A ( N^t * dT/dj * N ) dA
94 FloatMatrix N, D, DN;
95 bool matStiffSymmFlag = this->giveCrossSection()->isCharacteristicMtrxSymmetric(rMode);
96 answer.clear();
97
98 FloatMatrix rotationMatGtoL;
99 FloatArray u;
100
101 // First loop over GP: compute projection of test function and traction.
102 // The setting is as follows: we have an interface with quadratic interpolation and we
103 // wish to project onto the space of constant functions on each element.
104
105 // Projecting the basis functions gives a constant for each basis function.
106 FloatMatrix proj_N;
107 proj_N.clear();
108
109 FloatMatrix proj_DN;
110 proj_DN.clear();
111
112 double area = 0.;
113
114 for ( auto &ip: *this->giveDefaultIntegrationRulePtr() ) {
115
116 this->computeNmatrixAt(ip, N);
117
118 if ( this->nlGeometry == 0 ) {
119 this->giveStiffnessMatrix_Eng(D, rMode, ip, tStep);
120 } else if ( this->nlGeometry == 1 ) {
121 this->giveStiffnessMatrix_dTdj(D, rMode, ip, tStep);
122 } else {
123 OOFEM_ERROR("nlgeometry must be 0 or 1!")
124 }
125
126 this->computeTransformationMatrixAt(ip, rotationMatGtoL);
127 D.rotatedWith(rotationMatGtoL, 'n'); // transform stiffness to global coord system
128
129 this->computeNmatrixAt(ip, N);
130 DN.beProductOf(D, N);
131
132
133 double dA = this->computeAreaAround(ip);
134 area += dA;
135
136 proj_N.add(dA, N);
137 proj_DN.add(dA, DN);
138 }
139
140// printf("area: %e\n", area);
141 proj_N.times(1./area);
142 proj_DN.times(1./area);
143
144// printf("proj_N: "); proj_N.printYourself();
145
146 for ( auto &ip: *this->giveDefaultIntegrationRulePtr() ) {
147
148 if ( this->nlGeometry == 0 ) {
149 this->giveStiffnessMatrix_Eng(D, rMode, ip, tStep);
150 } else if ( this->nlGeometry == 1 ) {
151 this->giveStiffnessMatrix_dTdj(D, rMode, ip, tStep);
152 } else {
153 OOFEM_ERROR("nlgeometry must be 0 or 1!")
154 }
155
156 this->computeTransformationMatrixAt(ip, rotationMatGtoL);
157 D.rotatedWith(rotationMatGtoL, 'n'); // transform stiffness to global coord system
158
159 DN.beProductOf(D, proj_N);
160
161
162 double dA = this->computeAreaAround(ip);
163 if ( matStiffSymmFlag ) {
164 answer.plusProductSymmUpper(proj_N, DN, dA);
165 } else {
166 answer.plusProductUnsym(proj_N, DN, dA);
167 }
168 }
169
170
171 if ( matStiffSymmFlag ) {
172 answer.symmetrized();
173 }
174}
175
176
177void
178IntElLine2IntPen :: giveInternalForcesVector(FloatArray &answer,
179 TimeStep *tStep, int useUpdatedGpRecord)
180{
181 // Computes internal forces
182 // For this element we use an "interior penalty" formulation, where
183 // the cohesive zone contribution is weakened, i.e. the traction and
184 // test function for the cohesive zone are projected onto a reduced
185 // space. The purpose of the projection is to improve the stability
186 // properties of the formulation, thereby avoiding traction oscilations.
187
189 FloatArray u, traction, jump;
190
191 this->computeVectorOf(VM_Total, tStep, u);
192 // subtract initial displacements, if defined
193 if ( initialDisplacements.giveSize() ) {
195 }
196
197 // zero answer will resize accordingly when adding first contribution
198 answer.clear();
199
200
201
202 // First loop over GP: compute projection of test function and traction.
203 // The setting is as follows: we have an interface with quadratic interpolation and we
204 // wish to project onto the space of constant functions on each element.
205
206 // The projection of t becomes a constant
207// FloatArray proj_t;
208// proj_t.clear();
209
210
211 FloatArray proj_jump;
212 proj_jump.clear();
213
214 // Projecting the basis functions gives a constant for each basis function.
215 FloatMatrix proj_N;
216 proj_N.clear();
217
218 double area = 0.;
219
220 for ( auto &ip: *this->giveDefaultIntegrationRulePtr() ) {
221
222 this->computeNmatrixAt(ip, N);
223 jump.beProductOf(N, u);
224// this->computeTraction(traction, ip, jump, tStep);
225
226 double dA = this->computeAreaAround(ip);
227 area += dA;
228
229 proj_jump.add(dA, jump);
230 proj_N.add(dA, N);
231 }
232
233// printf("area: %e\n", area);
234 proj_jump.times(1./area);
235 proj_N.times(1./area);
236
237// printf("proj_N: "); proj_N.printYourself();
238
239
240 // Second loop over GP: assemble contribution to internal forces as we are used to.
241 for ( auto &ip: *this->giveDefaultIntegrationRulePtr() ) {
242// this->computeNmatrixAt(ip, N);
243// jump.beProductOf(N, u);
244 this->computeTraction(traction, ip, proj_jump, tStep);
245
246 // compute internal cohesive forces as f = N^T*traction dA
247 double dA = this->computeAreaAround(ip);
248 answer.plusProduct(proj_N, traction, dA);
249 }
250
251}
252
253
254
255} /* namespace oofem */
#define N(a, b)
#define REGISTER_Element(class)
Node * giveNode(int i) const
Definition element.h:629
virtual int giveNumberOfNodes() const
Definition element.h:703
int numberOfDofMans
Number of dofmanagers.
Definition element.h:136
void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer)
Definition element.C:103
int numberOfGaussPoints
Definition element.h:175
CrossSection * giveCrossSection()
Definition element.C:534
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
Definition element.h:886
Domain * giveDomain() const
Definition femcmpnn.h:97
int number
Component number.
Definition femcmpnn.h:77
double & at(std::size_t i)
void plusProduct(const FloatMatrix &b, const FloatArray &s, double dV)
Definition floatarray.C:288
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Definition floatarray.C:689
void add(const FloatArray &src)
Definition floatarray.C:218
void subtract(const FloatArray &src)
Definition floatarray.C:320
void times(double s)
Definition floatarray.C:834
void times(double f)
void rotatedWith(const FloatMatrix &r, char mode='n')
void plusProductSymmUpper(const FloatMatrix &a, const FloatMatrix &b, double dV)
void add(const FloatMatrix &a)
*Sets size of receiver to be an empty matrix It will have zero rows and zero columns size void clear()
void plusProductUnsym(const FloatMatrix &a, const FloatMatrix &b, double dV)
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
int giveNumberOfRows() const
Returns number of rows of receiver.
double at(std::size_t i, std::size_t j) const
double computeAreaAround(GaussPoint *gp) override
Definition intelline1.C:120
static ParamKey IPK_IntElLine1_axisymmode
Definition intelline1.h:65
void giveStiffnessMatrix_Eng(FloatMatrix &answer, MatResponseMode rMode, IntegrationPoint *ip, TimeStep *tStep) override
Definition intelline1.h:95
void computeTransformationMatrixAt(GaussPoint *gp, FloatMatrix &answer) override
Definition intelline1.C:189
bool axisymmode
Flag controlling axisymmetric mode (integration over unit circumferential angle).
Definition intelline1.h:63
IntElLine2IntPen(int n, Domain *d)
IntElLine2(int n, Domain *d)
Definition intelline2.C:62
void computeNmatrixAt(GaussPoint *gp, FloatMatrix &answer) override
Definition intelline2.C:71
static FEI2dLineQuad interp
Definition intelline2.h:56
FEInterpolation * giveInterpolation() const override
Definition intelline2.C:114
FloatArray initialDisplacements
Initial displacement vector, describes the initial nodal displacements when element has been casted.
bool nlGeometry
Flag indicating if geometrical nonlinearities apply.
virtual void giveStiffnessMatrix_dTdj(FloatMatrix &answer, MatResponseMode rMode, IntegrationPoint *ip, TimeStep *tStep)
virtual void computeTraction(FloatArray &traction, IntegrationPoint *ip, const FloatArray &jump, TimeStep *tStep)
#define OOFEM_ERROR(...)
Definition error.h:79
GaussPoint IntegrationPoint
Definition gausspoint.h:272
#define PM_UPDATE_PARAMETER(_val, _pm, _ir, _componentnum, _paramkey, _prio)

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