xc
EightNodeBrick.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 // COPYLEFT (C): :-))
31 //``This source code is Copyrighted in U.S., by the The Regents of the University
32 //of California, for an indefinite period, and anybody caught using it without our
33 //permission, will be mighty good friends of ourn, cause we don't give a darn.
34 //Hack it. Compile it. Debug it. Run it. Yodel it. Enjoy it. We wrote it, that's
35 //all we wanted to do.'' bj
36 // PROJECT: Object Oriented Finite Element Program
37 // FILE: EightNodeBrick.h
38 // CLASS: EightNodeBrick
39 // MEMBER FUNCTIONS:
40 //
41 // MEMBER VARIABLES
42 //
43 // PURPOSE: Finite Element Class
44 // RETURN:
45 // VERSION:
46 // LANGUAGE: C++.ver >= 3.0
47 // TARGET OS: DOS || UNIX || . . .
48 // DESIGNER: Boris Jeremic, Zhaohui Yang and Xiaoyan Wu
49 // PROGRAMMER: Boris Jeremic, Zhaohui Yang and Xiaoyan Wu
50 // DATE: Aug. 2000
51 // UPDATE HISTORY: Modified from Brick3D and FourNodeQuad.hh 07/06/00
52 // Sept. - Oct 2000 connected to OpenSees by Zhaohui
53 // Sept 2001 optimized to some extent (static tensors...)
54 //
56 //
57 
58 
59 #ifndef EIGHTNODEBRICK_H
60 #define EIGHTNODEBRICK_H
61 
62 // Commented by Xiaoyan. Use ~/fem/node.hh 08/04/00
63 // Released Node.h now. Wu use Opensees's Node.09/27/00
64 
65 
66 #include <domain/mesh/element/ElementBase.h>
67 #include <utility/matrix/Matrix.h>
68 #include <utility/matrix/Vector.h>
69 #include "domain/mesh/element/utils/body_forces/BodyForces3D.h"
70 
71 namespace XC {
72 class Node;
73 class NDMaterial;
74 class MatPoint3D;
75 class stresstensor;
76 class Information;
77 class BJtensor;
78 //class QuadRule1d;
79 
83 class EightNodeBrick: public ElementBase<8>
84  {
85  private:
86  int numDOF;
87 
88  mutable Matrix *Ki;
89 
90  static Matrix K;
91  static Matrix C;
92  static Matrix M;
93  static Vector P;
94  BodyForces3D bf;
95 
96  //Vector q0; //!< hold element load affects q0 and p0 in one vector
97 
98  double rho;
99  double pressure;
100  int order;
101 
102  //int dir; //!< Direction of vertical coord.
103  //double surflevel; //!< free surface level above or below this element
104 
105  //QuadRule1d *theQuadRule; //!< Integration rule
106 
107 // Matrix J; //!< Jacobian of transformation
108 // Matrix L; //!< Inverse of J
109 // Matrix B; //!< Strain interpolation matrix
110 
111 
112  // // static data - single copy for all objects of the class
113  // static G3Matrix N; //!< Displacement interpolation matrix
114 
115  // // private member functions - only objects of this class can call these
116  // void setJacobian (double r, double s, double t); //!< Xiaoyan changed
117  // double formDetJ (double r, double s, double t); //!< xi, eta to r and s
118  // void formBMatrix (double r, double s, double t); //!< and added t
119  // static void formNMatrix (double r, double s, double t); //!< 07/06/00
120 
121  private:
122  // element number (tag)
123  //unsigned int elem_numb;
124 
125  double determinant_of_Jacobian;
126  //int G_N_numbs[8]; //!< Global node numbers for this element Xiaoyan changed from 20 to 8
127 
128  NDMaterial *mmodel;
129 
130  int r_integration_order;
131  int s_integration_order;
132  int t_integration_order;
133 
134  // Now I want 3D array of Material points!
135  // MatPoint3D[r_integration_order][s_integration_order][t_integration_order]
136  // 3D array of Material points
137  std::vector<MatPoint3D> matpoint;
138 
139  // 3D array of material models for each Material points
140  // NDMaterial *GPmmodel; //!< pointer to array of material models for Material Points
141  // Do we need this one?
142 
143  //..NDMaterial *MatPoint; //!< Zhaohui 10-01-2000
144 
145 
146  int LM[24];
147  public:
148  EightNodeBrick(int element_number,
149  int node_numb_1, int node_numb_2, int node_numb_3, int node_numb_4,
150  int node_numb_5, int node_numb_6, int node_numb_7, int node_numb_8,
151  NDMaterial * Globalmmodel, const BodyForces3D &bForces,
152  double r, double p);
153  // int dir, double surflevel);
154  //, EPState *InitEPS); const std::string &type,
155 
156  EightNodeBrick(void);
157  Element *getCopy(void) const;
158  ~EightNodeBrick(void);
159 
160  //Not needed Zhaohui
161  //int Initialize(int element_number,
162  // int node_numb_1, int node_numb_2, int node_numb_3, int node_numb_4,
163  // int node_numb_5, int node_numb_6, int node_numb_7, int node_numb_8,
164  // NDMaterial * Globalmmodel, const BodyForces3D &=,
165  // double p, double r);
166  // //, EPState * InitEPS);const std::string &type,
167 
168  // update, Guanzhou added Apr. 2004 to update incremental strain in the domain
169  int update(void);
170 
171  int getNumDOF(void) const;
172  void setDomain(Domain *theDomain);
173 
174  // public methods to set the state of the element
175  int commitState();
176  int revertToLastCommit ();
177  int revertToStart();
178 
179  // public methods to obtain stiffness, mass, damping and residual information
180  // We haven't build the following functions.
181  // All the value of K M Dmp and F are nothing. just
182  // want to test the program. Xiaoyan 08/16/00
183  const Matrix &getTangentStiff(void) const;
184  const Matrix &getInitialStiff(void) const;
185  const Matrix &getMass(void) const;
186 
187  const Matrix &getConsMass(void);
188 
189  void alive(void);
190  int addLoad(ElementalLoad *theLoad, double loadFactor);
191  int addInertiaLoadToUnbalance(const Vector &accel);
192 
193  const Vector FormEquiBodyForce(void);
194  const Vector &getResistingForce(void) const;
195  const Vector &getResistingForceIncInertia(void) const;
196 
197  int sendSelf(Communicator &);
198  int recvSelf(const Communicator &);
199 
200  void Print(std::ostream &s, int flag =0) const;
201  // Do nothing with void Print(std::ostream &s, int flag =0);
202  // use Brick3D report. 08/16/00
203  Response *setResponse(const std::vector<std::string> &argv, Information &eleInformation);
204  int getResponse (int responseID, Information &eleInformation);
205 
206  void incremental_Update(void);
207  //void iterative_Update(void);
208 
209 
210  BJtensor H_3D(double r1, double r2, double r3) const;
211  BJtensor interp_poli_at(double r, double s, double t);
212  BJtensor dh_drst_at(double r, double s, double t) const;
213 
214 
215  //CE Dynamic Allocation for for brick3d s.
216  //Finite_Element * new_el( int total );
217  EightNodeBrick &operator[](int subscript);
218  //Finite_Element & operator[](int subscript);
219  //Finite_Element & operator[](int subscript);
220 
221  BJtensor getStiffnessTensor(void) const;
222  //matrix stiffness_tensor(void);
223 
224  void set_strain_stress_tensor(FILE *fp, double * u);
225  BJtensor getMassTensor(void) const;
226 //out19Jan2001 double Potential_Energy(void);
227 
228  BJtensor Jacobian_3D(const BJtensor &dh) const;
229  BJtensor Jacobian_3Dinv(const BJtensor &dh) const;
230  BJtensor Nodal_Coordinates(void) const;
231 
232  BJtensor incr_disp(void) const;
233  BJtensor total_disp(void) const;
234 
235  BJtensor total_disp(FILE *fp, double * u);
236 
237  BJtensor stiffness_matrix(const BJtensor & K);
238  BJtensor mass_matrix(const BJtensor & M);
239 
240 
241  int get_global_number_of_node(int local_node_number);
242  int get_Brick_Number(void);
243 
244  int * get_LM(void);
245  //void set_LM(Node * node); //!< commented out temporarily 09-27-2000 Zhaohui
246 
247  //these two files are originally in fe.h
248  double get_Gauss_p_c(short order, short point_numb) const;
249  double get_Gauss_p_w(short order, short point_numb) const;
250 
251  // returns nodal forces for given stress field in an element
252  BJtensor nodal_forces(void) const;
253  // returns nodal forces for ITERATIVE stress field in an element
254  BJtensor iterative_nodal_forces(void) const;
255  // returns nodal forces for given constant stress field in the element
256  BJtensor nodal_forces_from_stress(stresstensor &) const;
257  // returns nodal forces for given incremental strain field in an element
258  // by using the linearized constitutive BJtensor from the beginning of the step !
259  BJtensor linearized_nodal_forces(void) const;
260 
261  // updates Material point stresses and strains from given displacements
262  BJtensor update_stress_strain(BJtensor & disp);
263 
264  void report(char *);
265  void reportshort(char *);
266  void reportPAK(char *);
267  void reportpqtheta(int);
268  //void reportLM(char *);
269  void computeGaussPoint(void);
270  void reportCIPIC(char *);
271  void reportTensorF(FILE *);
272 
273  // Setting initial E according to the initial pressure
274  //void setInitE(void);
275  //void reportStressTensorF(FILE *);
276  };
277 } // end of XC namespace
278 
279 
280 #endif
281 
Float vector abstraction.
Definition: Vector.h:94
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
int sendSelf(Communicator &)
Send the object.
Definition: EightNodeBrick.cpp:3063
void incremental_Update(void)
Definition: EightNodeBrick.cpp:422
int recvSelf(const Communicator &)
Receive the object.
Definition: EightNodeBrick.cpp:3070
int revertToStart()
Reverts the element to its initial state.
Definition: EightNodeBrick.cpp:2592
Boris Jeremic tensor class.
Definition: BJtensor.h:112
Eight node hexahedral element for three-dimensional problems.
Definition: EightNodeBrick.h:83
void alive(void)
Reactivates the element.
Definition: EightNodeBrick.cpp:2752
const Vector & getResistingForceIncInertia(void) const
Returns the resisting force vector including inertia forces.
Definition: EightNodeBrick.cpp:2992
int commitState()
Commit the current element state.
Definition: EightNodeBrick.cpp:2413
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: EightNodeBrick.cpp:3133
Base class for the finite elements.
Definition: Element.h:112
int update(void)
Updates the element state.
Definition: EightNodeBrick.cpp:4045
const Matrix & getMass(void) const
Returns the mass matrix.
Definition: EightNodeBrick.cpp:2715
Body forces over an element.
Definition: BodyForces3D.h:40
const Matrix & getTangentStiff(void) const
Return the tangent stiffness matrix.
Definition: EightNodeBrick.cpp:2616
BJtensor getMassTensor(void) const
Returns the tensor de masas.
Definition: EightNodeBrick.cpp:1075
void setDomain(Domain *theDomain)
Sets the domain for the element.
Definition: EightNodeBrick.cpp:2406
BJtensor dh_drst_at(double r, double s, double t) const
Definition: EightNodeBrick.cpp:690
Base class for 2D and 3D materials.
Definition: NDMaterial.h:101
int getNumDOF(void) const
return the number of DOF associated with the element.
Definition: EightNodeBrick.cpp:2400
void Print(std::ostream &s, int flag=0) const
Print stuff.
Definition: EightNodeBrick.cpp:3078
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
const Vector & getResistingForce(void) const
Returns the resisting force vector for the element.
Definition: EightNodeBrick.cpp:2963
Matrix of floats.
Definition: Matrix.h:111
Element * getCopy(void) const
Virtual constructor.
Definition: EightNodeBrick.cpp:408
Base class for loads over elements.
Definition: ElementalLoad.h:79
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:117
int revertToLastCommit()
Revert to the last committed state.
Definition: EightNodeBrick.cpp:2566
int getResponse(int responseID, Information &eleInformation)
Obtain information from an analysis.
Definition: EightNodeBrick.cpp:3212