OOFEM 3.0
Loading...
Searching...
No Matches
contactpair.h
Go to the documentation of this file.
1/*
2 *
3 * ##### ##### ###### ###### ### ###
4 * ## ## ## ## ## ## ## ### ##
5 * ## ## ## ## #### #### ## # ##
6 * ## ## ## ## ## ## ## ##
7 * ## ## ## ## ## ## ## ##
8 * ##### ##### ## ###### ## ##
9 *
10 *
11 * OOFEM : Object Oriented Finite Element Code
12 *
13 * Copyright (C) 1993 - 2025 Borek Patzak
14 *
15 *
16 *
17 * Czech Technical University, Faculty of Civil Engineering,
18 * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19 *
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Lesser General Public License for more details.
29 *
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33 */
34
35#ifndef contactpair_h
36#define contactpair_h
37
38#include "contactpoint.h"
39
40namespace oofem {
41class IntArray;
42class FloatArray;
43class FloatMatrix;
44
45
46
68{
69protected:
70 std::unique_ptr<ContactPoint> master;
71 std::unique_ptr<ContactPoint> slave;
72 double normal_gap = 0;
79 //
83 //
86 //traction vectors
89 // dxi;
90 double dXi;
91 double temp_dXi;
92
93
94public:
101 ContactPair(std::unique_ptr<ContactPoint> slave);
103 //
110 virtual bool inContact() {
111 if (!master) return false;
112 return master->inContact();
113 }
114 //
124 virtual void computeNmatrix(FloatMatrix &answer);
133 virtual void compute_dNdxi_matrices(std::vector<FloatMatrix> &answer);
140 virtual void computeCurvature(FloatMatrix &G, TimeStep *tStep);
141 //
159 void giveLocationArray(const IntArray &dofs, IntArray &loc, const UnknownNumberingScheme &ns) const;
163 double giveNormalGap() { return normal_gap;}
167 void setNormalGap(double ng){this->normal_gap = ng;}
168 //
172 const FloatArray &giveNormalVector() const {return normalVector;}
182 const FloatArray &giveTangentVector(int i) const;
188 const FloatArray &givePreviousTangentVector(int i) const;
192 std::vector<FloatArray> giveTangentVectors() const;
196 std::vector<FloatArray> givePreviousTangentVectors() const;
200 const FloatArray &giveLocalCoordinates() const {return slave->giveLocalCoordinates();}
206 void initContactPoint();
216 void setNormalVector(const FloatArray &nv) {this->normalVector = nv;}
220 void setTangentVector1(const FloatArray &tv1) {this->tangentVector1 = tv1;}
224 void setTangentVector2(const FloatArray &tv2) {this->tangentVector2 = tv2;}
228 void setTempTractionVector(const FloatArray &tv) {this->tempTractionVector = tv;}
236 void setMasterContactPoint(std::unique_ptr<ContactPoint> m) {master = std::move(m);}
240 void setSlaveContactPoint(std::unique_ptr<ContactPoint> s) {slave = std::move(s);}
249 virtual void updateYourself(TimeStep *tStep);
260 void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer);
269};
270
271} // end namespace oofem
272#endif //contactpair_h
Axis-aligned bounding box.
Definition aabb.h:65
ContactPoint * giveMasterContactPoint()
Returns the master contact point (non-owning pointer).
void setTempTractionVector(const FloatArray &tv)
Sets a temporary traction vector (e.g., predictor or iteration-local value).
FloatArray tractionVector
Definition contactpair.h:87
virtual void computeNmatrix(FloatMatrix &answer)
Computes the contact interpolation matrix (N-matrix) for this pair.
Definition contactpair.C:97
FloatArray normalVector
Definition contactpair.h:73
std::vector< FloatArray > giveTangentVectors() const
Returns all current tangent vectors (typically one or two, depending on surface dimension).
Definition contactpair.C:79
const FloatArray & giveNormalVector() const
Returns the current unit normal vector associated with the contact configuration.
double giveNormalGap()
Returns the current normal gap (signed separation) of the pair.
virtual void computeCurvature(FloatMatrix &G, TimeStep *tStep)
Computes curvature-related quantities of the contact surface at the contact point.
FloatArray computeContactPointDisplacement() const
Computes displacement at the contact point.
const FloatArray & givePreviousTangentVector(int i) const
Returns the i-th tangent vector from the previous stored state.
Definition contactpair.C:59
FloatArray tangentVector2
Definition contactpair.h:77
FloatArray previousContactPointCoords
Definition contactpair.h:84
void setNormalGap(double ng)
Sets the current normal gap (signed separation) of the pair.
FloatArray previousTangentVector1
Definition contactpair.h:76
FloatArray tangentVector1
Definition contactpair.h:75
virtual void updateYourself(TimeStep *tStep)
Updates internal state of the contact pair for the given time step.
void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer)
Computes a vector quantity for the pair in a given value mode.
bool referenceContactPointInit
Definition contactpair.h:85
FloatArray tempTractionVector
Definition contactpair.h:88
void initContactPoint()
Initializes contact-point related quantities for the pair.
void setTangentVector1(const FloatArray &tv1)
Sets the first tangent vector.
ContactPair(std::unique_ptr< ContactPoint > slave)
Constructs a contact pair with an initialized slave contact point.
Definition contactpair.C:40
void setTangentVector2(const FloatArray &tv2)
Sets the second tangent vector.
AABB computeSlaveAABB()
Computes an axis-aligned bounding box (AABB) for the slave side.
const FloatArray & givePreviousNormalVector() const
Returns the unit normal vector from the previous stored state.
std::unique_ptr< ContactPoint > master
Definition contactpair.h:70
void setMasterContactPoint(std::unique_ptr< ContactPoint > m)
Assigns a master contact point for this pair.
std::vector< FloatArray > givePreviousTangentVectors() const
Returns the slave local coordinates used to parameterize the contact point.
Definition contactpair.C:88
void giveLocationArray(const IntArray &dofs, IntArray &loc, const UnknownNumberingScheme &ns) const
Builds a location array for the pair based on selected DOFs.
const FloatArray & giveLocalCoordinates() const
Returns the slave local coordinates used to parameterize the contact point.
const FloatArray & giveTractionVector() const
Returns the current traction vector associated with the contact constraint.
virtual bool inContact()
Returns true if the pair is currently considered in contact.
void setNormalVector(const FloatArray &nv)
Sets the current normal vector.
ContactPoint * giveSlaveContactPoint()
Returns the slave contact point (non-owning pointer).
void setSlaveContactPoint(std::unique_ptr< ContactPoint > s)
Assigns a slave contact point for this pair.
FloatArray contactPointCoords
Definition contactpair.h:82
FloatArray referenceContactPointCoords
Definition contactpair.h:80
std::unique_ptr< ContactPoint > slave
Definition contactpair.h:71
FloatArray previousTangentVector2
Definition contactpair.h:78
const FloatArray & giveTangentVector(int i) const
Returns the i-th current tangent vector at the contact point.
Definition contactpair.C:47
FloatArray previousNormalVector
Definition contactpair.h:74
FloatArray tempReferenceContactPointCoords
Definition contactpair.h:81
virtual void compute_dNdxi_matrices(std::vector< FloatMatrix > &answer)
Computes derivatives of shape functions w.r.t. local surface parameters.
Represents a discrete contact point used in contact mechanics formulations.

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011