46void Foam::pointConstraints::makePatchPatchAddressing()
50 Pout<<
"pointConstraints::makePatchPatchAddressing() : "
51 <<
"constructing boundary addressing"
55 const pointMesh& pMesh =
mesh();
56 const polyMesh&
mesh = pMesh();
58 const pointBoundaryMesh& pbm = pMesh.boundary();
59 const polyBoundaryMesh& bm =
mesh.boundaryMesh();
64 label nPatchPatchPoints = 0;
68 if (!isA<emptyPointPatch>(pbm[patchi]) && !pbm[patchi].
coupled())
70 const labelList& bp = bm[patchi].boundaryPoints();
72 nPatchPatchPoints += bp.
size();
77 <<
" nBoundaryPoints:" << bp.size() <<
endl;
84 Pout<<
indent <<
"Found nPatchPatchPoints:" << nPatchPatchPoints
93 Map<label> patchPatchPointSet(2*nPatchPatchPoints);
96 patchPatchPointConstraints_.setSize(nPatchPatchPoints);
97 patchPatchPointConstraints_ = pointConstraint();
100 labelList patchPatchPoints(nPatchPatchPoints);
106 if (!isA<emptyPointPatch>(pbm[patchi]) && !pbm[patchi].
coupled())
108 const labelList& bp = bm[patchi].boundaryPoints();
109 const labelList& meshPoints = pbm[patchi].meshPoints();
113 const label ppp = meshPoints[bp[pointi]];
115 const auto iter = patchPatchPointSet.cfind(ppp);
117 label constraintI = -1;
121 constraintI = iter.val();
125 patchPatchPointSet.insert(ppp, pppi);
126 patchPatchPoints[pppi] = ppp;
127 constraintI = pppi++;
131 pbm[patchi].applyConstraint
134 patchPatchPointConstraints_[constraintI]
142 Pout<<
indent <<
"Have (local) constrained points:"
143 << nPatchPatchPoints <<
endl;
152 const labelListList& globalPointSlaves = gd.globalPointSlaves();
153 const mapDistribute& globalPointSlavesMap = gd.globalPointSlavesMap();
154 const Map<label>& cpPointMap = gd.coupledPatch().meshPointMap();
155 const labelList& cpMeshPoints = gd.coupledPatch().meshPoints();
158 List<pointConstraint> constraints
160 globalPointSlavesMap.constructSize()
166 if (!isA<emptyPointPatch>(pbm[patchi]) && !pbm[patchi].
coupled())
168 const labelList& bp = bm[patchi].boundaryPoints();
169 const labelList& meshPoints = pbm[patchi].meshPoints();
173 const label ppp = meshPoints[bp[pointi]];
175 const auto iter = cpPointMap.cfind(ppp);
181 constraints[iter.val()] = patchPatchPointConstraints_
183 patchPatchPointSet[ppp]
191 globalPointSlavesMap.distribute(constraints);
194 forAll(globalPointSlaves, pointi)
196 const labelList& slaves = globalPointSlaves[pointi];
201 constraints[pointi].combine(constraints[slaves[i]]);
206 constraints[slaves[i]] = constraints[pointi];
211 globalPointSlavesMap.reverseDistribute
218 forAll(constraints, coupledPointi)
220 if (constraints[coupledPointi].first() != 0)
222 label meshPointi = cpMeshPoints[coupledPointi];
224 const auto iter = patchPatchPointSet.cfind(meshPointi);
226 label constraintI = -1;
237 constraintI = iter.val();
249 if (patchPatchPoints.size() <= pppi)
255 patchPatchPoints.setSize(pppi+100);
256 patchPatchPointConstraints_.setSize
262 patchPatchPointSet.insert(meshPointi, pppi);
263 patchPatchPoints[pppi] = meshPointi;
264 constraintI = pppi++;
269 patchPatchPointConstraints_[constraintI].combine
271 constraints[coupledPointi]
279 nPatchPatchPoints = pppi;
280 patchPatchPoints.setSize(nPatchPatchPoints);
281 patchPatchPointConstraints_.setSize(nPatchPatchPoints);
286 Pout<<
indent <<
"Have (global) constrained points:"
287 << nPatchPatchPoints <<
endl;
294 patchPatchPointConstraintPoints_.
setSize(nPatchPatchPoints);
295 patchPatchPointConstraintTensors_.
setSize(nPatchPatchPoints);
297 label nConstraints = 0;
299 forAll(patchPatchPointConstraints_, i)
304 if (patchPatchPointConstraints_[i].first() != 0)
306 patchPatchPointConstraintPoints_[nConstraints] =
309 patchPatchPointConstraintTensors_[nConstraints] =
310 patchPatchPointConstraints_[i].constraintTransformation();
318 Pout<<
indent <<
"Have non-trivial constrained points:"
319 << nConstraints <<
endl;
322 patchPatchPointConstraints_.setSize(nConstraints);
323 patchPatchPointConstraintPoints_.
setSize(nConstraints);
324 patchPatchPointConstraintTensors_.
setSize(nConstraints);
330 <<
"pointConstraints::makePatchPatchAddressing() : "
331 <<
"finished constructing boundary addressing"
345 Pout<<
"pointConstraints::pointConstraints(const pointMesh&): "
346 <<
"Constructing from pointMesh " << pm.name()
350 makePatchPatchAddressing();
360 Pout<<
"pointConstraints::~pointConstraints()" <<
endl;
369 makePatchPatchAddressing();
382 const bool overrideFixedValue
391 syncUntransformedData
399 constrainCorners(pf);
409 if (overrideFixedValue)
419 GeometricField<scalar, pointPatchField, pointMesh>& pf
427 GeometricField<label, pointPatchField, pointMesh>& pf
const Mesh & mesh() const
Return mesh.
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field.
void correctBoundaryConditions()
Correct boundary field.
virtual const fileName & name() const
Return the name of the stream.
void setSize(const label n)
Alias for resize()
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
const pointMesh & mesh() const
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
void size(const label n)
Older name for setAddressableSize.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
void updateMesh()
Update for new mesh topology.
Application of (multi-)patch point constraints.
bool movePoints()
Correct weighting factors for moving mesh.
~pointConstraints()
Destructor.
void constrainDisplacement(pointVectorField &displacement, const bool overrideValue=false) const
Apply boundary conditions (single-patch constraints),.
Mesh representing a set of points created from polyMesh.
const globalMeshData & globalData() const
Return parallel info.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
bool coupled(solutionDict.getOrDefault("coupledEnergyField", false))
List< label > labelList
A List of labels.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ostream & indent(Ostream &os)
Indent stream.
List< labelList > labelListList
A List of labelList.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
void Foam::pointConstraints::constrainCorners< Foam::label >(GeometricField< label, pointPatchField, pointMesh > &pf) const
void Foam::pointConstraints::constrainCorners< Foam::scalar >(GeometricField< scalar, pointPatchField, pointMesh > &pf) const
#define forAll(list, i)
Loop across all elements in list.