xc
TwentyNodeBrick.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 //----------------------------------------------------------------------------
29 //
30 // COPYRIGHT (C): :-))
31 // PROJECT: Object Oriented Finite Element Program
32 // FILE: TwentyNodeBrick.h
33 // CLASS: TwentyNodeBrick
34 // MEMBER FUNCTIONS:
35 //
36 // MEMBER VARIABLES
37 //
38 // PURPOSE: Finite Element Class
39 // RETURN:
40 // VERSION:
41 // LANGUAGE: C++.ver >= 3.0
42 // TARGET OS: DOS || UNIX || . . .
43 // DESIGNER: Boris Jeremic, Zhaohui Yang and Xiaoyan Wu
44 // PROGRAMMER: Boris Jeremic, Zhaohui Yang and Xiaoyan Wu
45 // DATE: Aug. 2001
46 // UPDATE HISTORY:
47 //
49 //
50 
51 
52 
53 #ifndef TWENTYNODEBRICK_H
54 #define TWENTYNODEBRICK_H
55 
56 #include <domain/mesh/element/ElementBase.h>
57 #include "domain/mesh/element/utils/body_forces/BodyForces3D.h"
58 
59 
60 
61 namespace XC {
62 class Node;
63  class MatPoint3D;
64  class BJtensor;
65  class NDMaterial;
66 
70 class TwentyNodeBrick: public ElementBase<20>
71  {
72  private:
73  // private attributes - a copy for each object of the class
74 
75  int numDOF;
76 
77  Matrix *Ki;
78 
79  static Matrix K; // Element stiffness Matrix
80  static Matrix C; // Element damping matrix
81  static Matrix M; // Element mass matrix
82  static Vector P; // Element resisting force vector
83  BodyForces3D bf;
84 
85  // double thickness; // Element thickness
86  double rho; // Mass per unit volume DO WE GET THIS ONE OUT!!!
87  double pressure; // Normal surface traction (pressure) over entire element
88  int order; // Order of the quadrature rule
89 
90  //Matrix J; // Jacobian of transformation
91  //Matrix L; // Inverse of J
92  //Matrix B; // Strain interpolation matrix
93 
94 
95  private:
96 
97  double determinant_of_Jacobian;
98 
99  NDMaterial * mmodel; // pointer to GLOBAL material models
100 
101  int r_integration_order; // Gauss-Legendre integration order in r direction
102  int s_integration_order; // Gauss-Legendre integration order in s direction
103  int t_integration_order; // Gauss-Legendre integration order in t direction
104 
105  // Now I want 3D array of Material points!
106  // MatPoint3D[r_integration_order][s_integration_order][t_integration_order]
107  // 3D array of Material points
108  MatPoint3D ** matpoint; // pointer to array of Material Points
109 
110  // this is LM array. This array holds DOFs for this element
111  //int LM[60]; // for 20noded x 3 = 60
112  public:
113 
114  void incremental_Update(void);
115  //void iterative_Update(void);
116 
117  static BJtensor H_3D(double r1, double r2, double r3);
118  BJtensor interp_poli_at(double r, double s, double t);
119  static BJtensor dh_drst_at(double r, double s, double t);
120 
121 
122  TwentyNodeBrick & operator[](int subscript);
123 
124  BJtensor getStiffnessTensor(void) const;
125 
126  void set_strain_stress_tensor(FILE *fp, double * u);
127  BJtensor getMassTensor(void) const;
128 
129  BJtensor Jacobian_3D(const BJtensor &dh) const;
130  BJtensor Jacobian_3Dinv(const BJtensor &dh) const;
131  BJtensor Nodal_Coordinates(void) const;
132 
133  BJtensor incr_disp(void) const;
134  BJtensor total_disp(void) const;
135 
136  BJtensor total_disp(FILE *fp, double * u);
137 
138  BJtensor stiffness_matrix(const BJtensor &);
139  BJtensor mass_matrix(const BJtensor &);
140 
141 
142  int get_global_number_of_node(int local_node_number);
143  int get_Brick_Number(void);
144 
145 
146  //int * get_LM(void);
147  //void set_LM(Node * node); // commented out temporarily 09-27-2000 Zhaohui
148 
149  //these two files are originally in fe.h
150  static double get_Gauss_p_c(short order, short point_numb);
151  static double get_Gauss_p_w(short order, short point_numb);
152 
153  // returns nodal forces for given stress field in an element
154  BJtensor nodal_forces(void) const;
155  // returns nodal forces for ITERATIVE stress field in an element
156  BJtensor iterative_nodal_forces(void) const;
157  // returns nodal forces for given constant stress field in the element
158  BJtensor nodal_forces_from_stress(stresstensor &) const;
159  // returns nodal forces for given incremental strain field in an element
160  // by using the linearized constitutive tensor from the beginning of the step !
161  BJtensor linearized_nodal_forces(void) const;
162 
163  // updates Material point stresses and strains from given displacements
164  BJtensor update_stress_strain(BJtensor &disp);
165 
166  void report(const std::string &);
167  void reportshort(const std::string &);
168  void reportPAK(const std::string &);
169  void reportpqtheta(int);
170  //void reportLM(const std::string &);
171  void computeGaussPoint(void);
172  void reportCIPIC(const std::string &);
173  void reportTensorF(FILE *);
174  Vector getWeightofGP(void);
175 
176 
177  // Setting initial E according to the initial pressure
178  //void setInitE(void);
179  //void reportStressTensorF(FILE *);
180  public:
181  TwentyNodeBrick(int element_number,
182  int node_numb_1, int node_numb_2, int node_numb_3, int node_numb_4,
183  int node_numb_5, int node_numb_6, int node_numb_7, int node_numb_8,
184  int node_numb_9, int node_numb_10, int node_numb_11, int node_numb_12,
185  int node_numb_13, int node_numb_14, int node_numb_15, int node_numb_16,
186  int node_numb_17, int node_numb_18, int node_numb_19, int node_numb_20,
187  NDMaterial * Globalmmodel, const BodyForces3D &bForces, double r, double p);
188 
189  TwentyNodeBrick(void);
190  Element *getCopy(void) const;
191  ~TwentyNodeBrick(void);
192 
193  int getNumDOF(void) const;
194  void setDomain(Domain *theDomain);
195 
196  // public methods to set the state of the element
197  int commitState(void);
198  int revertToLastCommit(void);
199  int revertToStart(void);
200 
201  // update, Guanzhou added Apr. 2004 to update incremental strain in the domain
202  int update(void);
203 
204  // public methods to obtain stiffness, mass, damping and residual information
205  // We haven't build the following functions.
206  // All the value of K M Dmp and F are nothing.
207  const Matrix &getTangentStiff(void) const;
208  const Matrix &getInitialStiff(void) const;
209  const Matrix &getMass(void) const;
210 
211  const Matrix &getConsMass(void) const;
212  const Matrix &getLumpedMass(void) const;
213 
214  void alive(void);
215  int addLoad(ElementalLoad *theLoad, double loadFactor);
216  //int addLoad(const Vector &addP);
217  int addInertiaLoadToUnbalance(const Vector &accel);
218  const Vector FormEquiBodyForce(void);
219  const Vector &getResistingForce(void) const;
220  const Vector &getResistingForceIncInertia(void) const;
221 
222  virtual int sendSelf(Communicator &);
223  virtual int recvSelf(const Communicator &);
224 
225  void Print(std::ostream &s, int flag =0) const;
226  // Do nothing with void Print(std::ostream &s, int flag =0);
227  // use Brick3D report. 08/16/00
228  Response *setResponse(const std::vector<std::string> &argv, Information &eleInformation);
229  int getResponse(int responseID, Information &eleInformation);
230 };
231 } // end of XC namespace
232 
233 
234 #endif
235 
void setDomain(Domain *theDomain)
Sets the domain for the element.
Definition: TwentyNodeBrick.cpp:2503
int commitState(void)
Commit the current element state.
Definition: TwentyNodeBrick.cpp:2510
Float vector abstraction.
Definition: Vector.h:94
void Print(std::ostream &s, int flag=0) const
Print stuff.
Definition: TwentyNodeBrick.cpp:3344
Stress tensor.
Definition: stresst.h:70
Information about an element.
Definition: Information.h:81
Communication parameters between processes.
Definition: Communicator.h:66
Base class response objects.
Definition: Response.h:81
virtual int sendSelf(Communicator &)
Send the object.
Definition: TwentyNodeBrick.cpp:3329
Boris Jeremic tensor class.
Definition: BJtensor.h:112
int getNumDOF(void) const
return the number of DOF associated with the element.
Definition: TwentyNodeBrick.cpp:2497
Base class for the finite elements.
Definition: Element.h:112
Element * getCopy(void) const
Virtual constructor.
Definition: TwentyNodeBrick.cpp:208
Body forces over an element.
Definition: BodyForces3D.h:40
const Matrix & getMass(void) const
Returns the mass matrix.
Definition: TwentyNodeBrick.cpp:2767
int revertToLastCommit(void)
Revert to the last committed state.
Definition: TwentyNodeBrick.cpp:2640
void alive(void)
Reactivates the element.
Definition: TwentyNodeBrick.cpp:2805
Response * setResponse(const std::vector< std::string > &argv, Information &eleInformation)
setResponse() is a method invoked to determine if the element will respond to a request for a certain...
Definition: TwentyNodeBrick.cpp:3404
int getResponse(int responseID, Information &eleInformation)
Obtain information from an analysis.
Definition: TwentyNodeBrick.cpp:3471
const Matrix & getTangentStiff(void) const
Return the tangent stiffness matrix.
Definition: TwentyNodeBrick.cpp:2690
Twenty node hexahedral element for three-dimensional problems.
Definition: TwentyNodeBrick.h:70
Base class for 2D and 3D materials.
Definition: NDMaterial.h:101
int update(void)
Updates the element state.
Definition: TwentyNodeBrick.cpp:4455
Integration point on three-dimensional space.
Definition: MatPoint3D.h:67
const Vector & getResistingForceIncInertia(void) const
Returns the resisting force vector including inertia forces.
Definition: TwentyNodeBrick.cpp:3212
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Base class for finite element with pointer to nodes container.
Definition: ElementBase.h:47
static BJtensor dh_drst_at(double r, double s, double t)
Definition: TwentyNodeBrick.cpp:510
Matrix of floats.
Definition: Matrix.h:111
Base class for loads over elements.
Definition: ElementalLoad.h:79
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:117
const Vector & getResistingForce(void) const
Returns the resisting force vector for the element.
Definition: TwentyNodeBrick.cpp:3188
int revertToStart(void)
Reverts the element to its initial state.
Definition: TwentyNodeBrick.cpp:2665
virtual int recvSelf(const Communicator &)
Receive the object.
Definition: TwentyNodeBrick.cpp:3336