https://mooseframework.inl.gov
Loading...
Searching...
No Matches
AutomaticContactPairingGenerator.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include "MeshGenerator.h"
13
20{
21public:
24 std::unique_ptr<MeshBase> generate() override;
25
27 using ContactPairs = std::vector<std::pair<std::string, std::string>>;
28
30 static constexpr auto contact_pairs_property = "contact_pairs";
31
36 static std::string pairSuffix(const std::pair<BoundaryName, BoundaryName> & pair);
37
38protected:
39 std::unique_ptr<MeshBase> & _input;
40
41private:
43 const std::vector<BoundaryName> & _pairing_boundaries;
49 const std::string & _prefix;
52
55 {
56 BoundaryName name;
58 Real area;
59 Point centroid;
60 };
61
63 std::vector<std::pair<BoundaryName, BoundaryName>>
64 findPairsNodeProximity(const MeshBase & mesh) const;
65
67 std::vector<std::pair<BoundaryName, BoundaryName>> findPairsCentroid(const MeshBase & mesh) const;
68
74 std::vector<CandidateBoundary> candidateBoundaries(const MeshBase & mesh) const;
75
77 static std::pair<BoundaryName, BoundaryName> orderPair(const CandidateBoundary & a,
78 const CandidateBoundary & b);
79
80 static void removeDuplicatePairs(std::vector<std::pair<BoundaryName, BoundaryName>> & pairs);
81};
boundary_id_type BoundaryID
Detects contact surface pairs from a list of candidate boundaries using proximity,...
const Real _pairing_distance
Maximum center-to-center or node-to-node distance for pairing.
static std::pair< BoundaryName, BoundaryName > orderPair(const CandidateBoundary &a, const CandidateBoundary &b)
Order two paired boundaries as (primary, secondary), with the larger surface as primary.
static std::string pairSuffix(const std::pair< BoundaryName, BoundaryName > &pair)
Name suffix identifying a (primary, secondary) boundary pair, used to build unique object names when ...
std::vector< std::pair< BoundaryName, BoundaryName > > findPairsCentroid(const MeshBase &mesh) const
Find pairs by sideset centroid distance; returns deduplicated pairs.
std::vector< std::pair< BoundaryName, BoundaryName > > findPairsNodeProximity(const MeshBase &mesh) const
Find pairs by node-proximity KD-tree search; returns deduplicated pairs.
const bool _create_lower_d_blocks
Whether to create lower-dimensional subdomain blocks for each detected pair.
static constexpr auto contact_pairs_property
Name of the mesh meta-data holding the detected contact pairs.
const std::vector< BoundaryName > & _pairing_boundaries
Candidate boundaries to pair.
static void removeDuplicatePairs(std::vector< std::pair< BoundaryName, BoundaryName > > &pairs)
const MooseEnum & _pairing_method
Pairing method: NODE or CENTROID.
std::vector< std::pair< std::string, std::string > > ContactPairs
Type of the mesh meta-data holding the detected (primary, secondary) boundary name pairs.
std::vector< CandidateBoundary > candidateBoundaries(const MeshBase &mesh) const
Resolve the candidate boundary names to boundary IDs, erroring if any boundary is listed more than on...
std::unique_ptr< MeshBase > generate() override
const std::string & _prefix
Prefix prepended to the names of generated subdomain blocks.
const InputParameters & parameters() const
A candidate contact boundary with its sideset area and area-weighted centroid.