OOFEM 3.0
Loading...
Searching...
No Matches
intelline1phf.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
38#include "node.h"
39#include "gausspoint.h"
41#include "floatmatrix.h"
42#include "floatarray.h"
43#include "intarray.h"
44#include "mathfem.h"
45#include "fei2dlinelin.h"
46#include "classfactory.h"
47#include "parametermanager.h"
48#include "paramkey.h"
49
50
51namespace oofem {
54
55FEI2dLineLin IntElLine1PhF :: interp(1, 1);
56
57
58IntElLine1PhF :: IntElLine1PhF(int n, Domain *aDomain) : StructuralInterfaceElementPhF(n, aDomain)
59{
62 this->axisymmode = false;
63}
64
65
66void
67IntElLine1PhF :: computeNmatrixAt(GaussPoint *ip, FloatMatrix &answer)
68{
69 // Returns the modified N-matrix which multiplied with u give the spatial jump.
73
74 answer.resize(2, 8);
75 answer.zero();
76 answer.at(1, 1) = answer.at(2, 2) = -N.at(1);
77 answer.at(1, 3) = answer.at(2, 4) = -N.at(2);
78
79 answer.at(1, 5) = answer.at(2, 6) = N.at(1);
80 answer.at(1, 7) = answer.at(2, 8) = N.at(2);
81}
82
83
84void
85IntElLine1PhF :: computeGaussPoints()
86{
87 if ( integrationRulesArray.size() == 0 ) {
88 integrationRulesArray.resize( 1 );
89 //integrationRulesArray[ 0 ] = std::make_unique<LobattoIntegrationRule>(1,domain, 1, 2);
90 integrationRulesArray [ 0 ] = std::make_unique<GaussIntegrationRule>(1, this, 1, 2);
91 integrationRulesArray [ 0 ]->SetUpPointsOnLine(this->numberOfGaussPoints, _2dInterface);
92 }
93}
94
96IntElLine1PhF :: computeCovarBaseVectorAt(IntegrationPoint *ip) const
97{
98 FloatMatrix dNdxi;
100 interp->evaldNdxi( dNdxi, ip->giveNaturalCoordinates(), FEIElementGeometryWrapper(this) );
102 int numNodes = this->giveNumberOfNodes();
103 for ( int i = 1; i <= dNdxi.giveNumberOfRows(); i++ ) {
104 double X1_i = 0.5 * ( this->giveNode(i)->giveCoordinate(1) + this->giveNode(i + numNodes / 2)->giveCoordinate(1) ); // (mean) point on the fictious mid surface
105 double X2_i = 0.5 * ( this->giveNode(i)->giveCoordinate(2) + this->giveNode(i + numNodes / 2)->giveCoordinate(2) );
106 G.at(1) += dNdxi.at(i, 1) * X1_i;
107 G.at(2) += dNdxi.at(i, 1) * X2_i;
108 }
109 return G;
110}
111
112
113double
114IntElLine1PhF :: computeAreaAround(IntegrationPoint *ip)
115{
116 auto G = this->computeCovarBaseVectorAt(ip);
117
118 double weight = ip->giveWeight();
119 double ds = norm(G) * weight;
120 if ( this->axisymmode ) {
121 int numNodes = this->giveNumberOfNodes();
123 this->interp.evalN( N, ip->giveNaturalCoordinates(), FEIElementGeometryWrapper(this) );
124 // interpolate radius
125 double r = 0.0;
126 for ( int i = 1; i <= N.giveSize(); i++ ) {
127 double X_i = 0.5 * ( this->giveNode(i)->giveCoordinate(1) + this->giveNode(i + numNodes / 2)->giveCoordinate(1) ); // X-coord of the fictious mid surface
128 r += N.at(i) * X_i;
129 }
130 return ds * r;
131 } else { // regular 2d
132 double thickness = this->giveCrossSection()->give(CS_Thickness, ip);
133 return ds * thickness;
134 }
135}
136
137
138void
139IntElLine1PhF :: initializeFrom(InputRecord &ir, int priority)
140{
141 StructuralInterfaceElement :: initializeFrom(ir, priority);
142 ParameterManager *ppm = this->giveDomain()->elementPPM;
144}
145
146
147void
148IntElLine1PhF :: giveDofManDofIDMask(int inode, IntArray &answer) const
149{
150 answer = {D_u, D_v, T_f};
151}
152
153void
154IntElLine1PhF :: computeTransformationMatrixAt(GaussPoint *gp, FloatMatrix &answer)
155{
156 // Transformation matrix to the local coordinate system
157 auto G = this->computeCovarBaseVectorAt(gp, G);
158 G /= norm(G);
159
160 answer.resize(2, 2);
161 answer.at(1, 1) = G.at(1);
162 answer.at(2, 1) = -G.at(2);
163 answer.at(1, 2) = G.at(2);
164 answer.at(2, 2) = G.at(1);
165
166}
167
169IntElLine1PhF :: giveInterpolation() const
170{
171 return & interp;
172}
173
174
175void
176IntElLine1PhF :: giveDofManDofIDMask_u(IntArray &answer)
177{
178 answer = {D_u, D_v};
179}
180
181void
182IntElLine1PhF :: giveDofManDofIDMask_d(IntArray &answer)
183{
184 // use temperature for now
185 answer = {T_f};
186}
187
188void
189IntElLine1PhF :: getLocationArray_u( IntArray &answer )
190{
191 answer = {1, 2, 4, 5, 7, 8, 10, 11};
192}
193void
194IntElLine1PhF :: getLocationArray_d( IntArray &answer )
195{
196 answer = {3, 6, 9, 12};
197}
198
199
200void
201IntElLine1PhF :: giveEngTraction(FloatArray &answer, GaussPoint *gp, const FloatArray &jump, const double damage, TimeStep *tStep)
202{
203 StructuralInterfaceMaterialPhF *mat = static_cast< StructuralInterfaceMaterialPhF * >( this->giveInterfaceCrossSection()->giveInterfaceMaterial() );
204 //double damage = this->computeDamageAt(gp, VM_Total, tStep);
205
206 //StructuralInterfaceMaterial *mat = this->giveInterfaceCrossSection()->giveInterfaceMaterial();
207 answer = mat->giveEngTraction_2d(jump, damage, gp, tStep);
208 //this->giveInterfaceCrossSection()->giveEngTraction_2d(answer, gp, jump, tStep);
209}
210
211
212void
214{
215 auto G1 = this->computeCovarBaseVectorAt(gp);
216
217 G.resize(2, 1);
218 G.at(1, 1) = G1.at(1);
219 G.at(2, 1) = G1.at(2);
220}
221
222
223} // end 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
std::vector< std ::unique_ptr< IntegrationRule > > integrationRulesArray
Definition element.h:157
int numberOfGaussPoints
Definition element.h:175
CrossSection * giveCrossSection()
Definition element.C:534
Domain * giveDomain() const
Definition femcmpnn.h:97
int number
Component number.
Definition femcmpnn.h:77
double & at(std::size_t i)
void resize(Index rows, Index cols)
Definition floatmatrix.C:79
void zero()
Zeroes all coefficient of receiver.
int giveNumberOfRows() const
Returns number of rows of receiver.
double at(std::size_t i, std::size_t j) const
const FloatArray & giveNaturalCoordinates() const
Returns coordinate array of receiver.
Definition gausspoint.h:138
double giveWeight()
Returns integration weight of receiver.
Definition gausspoint.h:180
static FEI2dLineLin interp
static ParamKey IPK_IntElLine1PhF_axisymmode
FloatArrayF< 2 > computeCovarBaseVectorAt(GaussPoint *gp) const
FEInterpolation * giveInterpolation() const override
void computeCovarBaseVectorsAt(GaussPoint *gp, FloatMatrix &G) override
bool axisymmode
Flag controlling axisymmetric mode (integration over unit circumferential angle).
StructuralInterfaceCrossSection * giveInterfaceCrossSection()
virtual FloatArrayF< 2 > giveEngTraction_2d(const FloatArrayF< 2 > &jump, double damage, GaussPoint *gp, TimeStep *tStep) const
double norm(const FloatArray &x)
@ CS_Thickness
Thickness.
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