xc
BeamContact3D.h
1 /* ****************************************************************** **
2 ** OpenSees - Open System for Earthquake Engineering Simulation **
3 ** Pacific Earthquake Engineering Research Center **
4 ** **
5 ** **
6 ** (C) Copyright 1999, The Regents of the University of California **
7 ** All Rights Reserved. **
8 ** **
9 ** Commercial use of this program without express permission of the **
10 ** University of California, Berkeley, is strictly prohibited. See **
11 ** file 'COPYRIGHT' in main directory for information on usage and **
12 ** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. **
13 ** **
14 ** Developed by: **
15 ** Frank McKenna (fmckenna@ce.berkeley.edu) **
16 ** Gregory L. Fenves (fenves@ce.berkeley.edu) **
17 ** Filip C. Filippou (filippou@ce.berkeley.edu) **
18 ** **
19 ** ****************************************************************** */
20 
21 
22 #ifndef BeamContact3D_h
23 #define BeamContact3D_h
24 
25 // Written: kap
26 // Created: 06/05
27 //
28 // Description: This file contains the class definition for BeamContact3D.
29 
30 #include "domain/mesh/element/ElemWithMaterial.h"
31 #include "domain/mesh/element/utils/physical_properties/Contact3D.h"
32 
33 class CrdTransf;
34 
35 // number of nodes per element
36 #define BC3D_NUM_NODE 4
37 // number of dimensions
38 #define BC3D_NUM_NDM 3
39 // degrees of freedom per element
40 #define BC3D_NUM_DOF 18
41 
42 
43 namespace XC {
44 class ContactMaterial3D;
45 
46 
54 class BeamContact3D : public ElemWithMaterial<BC3D_NUM_NODE, Contact3D>
55  {
56  private:
57  // objects
58  CrdTransf3d *crdTransf; // pointer to coordinate transformation object
59 
60  Vector theVector; // vector to return the residual
61  mutable Matrix mTangentStiffness; // Tangent Stiffness matrix
62  mutable Vector mInternalForces; // vector of Internal Forces
63 
64  // input quantities
65  double mL; // length of Beam Element
66  double mRadius; // radius of Pile Surface
67  double mTolGap; // gap tolerance
68  double mTolForce; // force tolerance
69  int mIniContact; // initial contact switch (0 = notInContact, 1 = inContact)
70  // default is set for initially inContact
71 
72  // boolean variables
73  bool inContact;
74  bool was_inContact;
75  bool to_be_released;
76  bool should_be_released;
77  bool in_bounds;
78  bool mInitialize;
79 
80  // calculation variables
81  double mxi; // centerline projection coordinate: 0 <= xi <= 1
82  double mchi; // twist rotation from end 1 to end 2
83  double mGap; // current value of the gap
84  double mLambda; // current value of Lagrange Multiplier
85  double mrho2; // angular coord relating c2 to radial vector
86  double mrho3; // angular coord relating c3 to radial vector
87 
88  Matrix meye1; // Identity Tensor
89  Vector mg1; // tangent plane basis vector, g_xi
90  Vector mg2; // tangent plane basis vector, g_psi
91  Matrix mg_metric; // metric tensor
92  // Matrix mG_metric; // contravariant metric tensor
93  Vector mn; // normal Vector
94  Vector mH; // vector of Hermitian Basis Functions
95  Vector mIcrd_a; // initial coordinates of node a
96  Vector mIcrd_b; // initial coordinates of node b
97  Vector mIcrd_s; // initial coordinates of node s
98  Vector mDcrd_a; // current coordinates of node a
99  Vector mDcrd_b; // current coordinates of node b
100  Vector mDcrd_s; // current coordinates of node s
101  //Vector mRot_a_n; // total rotations of node a @ step n
102  //Vector mRot_b_n; // total rotations of node b @ step n
103  Vector mDisp_a_n; // total disps & rotations of node a @ step n
104  Vector mDisp_b_n; // total disps & rotations of node b @ step n
105  Vector mDisp_s_n; // total disps of node s @ step n
106  Matrix mQa; // coordinate transform for node a
107  Matrix mQb; // coordinate transform for node b
108  Matrix mQc;
109  Vector mc1; // tangent vector at project point c
110  Vector mBn; // gap-displacement matrix
111  Matrix mBs; // slip-displacement matrix
112  Matrix mBphi;
113  Vector mSlip;
114 
115  int MyTag; // element tag for debugging
116 
117  // member functions
118  void set_transf(const CrdTransf *trf);
119  double project(double xi);
120  int UpdateBase(double xi); // method to update base vectors g1 & g2
121  void ComputeB(void); // method to compute Bn, Bs @ step n
122  Matrix ComputeBphi(void); // method to compute Bphi, used in ComputeB and update
123  void UpdateTransforms(void); // method to update Qa, Qb
124  void ComputeQc(double xi); // method to compute Qc from Qa and Qb
125 
126  Matrix ExponentialMap(Vector theta); // function returns the exponential map of a vector
127  Matrix ComputeSkew(Vector theta); // function returns skew matrix of given vector
128  Vector CrossProduct(Vector &V1, Vector &V2); // cross product (does not exist in Vector Class!)
129  Matrix Transpose(int dim1, int dim2, const Matrix &M); // functions returns the tranpose of Matrix M (does not exist in Matrix Class!)
130 
131  const Vector &Geta1(void); // returns a1 = mQa(:,0)
132  const Vector &Getb1(void); // returns b1 = mQb(:,0)
133  void Setc1(const Vector &); // sets member vector c1
134  const Vector &Getc1(void); // returns member vector c1
135  const Vector &Getdx_c(double xi); // returns dx_c / dxi
136  const Vector &Getddx_c(double xi); // returns d^2(x_c)/ dxi^2
137  protected:
138  int sendCoordTransf(int posFlag,const int &,const int &,Communicator &);
139  CrdTransf3d *recvCoordTransf(int posFlag,const int &,const int &,const Communicator &);
140  int sendData(Communicator &);
141  int recvData(const Communicator &);
142  void copy_members(const BeamContact3D &);
143 
144  public:
145  BeamContact3D(int tag= 0, const ContactMaterial3D *mat= nullptr, const CrdTransf *crdTransf= nullptr);
146  BeamContact3D(int tag, int Nd1, int Nd2,
147  int NdS, int NdL, double rad, const CrdTransf *,
148  ContactMaterial3D &, double tolG, double tolF, int cSwitch = 0);
149  BeamContact3D(const BeamContact3D &);
151  ~BeamContact3D(void);
152  Element *getCopy(void) const;
153 
154  // public methods to obtain information about dof & connectivity
155  int getNumDOF(void) const;
156  void setDomain(Domain *theDomain);
157  inline CrdTransf3d *getCoordTransf(void)
158  { return crdTransf; }
159  inline const CrdTransf3d *getCoordTransf(void) const
160  { return crdTransf; }
161 
162  // public methods to set the state of the element
163  int commitState(void);
164  int revertToLastCommit(void);
165  int revertToStart(void);
166  int update(void);
167 
168  // public methods to obtain stiffness, mass, damping and
169  // residual information
170  const Matrix &getTangentStiff(void) const;
171  const Matrix &getInitialStiff(void) const;
172 
173  void zeroLoad(void);
174  int addLoad(ElementalLoad *theLoad, double loadFactor);
175  int addInertiaLoadToUnbalance(const Vector &accel);
176  const Vector &getResistingForce(void) const;
177  const Vector &getResistingForceIncInertia(void) const;
178 
179  // public methods for element output
180  int sendSelf(Communicator &);
181  int recvSelf(const Communicator &);
182  void Print(std::ostream &s, int flag =0) const;
183 
184  // Response *setResponse(const char **argv, int argc, Information &eleInfo);
185  Response *setResponse(const std::vector<std::string> &argv, Parameter &param);
186  int getResponse(int responseID, Information &eleInformation);
187 
188  // public methods for material stage update
189  int setParameter(const std::vector<std::string> &argv, Parameter &param);
190  int updateParameter(int parameterID, Information &info);
191  };
192 } // end of XC namespace
193 
194 #endif
int updateParameter(int parameterID, Information &info)
Updates the parameter identified by parameterID with info.
Definition: BeamContact3D.cpp:1840
Float vector abstraction.
Definition: Vector.h:94
2D contact material.
Definition: ContactMaterial3D.h:45
int setParameter(const std::vector< std::string > &argv, Parameter &param)
Sets the value param to the parameter argv.
Definition: BeamContact3D.cpp:1827
BeamContact3D & operator=(const BeamContact3D &)
Assignment operator.
Definition: BeamContact3D.cpp:261
Information about an element.
Definition: Information.h:81
Communication parameters between processes.
Definition: Communicator.h:66
Base class response objects.
Definition: Response.h:81
CrdTransf provides the abstraction of a frame coordinate transformation.
Definition: CrdTransf.h:88
const Vector & getResistingForceIncInertia(void) const
Returns the resisting force vector including inertia forces.
Definition: BeamContact3D.cpp:1564
int revertToStart(void)
Reverts the element to its initial state.
Definition: BeamContact3D.cpp:461
void copy_members(const BeamContact3D &)
copy the values of the members from the other object.
Definition: BeamContact3D.cpp:66
int update(void)
Updates the element state.
Definition: BeamContact3D.cpp:502
Base class for the finite elements.
Definition: Element.h:112
int recvData(const Communicator &)
Send object members through the communicator argument.
Definition: BeamContact3D.cpp:1639
void zeroLoad(void)
Zeroes the loads over the element.
Definition: BeamContact3D.cpp:1516
CrdTransf3d * recvCoordTransf(int posFlag, const int &, const int &, const Communicator &)
Receives the coordinate transformation through the communicator argument.
Definition: BeamContact3D.cpp:1587
~BeamContact3D(void)
Destructor.
Definition: BeamContact3D.cpp:269
const Vector & getResistingForce(void) const
Returns the resisting force vector for the element.
Definition: BeamContact3D.cpp:1529
int sendCoordTransf(int posFlag, const int &, const int &, Communicator &)
Send the coordinate transformation through the communicator argument.
Definition: BeamContact3D.cpp:1570
3D beam contact element.
Definition: BeamContact3D.h:54
const Matrix & getTangentStiff(void) const
Return the tangent stiffness matrix.
Definition: BeamContact3D.cpp:1397
Element * getCopy(void) const
Virtual constructor.
Definition: BeamContact3D.cpp:276
void setDomain(Domain *theDomain)
Sets the domain for the element.
Definition: BeamContact3D.cpp:285
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Element with material.
Definition: ElemWithMaterial.h:45
int getNumDOF(void) const
return the number of DOF associated with the element.
Definition: BeamContact3D.cpp:279
Matrix of floats.
Definition: Matrix.h:111
int recvSelf(const Communicator &)
Receive the object.
Definition: BeamContact3D.cpp:1677
Parameter.
Definition: Parameter.h:68
Base class for loads over elements.
Definition: ElementalLoad.h:79
void Print(std::ostream &s, int flag=0) const
Print stuff.
Definition: BeamContact3D.cpp:1690
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:117
int revertToLastCommit(void)
Revert to the last committed state.
Definition: BeamContact3D.cpp:456
int sendData(Communicator &)
Send object members through the communicator argument.
Definition: BeamContact3D.cpp:1614
int commitState(void)
Commit the current element state.
Definition: BeamContact3D.cpp:368
int sendSelf(Communicator &)
Sends object through the communicator argument.
Definition: BeamContact3D.cpp:1664
Base class for 3D coordinate transformation.
Definition: CrdTransf3d.h:81
int getResponse(int responseID, Information &eleInformation)
Obtain information from an analysis.
Definition: BeamContact3D.cpp:1735