xc
BrickBase.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // XC program; finite element analysis code
4 // for structural analysis and design.
5 //
6 // Copyright (C) Luis C. Pérez Tato
7 //
8 // This program derives from OpenSees <http://opensees.berkeley.edu>
9 // developed by the «Pacific earthquake engineering research center».
10 //
11 // Except for the restrictions that may arise from the copyright
12 // of the original program (see copyright_opensees.txt)
13 // XC is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU General Public License as published by
15 // the Free Software Foundation, either version 3 of the License, or
16 // (at your option) any later version.
17 //
18 // This software is distributed in the hope that it will be useful, but
19 // WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU General Public License for more details.
22 //
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program.
26 // If not, see <http://www.gnu.org/licenses/>.
27 //----------------------------------------------------------------------------
28 //BrickBase.h
29 
30 #ifndef BrickBase_h
31 #define BrickBase_h
32 
33 #include <domain/mesh/element/ElemWithMaterial.h>
34 #include "domain/mesh/element/utils/physical_properties/NDMaterialPhysicalProperties.h"
35 
36 namespace XC {
37 class NDMaterial;
38 class ParticlePos3d;
39 class BrickRawLoad;
40 
41 // hexahedron
42 //
43 // s
44 // /
45 // t /
46 // | 5---------4
47 // |/. /|
48 // / . / |
49 // / . / |
50 // 6---------7 |
51 // | . | |
52 // | 1.....|...0
53 // | . | /
54 // | . | /--- r
55 // |. |/
56 // 2---------3
57 //
58 // Inverse mapping code taken from the file trilinearintepolator.c
59 // created by Dirk-Philip van Herwaarden on 4/21/17.
60 
61 
65 //
67 //
69 class BrickBase: public ElemWithMaterial<8,NDMaterialPhysicalProperties>
70  {
71  public:
72  static const int numberNodes= 8;
73  static const int ndm= 3;
74  static const int ndf= 3;
75  static const double mNodesR[];
76  static const double mNodesS[];
77  static const double mNodesT[];
78  private:
79  static Matrix &compute_extrapolation_matrix(void);
80  protected:
81  //local nodal coordinates, three coordinates for each of eight nodes
82  static double xl[ndm][numberNodes];
83  ElemPtrArray3d put_on_mesh(const NodePtrArray3d &,meshing_dir dm) const;
84  void computeBasis(void) const; //compute coordinate system
85  public:
86  BrickBase(int classTag);
87  BrickBase(int tag,int classTag,const NDMaterialPhysicalProperties &);
88  BrickBase(int tag, int classTag,int nd1, int nd2, int nd3, int nd4,int nd5,int nd6,int nd7,int nd8, const NDMaterialPhysicalProperties &);
89  size_t getDimension(void) const;
90  double getVolume(bool initialGeometry= true) const;
91  BoolArray3d getNodePattern(void) const;
92  int getVtkCellType(void) const;
93 
94  const BrickRawLoad *vector3dRawLoadLocal(const std::vector<Vector> &);
95  const BrickRawLoad *vector3dRawLoadGlobal(const std::vector<Vector> &);
96  void zeroLoad(void);
97  int addLoad(ElementalLoad *theLoad, double loadFactor);
98 
99  Matrix getLocalAxes(bool initialGeometry= true) const;
100  Pos3d getGlobalCoordinates(const double &r, const double &s, const double &t) const;
101  ParticlePos3d getNaturalCoordinates(const Pos3d &, bool initialGeometry= true) const;
102  const Matrix &getExtrapolationMatrix(void) const;
103  };
104 
105 } // end of XC namespace
106 #endif
double getVolume(bool initialGeometry=true) const
Return the element volume.
Definition: BrickBase.cc:71
Natural coordinates of an element&#39;s particle.
Definition: ParticlePos3d.h:41
Base class for grids of bool in 3D (used to express if something exists or not in a (layer...
Definition: BoolArray3d.h:34
void zeroLoad(void)
Zeroes loads on element.
Definition: BrickBase.cc:537
ParticlePos3d getNaturalCoordinates(const Pos3d &, bool initialGeometry=true) const
Return the natural coordinates that correspond to the given position.
Definition: BrickBase.cc:519
Base class for hexahedral elements.
Definition: BrickBase.h:69
static const double mNodesS[]
Natural coordinates of nodes (s)
Definition: BrickBase.h:76
ElemPtrArray3d put_on_mesh(const NodePtrArray3d &, meshing_dir dm) const
Put the element on the mesh being passed as parameter.
Definition: BrickBase.cc:109
BrickBase(int classTag)
Constructor.
Definition: BrickBase.cc:49
static const double mNodesR[]
Natural coordinates of nodes (r)
Definition: BrickBase.h:75
Three-dimensional array of pointers to elements.
Definition: ElemPtrArray3d.h:47
const BrickRawLoad * vector3dRawLoadLocal(const std::vector< Vector > &)
Defines a load over the element from a vector of nodal loads in local coordinates.
Definition: BrickBase.cc:578
void computeBasis(void) const
compute local coordinates and basis
Definition: BrickBase.cc:463
static const int ndf
Number of DOFs per node.
Definition: BrickBase.h:74
BoolArray3d getNodePattern(void) const
Return a grid of booleans, one for each of the element nodes.
Definition: BrickBase.cc:102
const BrickRawLoad * vector3dRawLoadGlobal(const std::vector< Vector > &)
Defines a load over the element from a vector of nodal loads in global coordinates.
Definition: BrickBase.cc:623
static const int numberNodes
Number of nodes.
Definition: BrickBase.h:72
Physical properties for solid mechanics.
Definition: NDMaterialPhysicalProperties.h:40
const Matrix & getExtrapolationMatrix(void) const
Return the matrix that can be used to extrapolate the results from the Gauss points to the element no...
Definition: BrickBase.cc:242
static const double mNodesT[]
Natural coordinates of nodes (t)
Definition: BrickBase.h:77
static const int ndm
Space dimension.
Definition: BrickBase.h:73
Posición en tres dimensiones.
Definition: Pos3d.h:44
Three-dimensional array of pointers to nodes.
Definition: NodePtrArray3d.h:51
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Element with material.
Definition: ElemWithMaterial.h:45
Matrix of floats.
Definition: Matrix.h:111
Matrix getLocalAxes(bool initialGeometry=true) const
Return the element local axes.
Definition: BrickBase.cc:476
Base class for loads over elements.
Definition: ElementalLoad.h:79
int getVtkCellType(void) const
Interfaz con VTK.
Definition: BrickBase.cc:205
size_t getDimension(void) const
Return the element dimension (0, 1, 2 o3 3).
Definition: BrickBase.cc:67
int addLoad(ElementalLoad *theLoad, double loadFactor)
Adds to the element the load being passed as parameter.
Definition: BrickBase.cc:543
Uniform load over brick elements.
Definition: BrickRawLoad.h:40