OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
space3delementevaluator.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/3D/space3delementevaluator.h"
36 #include "../sm/CrossSections/structuralcrosssection.h"
37 #include "floatarray.h"
38 #include "floatmatrix.h"
39 #include "domain.h"
40 #include "node.h"
41 #include "element.h"
42 #include "gausspoint.h"
43 #include "gaussintegrationrule.h"
44 #include "matresponsemode.h"
45 #include "crosssection.h"
46 #include "mathfem.h"
47 #include "iga/iga.h"
48 
49 namespace oofem {
50 /* 3D Space Elements */
52 {
53  FloatArray N;
54  Element *element = this->giveElement();
55  FEInterpolation *interp = element->giveInterpolation();
56 
58 
59  answer.beNMatrixOf(N, 3);
60 }
61 
63 {
64  FloatMatrix d;
65  Element *element = this->giveElement();
66  FEInterpolation *interp = element->giveInterpolation();
67  // this uses FEInterpolation::nodes2coords - quite inefficient in this case (large num of dofmans)
69 
70 
71  answer.resize(6, d.giveNumberOfRows() * 3);
72  answer.zero();
73 
74  for ( int i = 1; i <= d.giveNumberOfRows(); i++ ) {
75  answer.at(1, i * 3 - 2) = d.at(i, 1);
76  answer.at(2, i * 3 - 1) = d.at(i, 2);
77  answer.at(3, i * 3 - 0) = d.at(i, 3);
78 
79  answer.at(4, 3 * i - 1) = d.at(i, 3);
80  answer.at(4, 3 * i - 0) = d.at(i, 2);
81 
82  answer.at(5, 3 * i - 2) = d.at(i, 3);
83  answer.at(5, 3 * i - 0) = d.at(i, 1);
84 
85  answer.at(6, 3 * i - 2) = d.at(i, 2);
86  answer.at(6, 3 * i - 1) = d.at(i, 1);
87  }
88 }
89 
91 {
92  double determinant = fabs( this->giveElement()->giveInterpolation()
93  ->giveTransformationJacobian( gp->giveNaturalCoordinates(),
95  gp->giveIntegrationRule()->giveKnotSpan() ) ) );
96  return determinant *gp->giveWeight();
97 }
98 
99 
101 {
102  static_cast< StructuralCrossSection * >( this->giveElement()->giveCrossSection() )->giveRealStress_3d(answer, gp, strain, tStep);
103 }
104 
105 
107 {
108  static_cast< StructuralCrossSection * >( this->giveElement()->giveCrossSection() )->giveStiffnessMatrix_3d(answer, rMode, gp, tStep);
109 }
110 } // end namespace oofem
CrossSection * giveCrossSection()
Definition: element.C:495
virtual void computeConstitutiveMatrixAt(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)
Computes constitutive matrix of receiver.
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates the array of interpolation functions (shape functions) at given point.
Abstract base class for all finite elements.
Definition: element.h:145
virtual const IntArray * giveKnotSpan()
Returns receiver sub patch indices (if apply).
MatResponseMode
Describes the character of characteristic material matrix.
virtual Element * giveElement()=0
virtual FEInterpolation * giveInterpolation() const
Definition: element.h:629
Class representing a general abstraction for finite element interpolation class.
Definition: feinterpol.h:132
virtual double giveWeight()
Returns integration weight of receiver.
Definition: gausspoint.h:181
virtual double computeVolumeAround(GaussPoint *gp)
#define N(p, q)
Definition: mdm.C:367
virtual void computeNMatrixAt(FloatMatrix &answer, GaussPoint *gp)
Assemble interpolation matrix at given IP In case of IGAElements, N is assumed to contain only nonzer...
virtual void computeStressVector(FloatArray &answer, const FloatArray &strain, GaussPoint *gp, TimeStep *tStep)
Computes the stress vector.
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
IntegrationRule * giveIntegrationRule()
Returns corresponding integration rule to receiver.
Definition: gausspoint.h:186
void beNMatrixOf(const FloatArray &n, int nsd)
Assigns the receiver to be a repeated diagonal matrix.
Definition: floatmatrix.C:505
Class representing vector of real numbers.
Definition: floatarray.h:82
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
Definition: floatmatrix.C:1358
void zero()
Zeroes all coefficient of receiver.
Definition: floatmatrix.C:1326
Geometry wrapper for IGA elements.
Definition: iga.h:57
Abstract base class for all structural cross section models.
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual void computeBMatrixAt(FloatMatrix &answer, GaussPoint *gp)
Assembles the strain-displacement matrix of the receiver at given integration point In case of IGAEle...
int giveNumberOfRows() const
Returns number of rows of receiver.
Definition: floatmatrix.h:156
Class representing integration point in finite element program.
Definition: gausspoint.h:93
Class representing solution step.
Definition: timestep.h:80
virtual double evaldNdx(FloatMatrix &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates the matrix of derivatives of interpolation functions (shape functions) at given point...
const FloatArray & giveNaturalCoordinates()
Returns coordinate array of receiver.
Definition: gausspoint.h:138

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:31 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011