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 
40 // hexahedron
41 //
42 // s
43 // /
44 // t /
45 // | 5---------4
46 // |/. /|
47 // / . / |
48 // / . / |
49 // 6---------7 |
50 // | . | |
51 // | 1.....|...0
52 // | . | /
53 // | . | /--- r
54 // |. |/
55 // 2---------3
56 //
57 // Inverse mapping code taken from the file trilinearintepolator.c
58 // created by Dirk-Philip van Herwaarden on 4/21/17.
59 
60 
64 //
66 //
68 class BrickBase: public ElemWithMaterial<8,NDMaterialPhysicalProperties>
69  {
70  public:
71  static const int numberNodes= 8;
72  static const int ndm= 3;
73  static const int ndf= 3;
74  static const double mNodesR[];
75  static const double mNodesS[];
76  static const double mNodesT[];
77  private:
78  static Matrix &compute_extrapolation_matrix(void);
79  protected:
80  //local nodal coordinates, three coordinates for each of eight nodes
81  static double xl[ndm][numberNodes];
82  ElemPtrArray3d put_on_mesh(const NodePtrArray3d &,meshing_dir dm) const;
83  void computeBasis(void) const; //compute coordinate system
84  public:
85  BrickBase(int classTag);
86  BrickBase(int tag,int classTag,const NDMaterialPhysicalProperties &);
87  BrickBase(int tag, int classTag,int nd1, int nd2, int nd3, int nd4,int nd5,int nd6,int nd7,int nd8, const NDMaterialPhysicalProperties &);
88  size_t getDimension(void) const;
89  double getVolume(bool initialGeometry= true) const;
90  BoolArray3d getNodePattern(void) const;
91  int getVtkCellType(void) const;
92 
93  ElementalLoad *vector3dRawLoadLocal(const std::vector<Vector> &);
94  ElementalLoad *vector3dRawLoadGlobal(const std::vector<Vector> &);
95  void zeroLoad(void);
96  int addLoad(ElementalLoad *theLoad, double loadFactor);
97 
98  Matrix getLocalAxes(bool initialGeometry= true) const;
99  Pos3d getGlobalCoordinates(const double &r, const double &s, const double &t) const;
100  ParticlePos3d getNaturalCoordinates(const Pos3d &, bool initialGeometry= true) const;
101  const Matrix &getExtrapolationMatrix(void) const;
102  };
103 
104 } // end of XC namespace
105 #endif
ElementalLoad * vector3dRawLoadGlobal(const std::vector< Vector > &)
Defines a load over the element from a vector of nodal loads in global coordinates.
Definition: BrickBase.cc:623
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:68
static const double mNodesS[]
Natural coordinates of nodes (s)
Definition: BrickBase.h:75
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:74
Three-dimensional array of pointers to elements.
Definition: ElemPtrArray3d.h:47
void computeBasis(void) const
compute local coordinates and basis
Definition: BrickBase.cc:463
ElementalLoad * vector3dRawLoadLocal(const std::vector< Vector > &)
Defines a load over the element from a vector of nodal loads in local coordinates.
Definition: BrickBase.cc:578
static const int ndf
Number of DOFs per node.
Definition: BrickBase.h:73
BoolArray3d getNodePattern(void) const
Return a grid of booleans, one for each of the element nodes.
Definition: BrickBase.cc:102
static const int numberNodes
Number of nodes.
Definition: BrickBase.h:71
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:76
static const int ndm
Space dimension.
Definition: BrickBase.h:72
Posición en tres dimensiones.
Definition: Pos3d.h:44
Three-dimensional array of pointers to nodes.
Definition: NodePtrArray3d.h:53
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