OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
qbrick1_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 "qbrick1_ht.h"
36 #include "fei3dhexaquad.h"
37 #include "node.h"
38 #include "gausspoint.h"
39 #include "gaussintegrationrule.h"
40 #include "floatmatrix.h"
41 #include "floatarray.h"
42 #include "intarray.h"
43 #include "domain.h"
44 #include "mathfem.h"
45 #include "load.h"
46 #include "crosssection.h"
47 #include "classfactory.h"
48 
49 namespace oofem {
50 REGISTER_Element(QBrick1_ht);
51 REGISTER_Element(QBrick1_hmt);
52 
53 FEI3dHexaQuad QBrick1_ht :: interpolation;
54 
56 {
57  numberOfDofMans = 20;
59 }
60 
61 QBrick1_hmt :: QBrick1_hmt(int n, Domain *aDomain) : QBrick1_ht(n, aDomain)
62 {
64 }
65 
67 { }
68 
69 
72 
73 
74 void
76 // Sets up the array containing the four Gauss points of the receiver.
77 {
78  if ( integrationRulesArray.size() == 0 ) {
79  integrationRulesArray.resize( 1 );
80  integrationRulesArray [ 0 ].reset( new GaussIntegrationRule(1, this, 1, 2) );
82  }
83 }
84 
85 
88 {
91 }
92 
93 
94 double
96 // Returns the portion of the receiver which is attached to gp.
97 {
98  double determinant, weight, volume;
99  determinant = fabs( this->interpolation.giveTransformationJacobian( gp->giveNaturalCoordinates(),
100  FEIElementGeometryWrapper(this) ) );
101 
102  weight = gp->giveWeight();
103  volume = determinant * weight;
104  return volume;
105 }
106 
107 
108 double
110 {
111  double result = this->interpolation.edgeGiveTransformationJacobian( iEdge, gp->giveNaturalCoordinates(),
113  return result *gp->giveWeight();
114 }
115 
116 
119 {
120  IntegrationRule *iRule = new GaussIntegrationRule(1, this, 1, 1);
121  int npoints = iRule->getRequiredNumberOfIntegrationPoints(_Square, approxOrder);
122  iRule->SetUpPointsOnSquare(npoints, _Unknown);
123  return iRule;
124 }
125 
126 
127 double
129 {
130  double determinant, weight, volume;
132  weight = gp->giveWeight();
133  volume = determinant * weight;
134  return volume;
135 }
136 
137 
138 Interface *
140 {
141  if ( interface == SpatialLocalizerInterfaceType ) {
142  return static_cast< SpatialLocalizerInterface * >(this);
143  } else if ( interface == EIPrimaryFieldInterfaceType ) {
144  return static_cast< EIPrimaryFieldInterface * >(this);
145  } else if ( interface == ZZNodalRecoveryModelInterfaceType ) {
146  return static_cast< ZZNodalRecoveryModelInterface * >(this);
147  } else if ( interface == SPRNodalRecoveryModelInterfaceType ) {
148  return static_cast< SPRNodalRecoveryModelInterface * >(this);
149  }
150 
151  return NULL;
152 }
153 
154 void
156 {
157  pap.resize(numberOfDofMans);
158  for ( int i = 1; i <= numberOfDofMans; i++ ) {
159  pap.at(i) = this->giveNode(i)->giveNumber();
160  }
161 }
162 
163 void
165 {
166  int found = 0;
167  answer.resize(1);
168 
169  for ( int i = 1; i <= numberOfDofMans; i++ ) {
170  if ( this->giveNode(i)->giveNumber() == pap ) {
171  found = 1;
172  }
173  }
174 
175  if ( found ) {
176  answer.at(1) = pap;
177  } else {
178  OOFEM_ERROR("unknown node number %d", pap);
179  }
180 }
181 
182 int
184 {
185  return numberOfGaussPoints;
186 }
187 
188 
191 {
193 }
194 
195 } // end namespace oofem
CrossSection * giveCrossSection()
Definition: element.C:495
static FEI3dHexaQuad interpolation
Definition: qbrick1_ht.h:57
The element interface required by ZZNodalRecoveryModel.
Class and object Domain.
Definition: domain.h:115
virtual double giveTransformationJacobian(const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the determinant of the transformation.
Definition: feinterpol.C:43
QBrick1_ht(int n, Domain *d)
Definition: qbrick1_ht.C:55
The element interface required by ZZNodalRecoveryModel.
virtual int SetUpPointsOnSquare(int, MaterialMode mode)
Sets up receiver&#39;s integration points on unit square integration domain.
Class implementing an array of integers.
Definition: intarray.h:61
int & at(int i)
Coefficient access function.
Definition: intarray.h:103
virtual SPRPatchType SPRNodalRecoveryMI_givePatchType()
Definition: qbrick1_ht.C:190
Abstract base class representing integration rule.
virtual double computeEdgeVolumeAround(GaussPoint *gp, int iEdge)
Computes the length around a integration point on a edge.
Definition: qbrick1_ht.C:109
Class representing a general abstraction for finite element interpolation class.
Definition: feinterpol.h:132
Element interface class.
Definition: primaryfield.h:58
virtual double computeSurfaceVolumeAround(GaussPoint *gp, int iEdge)
Definition: qbrick1_ht.C:128
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: element.C:638
#define OOFEM_ERROR(...)
Definition: error.h:61
REGISTER_Element(LSpace)
virtual double giveWeight()
Returns integration weight of receiver.
Definition: gausspoint.h:181
QBrick1_hmt(int n, Domain *d)
Definition: qbrick1_ht.C:61
This abstract class represent a general base element class for transport problems.
Wrapper around element definition to provide FEICellGeometry interface.
Definition: feinterpol.h:95
Brick (3d) elements with quadratic approximation for heat and mass transfer.
Definition: qbrick1_ht.h:54
virtual void SPRNodalRecoveryMI_giveDofMansDeterminedByPatch(IntArray &answer, int pap)
Definition: qbrick1_ht.C:164
void resize(int n)
Checks size of receiver towards requested bounds.
Definition: intarray.C:124
virtual double edgeGiveTransformationJacobian(int iedge, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the edge jacobian of transformation between local and global coordinates.
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
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
virtual Interface * giveInterface(InterfaceType t)
Interface requesting service.
Definition: qbrick1_ht.C:139
Class representing the general Input Record.
Definition: inputrecord.h:101
virtual void SPRNodalRecoveryMI_giveSPRAssemblyPoints(IntArray &pap)
Definition: qbrick1_ht.C:155
virtual int getRequiredNumberOfIntegrationPoints(integrationDomain dType, int approxOrder)
Abstract service.
Class Interface.
Definition: interface.h:82
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 IntegrationRule * GetSurfaceIntegrationRule(int approxOrder)
Definition: qbrick1_ht.C:118
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual FEInterpolation * giveInterpolation() const
Definition: qbrick1_ht.C:71
int giveNumber() const
Definition: femcmpnn.h:107
Node * giveNode(int i) const
Returns reference to the i-th node of element.
Definition: element.h:610
virtual void computeGaussPoints()
Initializes the array of integration rules member variable.
Definition: qbrick1_ht.C:75
virtual double surfaceGiveTransformationJacobian(int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the edge jacobian of transformation between local and global coordinates.
virtual ~QBrick1_ht()
Definition: qbrick1_ht.C:66
Class representing integration point in finite element program.
Definition: gausspoint.h:93
virtual double computeVolumeAround(GaussPoint *gp)
Returns volume related to given integration point.
Definition: qbrick1_ht.C:95
int numberOfDofMans
Number of dofmanagers.
Definition: element.h:149
virtual int SPRNodalRecoveryMI_giveNumberOfIP()
Definition: qbrick1_ht.C:183
const FloatArray & giveNaturalCoordinates()
Returns coordinate array of receiver.
Definition: gausspoint.h:138
Class representing Gaussian-quadrature integration rule.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: qbrick1_ht.C:87

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