OOFEM 3.0
Loading...
Searching...
No Matches
contactsearchsweepandprune.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 contactsearchsweepandprune_h
36#define contactsearchsweepandprune_h
37
38#include "contactsearch.h"
39#include "contactelement.h"
40#include "contactpair.h"
41#include "aabb.h"
42#include <memory>
43#include <map>
44#include <set>
45#include <tuple>
46#include <array>
47#include <utility>
48namespace oofem {
49
50struct Bound {
51 public:
52 double value;
53 unsigned int id;
54 bool isSlave;
55 bool isMin;
56};
57
58
77
79{
80public:
81 using IJ = std::pair<unsigned int, unsigned int>;
82 using SetIJ = std::set<IJ>;
83protected:
85 std::array<SetIJ,3> potentialPairsPerAxes;
86 std::array<std::vector<Bound>,3> boundss;
87 std::vector<AABB> aabbs;
89public:
113 void updateContactPairs(TimeStep *tStep) override;
114protected:
122 void initialize();
131 void updateAABBs();
139 void updateBoundss();
147 void insertionSort();
157 void addPotentialPair(IJ);
179 void solveInversion(int axis, const Bound& b1, const Bound& b2);
186 static bool contains(const SetIJ& set, IJ ij) {
187 // return set.contains(ij); // C++20
188 return set.find(ij) != set.end();
189 }
190};
191
192} // end namespace oofem
193#endif //contactsearchsweepandprune_h
static bool contains(const SetIJ &set, IJ ij)
Utility: checks whether a pair identifier is contained in a set.
void updateContactPairs(TimeStep *tStep) override
Updates the list of contact pairs using sweep-and-prune broad-phase detection.
void solveInversion(int axis, const Bound &b1, const Bound &b2)
Handles a bound inversion event detected during sorting on a given axis.
void addPotentialPair(IJ)
Adds a candidate pair to the set of potential contact pairs.
void insertionSort()
Performs incremental sorting of bounds using insertion sort.
void deletePotentialPair(IJ)
Removes a candidate pair from the set of potential contact pairs.
void initialize()
Initializes internal data structures for sweep-and-prune.
void updateBoundss()
Updates per-axis bound (endpoint) arrays from current AABBs.
void updateAABBs()
Recomputes AABBs used by the search algorithm.
ContactSearchAlgorithm_Surface2FESurface_3d_SweepAndPrune(FEContactSurface *scs, FEContactSurface *mcs, Domain *d)
Constructs a 3D surface-to-surface contact search algorithm using sweep-and-prune.
ContactSearchAlgorithm_Surface2FESurface_3d(FEContactSurface *scs, FEContactSurface *mcs, Domain *d)
Abstract representation of a finite element contact surface.

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