OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
qtruss1dgrad.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 - 2013 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 "../sm/Elements/Bars/qtruss1dgrad.h"
36 #include "fei1dlin.h"
37 #include "fei1dquad.h"
38 #include "gausspoint.h"
39 #include "gaussintegrationrule.h"
40 #include "floatmatrix.h"
41 #include "floatarray.h"
42 #include "intarray.h"
43 #include "../sm/CrossSections/structuralcrosssection.h"
44 #include "classfactory.h"
45 
46 #ifdef __OOFEG
47  #include "oofeggraphiccontext.h"
48 #endif
49 
50 namespace oofem {
51 REGISTER_Element(QTruss1dGrad);
52 
54 
55 QTruss1dGrad :: QTruss1dGrad(int n, Domain *aDomain) : QTruss1d(n, aDomain), GradDpElement()
56  // Constructor.
57 {
58  nPrimNodes = 3;
59  nPrimVars = 1;
60  nSecNodes = 2;
61  nSecVars = 1;
65 }
66 
67 
68 void
70 {
71  if ( inode < 3 ) {
72  answer = {D_u, G_0};
73  } else {
74  answer = {D_u};
75  }
76 }
77 
78 
81 {
83 }
84 
85 
86 void
88 {
89  this->giveStructuralCrossSection()->giveStiffnessMatrix_1d(answer, rMode, gp, tStep);
90 }
91 
92 
93 void
95 {
96  integrationRulesArray.resize( 1 );
97  integrationRulesArray [ 0 ].reset( new GaussIntegrationRule(1, this, 1, 1) );
99 }
100 
101 
102 void
104 {
105  GradDpElement :: computeStiffnessMatrix(answer, rMode, tStep);
106 }
107 
108 
109 void
110 QTruss1dGrad :: giveInternalForcesVector(FloatArray &answer, TimeStep *tStep, int useUpdatedGpRecord)
111 {
112  GradDpElement :: giveInternalForcesVector(answer, tStep, useUpdatedGpRecord);
113 }
114 
115 
116 void
118 {
120 }
121 
122 
123 void
125 {
126  FloatMatrix dnx;
128  answer.beTranspositionOf(dnx);
129 }
130 
131 void QTruss1dGrad :: computeField(ValueModeType mode, TimeStep* tStep, const FloatArray& lcoords, FloatArray& answer)
132 {
133  FloatArray n, unknown;
134  this->interpolation_lin.evalN( n, lcoords, FEIElementGeometryWrapper(this) );
135  this->computeVectorOf({D_u}, mode, tStep, unknown);
136  answer.at(1) = n.dotProduct(unknown);
137 
138  this->interpolation.evalN( n, lcoords, FEIElementGeometryWrapper(this) );
139  this->computeVectorOf({G_0}, mode, tStep, unknown);
140  answer.at(2) = n.dotProduct(unknown);
141 }
142 
143 }
CrossSection * giveCrossSection()
Definition: element.C:495
virtual void computeField(ValueModeType mode, TimeStep *tStep, const FloatArray &lcoords, FloatArray &answer)
Computes the unknown vector interpolated at the specified local coordinates.
Definition: qtruss1dgrad.C:131
virtual void computeNkappaMatrixAt(GaussPoint *gp, FloatArray &answer)
Definition: qtruss1dgrad.C:117
Class and object Domain.
Definition: domain.h:115
void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer)
Returns local vector of unknowns.
Definition: element.C:86
void computeStiffnessMatrix(FloatMatrix &, MatResponseMode, TimeStep *)
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
Definition: valuemodetype.h:78
void giveInternalForcesVector(FloatArray &answer, TimeStep *tStep, int useUpdatedGpRecord)
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the array of interpolation functions (shape functions) at given point.
Definition: fei1dlin.C:48
Class implementing an array of integers.
Definition: intarray.h:61
MatResponseMode
Describes the character of characteristic material matrix.
Abstract class for gradient formulation of coupled damage-plasticity model(GradDp).
Definition: graddpelement.h:48
virtual double evaldNdx(FloatMatrix &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the matrix of derivatives of interpolation functions (shape functions) at given point...
Definition: fei1dlin.C:58
virtual void giveDofManDofIDMask(int inode, IntArray &answer) const
Returns dofmanager dof mask for node.
Definition: qtruss1dgrad.C:69
virtual void computeBkappaMatrixAt(GaussPoint *gp, FloatMatrix &answer)
Definition: qtruss1dgrad.C:124
double dotProduct(const FloatArray &x) const
Computes the dot product (or inner product) of receiver and argument.
Definition: floatarray.C:463
REGISTER_Element(LSpace)
StructuralCrossSection * giveStructuralCrossSection()
Helper function which returns the structural cross-section for the element.
Wrapper around element definition to provide FEICellGeometry interface.
Definition: feinterpol.h:95
virtual void computeStiffnessMatrix(FloatMatrix &answer, MatResponseMode rMode, TimeStep *tStep)
Computes the stiffness matrix of receiver.
Definition: qtruss1dgrad.C:103
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the array of interpolation functions (shape functions) at given point.
Definition: fei1dquad.C:42
static FEI1dQuad interpolation
Definition: qtruss1d.h:52
virtual int setupIntegrationPoints(IntegrationRule &irule, int npoints, Element *element)
Sets up integration rule for the given element.
Definition: crosssection.C:54
int numberOfGaussPoints
Number of integration points as specified by nip.
Definition: element.h:188
Class representing vector of real numbers.
Definition: floatarray.h:82
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
virtual void computeGaussPoints()
Initializes the array of integration rules member variable.
Definition: qtruss1dgrad.C:94
This class implements a three-node truss bar element for one-dimensional analysis.
Definition: qtruss1d.h:49
Class representing the general Input Record.
Definition: inputrecord.h:101
virtual void giveInternalForcesVector(FloatArray &answer, TimeStep *tStep, int useUpdatedGpRecord=0)
Evaluates nodal representation of real internal forces.
Definition: qtruss1dgrad.C:110
void beTranspositionOf(const FloatMatrix &src)
Assigns to the receiver the transposition of parameter.
Definition: floatmatrix.C:323
std::vector< std::unique_ptr< IntegrationRule > > integrationRulesArray
List of integration rules of receiver (each integration rule contains associated integration points a...
Definition: element.h:170
virtual void computeConstitutiveMatrixAt(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)
Computes constitutive matrix of receiver.
Definition: qtruss1dgrad.C:87
virtual void giveStiffnessMatrix_1d(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)=0
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Class representing integration point in finite element program.
Definition: gausspoint.h:93
Class representing solution step.
Definition: timestep.h:80
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: qtruss1dgrad.C:80
const FloatArray & giveNaturalCoordinates()
Returns coordinate array of receiver.
Definition: gausspoint.h:138
static FEI1dLin interpolation_lin
Definition: qtruss1dgrad.h:53
QTruss1dGrad(int n, Domain *d)
Definition: qtruss1dgrad.C:55
Class representing Gaussian-quadrature integration rule.

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:30 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011