OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
tr1_ht.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 "tr1_ht.h"
36 #include "fei2dtrlin.h"
37 #include "crosssection.h"
38 #include "gausspoint.h"
39 #include "gaussintegrationrule.h"
40 #include "floatmatrix.h"
41 #include "floatarray.h"
42 #include "intarray.h"
43 #include "mathfem.h"
44 #include "classfactory.h"
45 
46 
47 namespace oofem {
48 REGISTER_Element(Tr1_ht);
49 REGISTER_Element(Tr1_hmt);
50 REGISTER_Element(Tr1_mt);
51 
52 FEI2dTrLin Tr1_ht :: interp(1, 2);
53 
54 Tr1_ht :: Tr1_ht(int n, Domain *aDomain) :
55  TransportElement(n, aDomain, HeatTransferEM), SpatialLocalizerInterface(this), ZZNodalRecoveryModelInterface(this)
56  // Constructor.
57 {
58  numberOfDofMans = 3;
60 }
61 
62 Tr1_hmt :: Tr1_hmt(int n, Domain *aDomain) : Tr1_ht(n, aDomain)
63 {
65 }
66 
67 Tr1_mt :: Tr1_mt(int n, Domain *aDomain) : Tr1_ht(n, aDomain)
68 {
70 }
71 
72 
74 Tr1_ht :: giveInterpolation() const { return & this->interp; }
75 
76 void
78 // Sets up the array containing the four Gauss points of the receiver.
79 {
80  if ( integrationRulesArray.size() == 0 ) {
81  integrationRulesArray.resize( 1 );
82  integrationRulesArray [ 0 ].reset( new GaussIntegrationRule(1, this, 1, 3) );
84  }
85 }
86 
87 
90 {
93 }
94 
95 
96 double
98 // Returns the portion of the receiver which is attached to gp.
99 {
100  double determinant, weight, volume;
101  determinant = fabs( this->interp.giveTransformationJacobian( gp->giveNaturalCoordinates(), FEIElementGeometryWrapper(this) ) );
102  weight = gp->giveWeight();
103  volume = determinant * weight * this->giveCrossSection()->give(CS_Thickness, gp);
104 
105  return volume;
106 }
107 
108 
109 double
111 {
112  return this->giveCrossSection()->give(CS_Thickness, gcoords, this, false);
113 }
114 
115 
116 double
118 {
119  double determinant = fabs( this->interp.edgeGiveTransformationJacobian( iEdge, gp->giveNaturalCoordinates(), FEIElementGeometryWrapper(this) ) );
120  FloatArray gc;
121  double thick = this->giveCrossSection()->give(CS_Thickness, gp->giveNaturalCoordinates(), NULL); // 't'
122  return determinant *thick *gp->giveWeight();
123 }
124 
125 
126 Interface *
128 {
129  if ( interface == SpatialLocalizerInterfaceType ) {
130  return static_cast< SpatialLocalizerInterface * >(this);
131  } else if ( interface == EIPrimaryFieldInterfaceType ) {
132  return static_cast< EIPrimaryFieldInterface * >(this);
133  } else if ( interface == ZZNodalRecoveryModelInterfaceType ) {
134  return static_cast< ZZNodalRecoveryModelInterface * >(this);
135  }
136 
137  return NULL;
138 }
139 
140 } // end namespace oofem
CrossSection * giveCrossSection()
Definition: element.C:495
Class and object Domain.
Definition: domain.h:115
The element interface required by ZZNodalRecoveryModel.
virtual double computeEdgeVolumeAround(GaussPoint *gp, int iEdge)
Computes the length around a integration point on a edge.
Definition: tr1_ht.C:117
virtual FEInterpolation * giveInterpolation() const
Definition: tr1_ht.C:74
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
virtual double edgeGiveTransformationJacobian(int iedge, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the edge Jacobian of transformation between local and global coordinates.
Definition: feinterpol2d.C:175
Triangle (2d) element with linear approximation for heat transfer.
Definition: tr1_ht.h:53
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: tr1_ht.C:89
Class representing a general abstraction for finite element interpolation class.
Definition: feinterpol.h:132
Element interface class.
Definition: primaryfield.h:58
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: element.C:638
REGISTER_Element(LSpace)
static FEI2dTrLin interp
Definition: tr1_ht.h:56
virtual double giveWeight()
Returns integration weight of receiver.
Definition: gausspoint.h:181
This abstract class represent a general base element class for transport problems.
Wrapper around element definition to provide FEICellGeometry interface.
Definition: feinterpol.h:95
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
virtual double giveThicknessAt(const FloatArray &gcoords)
Gives the thickness at some global coordinate.
Definition: tr1_ht.C:110
Class representing vector of real numbers.
Definition: floatarray.h:82
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
virtual double give(CrossSectionProperty a, GaussPoint *gp)
Returns the value of cross section property at given point.
Definition: crosssection.C:151
virtual double giveTransformationJacobian(const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the determinant of the transformation.
Definition: fei2dtrlin.C:147
Class representing the general Input Record.
Definition: inputrecord.h:101
Class Interface.
Definition: interface.h:82
virtual double computeVolumeAround(GaussPoint *gp)
Returns volume related to given integration point.
Definition: tr1_ht.C:97
virtual void computeGaussPoints()
Initializes the array of integration rules member variable.
Definition: tr1_ht.C:77
Tr1_ht(int n, Domain *d)
Definition: tr1_ht.C:54
The spatial localizer element interface associated to spatial localizer.
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
InterfaceType
Enumerative type, used to identify interface type.
Definition: interfacetype.h:43
virtual Interface * giveInterface(InterfaceType t)
Interface requesting service.
Definition: tr1_ht.C:127
the oofem namespace is to define a context or scope in which all oofem names are defined.
Class representing integration point in finite element program.
Definition: gausspoint.h:93
Tr1_hmt(int n, Domain *d)
Definition: tr1_ht.C:62
int numberOfDofMans
Number of dofmanagers.
Definition: element.h:149
Tr1_mt(int n, Domain *d)
Definition: tr1_ht.C:67
const FloatArray & giveNaturalCoordinates()
Returns coordinate array of receiver.
Definition: gausspoint.h:138
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:32 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011