xc
BeamContact2D.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 /* ****************************************************************** **
29 ** OpenSees - Open System for Earthquake Engineering Simulation **
30 ** Pacific Earthquake Engineering Research Center **
31 ** **
32 ** **
33 ** (C) Copyright 1999, The Regents of the University of California **
34 ** All Rights Reserved. **
35 ** **
36 ** Commercial use of this program without express permission of the **
37 ** University of California, Berkeley, is strictly prohibited. See **
38 ** file 'COPYRIGHT' in main directory for information on usage and **
39 ** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. **
40 ** **
41 ** Developed by: **
42 ** Frank McKenna (fmckenna@ce.berkeley.edu) **
43 ** Gregory L. Fenves (fenves@ce.berkeley.edu) **
44 ** Filip C. Filippou (filippou@ce.berkeley.edu) **
45 ** **
46 ** ****************************************************************** */
47 
48 #ifndef BeamContact2D_h
49 #define BeamContact2D_h
50 
51 // Created: C.McGann, UW, 12.2010
52 //
53 // Description: This file contains the class definition for BeamContact2D
54 
55 #include "domain/mesh/element/ElemWithMaterial.h"
56 #include "domain/mesh/element/utils/physical_properties/Contact2D.h"
57 
58 // number of nodes per element
59 #define BC2D_NUM_NODE 4
60 // number of dimensions
61 #define BC2D_NUM_DIM 2
62 // degrees of freedom per element
63 #define BC2D_NUM_DOF 10
64 
65 namespace XC {
66 class ContactMaterial2D;
67 
75 class BeamContact2D : public ElemWithMaterial<BC2D_NUM_NODE, Contact2D>
76  {
77  private:
78  // objects
79 
80  // input quantities
81  mutable double mLength;
82  double mRadius;
83  double mGapTol;
84  double mForceTol;
85  int mIniContact;
86 
87  // boolean variables
88  mutable bool inContact;
89  mutable bool was_inContact;
90  mutable bool to_be_released;
91  mutable bool should_be_released;
92  mutable bool in_bounds;
93 
94  mutable Matrix mTangentStiffness;
95  mutable Vector mInternalForces;
96 
97  // calculation variables
98  mutable double mXi;
99  mutable double mGap;
100  mutable double mLambda;
101 
102  Matrix mEye1;
103  Matrix mEyeS;
104  mutable Vector mg_xi;
105  mutable Vector mNormal;
106  mutable Vector mShape;
107  mutable Vector mDshape;
108 
109  mutable Vector mBn;
110  mutable Vector mBs;
111 
112  mutable Vector ma_1;
113  mutable Vector mb_1;
114  mutable Vector mc_1;
115  mutable double mrho;
116 
117  mutable Vector mIcrd_a;
118  mutable Vector mIcrd_b;
119  mutable Vector mIcrd_s;
120  mutable Vector mDcrd_a;
121  mutable Vector mDcrd_b;
122  mutable Vector mDcrd_s;
123  mutable Vector mDisp_a_n;
124  mutable Vector mDisp_b_n;
125 
126  // member functions
127  double Project(double xi) const;
128  void ComputeB(void) const;
129  int UpdateBase(double xi) const;
130  void UpdateEndFrames(void) const;
131  Vector Get_dxc_xi(double xi) const;
132  Vector Get_dxc_xixi(double xi) const;
133  Vector Geta1(void) const;
134  Vector Getb1(void) const;
135  protected:
136  int sendData(Communicator &);
137  int recvData(const Communicator &);
138  void setup_contact_state(void) const;
139  void update_contact_state(void);
140  bool initialize_parameters(void) const;
141  public:
142  BeamContact2D(int tag= 0, const ContactMaterial2D *mat= nullptr);
143  BeamContact2D(int tag, int Nd1, int Nd2, int NdS, int NdL, ContactMaterial2D &theMat, double width, double tolG, double tolF, int cSwitch = 0);
144  Element *getCopy(void) const;
145 
146  // public methods to obtain information about dof and connectivity
147  int getNumDOF(void) const;
148  void setDomain(Domain *theDomain);
149 
150  void setWidth(const double &);
151  double getWidth(void) const;
152  void setGapTolerance(const double &);
153  double getGapTolerance(void) const;
154  void setForceTolerance(const double &);
155  double getForceTolerance(void) const;
156  void setInitialContactFlag(const int &);
157  double getInitialContactFlag(void) const;
158 
159  // public methods to set the state of the element
160  int commitState(void);
161  int revertToLastCommit(void);
162  int revertToStart(void);
163  int update(void);
164 
165  // public methods to obtain stiffness, mass, damping, and residual info
166  const Matrix &getTangentStiff(void) const;
167  const Matrix &getInitialStiff(void) const;
168 
169  void zeroLoad(void);
170  int addLoad(ElementalLoad *theLoad, double loadFactor);
171  int addInertiaLoadToUnbalance(const Vector &accel);
172  const Vector &getResistingForce(void) const;
173  const Vector &getResistingForceIncInertia(void) const;
174 
175  // public methods for element output
176  int sendSelf(Communicator &);
177  int recvSelf(const Communicator &);
178  void Print(std::ostream &s, int flag =0) const;
179 
180  Response *setResponse(const std::vector<std::string> &argv, Parameter &param);
181  int getResponse(int responseID, Information &eleInformation);
182 
183  // public methods for material stage update
184  int setParameter(const std::vector<std::string> &argv, Parameter &param);
185  int updateParameter(int parameterID, Information &info);
186 
187 };
188 } // end of XC namespace
189 
190 #endif
int recvData(const Communicator &)
Send object members through the communicator argument.
Definition: BeamContact2D.cpp:715
Float vector abstraction.
Definition: Vector.h:94
Information about an element.
Definition: Information.h:81
Communication parameters between processes.
Definition: Communicator.h:66
Base class response objects.
Definition: Response.h:81
const Matrix & getTangentStiff(void) const
This function computes the tangent stiffness matrix for the element.
Definition: BeamContact2D.cpp:619
2D beam contact element.
Definition: BeamContact2D.h:75
const Matrix & getInitialStiff(void) const
This function computes the initial tangent stiffness matrix for the element.
Definition: BeamContact2D.cpp:664
int setParameter(const std::vector< std::string > &argv, Parameter &param)
Sets the value param to the parameter argv.
Definition: BeamContact2D.cpp:858
int sendSelf(Communicator &)
Sends object through the communicator argument.
Definition: BeamContact2D.cpp:724
int updateParameter(int parameterID, Information &info)
Updates the parameter identified by parameterID with info.
Definition: BeamContact2D.cpp:870
const Vector & getResistingForceIncInertia(void) const
Returns the resisting force vector including inertia forces.
Definition: BeamContact2D.cpp:702
Base class for the finite elements.
Definition: Element.h:112
int getResponse(int responseID, Information &eleInformation)
Obtain information from an analysis.
Definition: BeamContact2D.cpp:808
void Print(std::ostream &s, int flag=0) const
Print stuff.
Definition: BeamContact2D.cpp:763
void setDomain(Domain *theDomain)
Sets the domain for the element.
Definition: BeamContact2D.cpp:227
2D contact material.
Definition: ContactMaterial2D.h:44
int recvSelf(const Communicator &)
Receives object through the communicator argument.
Definition: BeamContact2D.cpp:741
void zeroLoad(void)
Zeroes the loads over the element.
Definition: BeamContact2D.cpp:667
int revertToLastCommit(void)
Revert to the last committed state.
Definition: BeamContact2D.cpp:270
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
int revertToStart(void)
Reverts the element to its initial state.
Definition: BeamContact2D.cpp:275
Element with material.
Definition: ElemWithMaterial.h:45
Matrix of floats.
Definition: Matrix.h:111
int commitState(void)
Commit the current element state.
Definition: BeamContact2D.cpp:244
const Vector & getResistingForce(void) const
This function computes the resisting force vector for the element.
Definition: BeamContact2D.cpp:677
int sendData(Communicator &)
Send object members through the communicator argument.
Definition: BeamContact2D.cpp:706
Parameter.
Definition: Parameter.h:68
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 getNumDOF(void) const
return the number of DOF associated with the element.
Definition: BeamContact2D.cpp:150
Element * getCopy(void) const
Virtual constructor.
Definition: BeamContact2D.cpp:147
int update(void)
This function updates variables for an incremental step n to n+1.
Definition: BeamContact2D.cpp:304