meshToMeshI.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "meshToMesh.H"
27 
28 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
29 
31 {
32  return cellsInterpolation_();
33 }
34 
35 
38 {
39  if (!srcCellsStabilisation_.valid())
40  {
41  srcCellsStabilisation_.reset(new cellsToCellsStabilisation());
42  srcCellsStabilisation_->update
43  (
44  srcMesh_,
45  cellsInterpolation_->srcCoupled()
46  );
47  }
48 
49  return srcCellsStabilisation_();
50 }
51 
52 
55 {
56  if (!tgtCellsStabilisation_.valid())
57  {
58  tgtCellsStabilisation_.reset(new cellsToCellsStabilisation());
59  tgtCellsStabilisation_->update
60  (
61  tgtMesh_,
62  cellsInterpolation_->tgtCoupled()
63  );
64  }
65 
66  return tgtCellsStabilisation_();
67 }
68 
69 
71 {
72  return patchIDs_;
73 }
74 
75 
77 (
78  const label i
79 ) const
80 {
81  return patchInterpolations_[i];
82 }
83 
84 
87 {
88  if (!srcPatchStabilisations_.set(i))
89  {
90  const label srcPatchi = patchIDs_[i].first();
91  const polyPatch& srcPp = srcMesh_.boundaryMesh()[srcPatchi];
92 
93  srcPatchStabilisations_.set(i, new patchToPatchStabilisation());
94  srcPatchStabilisations_[i].update
95  (
96  srcPp,
97  patchInterpolations_[i].srcCoupled()
98  );
99  }
100 
101  return srcPatchStabilisations_[i];
102 }
103 
104 
107 {
108  if (!tgtPatchStabilisations_.set(i))
109  {
110  const label tgtPatchi = patchIDs_[i].first();
111  const polyPatch& tgtPp = tgtMesh_.boundaryMesh()[tgtPatchi];
112 
113  tgtPatchStabilisations_.set(i, new patchToPatchStabilisation());
114  tgtPatchStabilisations_[i].update
115  (
116  tgtPp,
117  patchInterpolations_[i].tgtCoupled()
118  );
119  }
120 
121  return tgtPatchStabilisations_[i];
122 }
123 
124 
125 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
126 
128 {
129  return srcMesh_;
130 }
131 
132 
134 {
135  return tgtMesh_;
136 }
137 
138 
139 // ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:91
bool set(const label) const
Is element set.
Definition: PtrListI.H:65
Stabilisation data and routines for cell-to-cell interpolations.
void update(const polyMesh &mesh, const PackedBoolList &cellCoupleds)
Compute the stabilisation addressing if necessary.
Class to calculate interpolative addressing and weights between the cells of two overlapping meshes.
Definition: cellsToCells.H:56
const polyMesh & srcMesh() const
Return const access to the source mesh.
Definition: meshToMeshI.H:127
const cellsToCellsStabilisation & tgtCellsStabilisation() const
Return the stabilisation engine for the target cells.
Definition: meshToMeshI.H:54
const patchToPatch & patchInterpolation(const label i) const
Return the interpolation engine between a source and a target.
Definition: meshToMeshI.H:77
const cellsToCellsStabilisation & srcCellsStabilisation() const
Return the stabilisation engine for the source cells.
Definition: meshToMeshI.H:37
const polyMesh & tgtMesh() const
Return const access to the target mesh.
Definition: meshToMeshI.H:133
const patchToPatchStabilisation & srcPatchStabilisation(const label i) const
Return the stabilisation engine for a source patch.
Definition: meshToMeshI.H:86
const List< labelPair > & patchIDs() const
Return the list of corresponding source and target patch indices.
Definition: meshToMeshI.H:70
const cellsToCells & cellsInterpolation() const
Return the interpolation engine between source and target cells.
Definition: meshToMeshI.H:30
const patchToPatchStabilisation & tgtPatchStabilisation(const label i) const
Return the stabilisation engine for a target patch.
Definition: meshToMeshI.H:106
Stabilisation data and routines for patch-to-patch interpolations.
Class to generate coupling geometry between two primitive patches.
Definition: patchToPatch.H:56
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:70
const polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
Definition: polyPatch.C:270
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59